Repository navigation
Conversation
vxc now checks an `unsat` answer of the integer solver, as it checks a bit-vector answer. src/hir/bv_check.rs becomes smt_check.rs, because it reads integer queries (QF_LIA) too. - The reader reads Int terms, and folds constants as the solver does. The translation makes the same sums, atoms, rows and clauses, with the same numbers, by the rules at the top of smt.vx. - Each lemma of `get-proof` must be the next clause. Each literal of a leaf must name an atom, and the lemma must have its negation. farkas.rs checks the tree, with each row of a split written as its sum over integer variables. - lrat.rs then checks the LRAT steps, with the lemmas as input clauses. farkas.rs now uses exact fractions of big integers, from the crates num-bigint and num-rational. Of the 585 `unsat` answers to the queries of the prover, 23 have a number of 2^127 or more. A checker with i128 numbers cannot accept them. The unit tests give the clauses of small queries, found by hand. They also change a proof of the solver in one place for each check. The test of the 45 sample queries now checks the proof of each `unsat` answer. vxc accepts all 585 proofs of the full set. Fixes: #4390
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 7 of #4268, third task. Fixes #4390.
This PR needs #4417, which makes the proofs that it checks. It is a GitHub stacked PR on #4417.
What changes
src/hir/bv_check.rsis nowsrc/hir/smt_check.rs, because it reads integer queries too.seam.rsand the tests use the new name.Intsort, numerals of any size,+,-,*,mod,div, Intiteand the comparisons. It folds constants as the solver does, so the two see the same terms.smt.vx. The sums, atoms, rows of the simplex and clauses are the same as in the solver, with the same numbers.get-proofgives the lemmas before the LRAT steps. For each lemma, the checker does these steps:terms <= b, and a negative one isterms >= b + 1.(w split n)is the bound of splitnon the path to the leaf.src/hir/farkas.rschecks the tree.src/hir/lrat.rschecks the LRAT steps. The lemmas are input clauses, after the clauses of the assertions.farkas.rsnow uses exact fractions of big integers, from the cratesnum-bigintandnum-rational. The twoTooLargeerrors are gone.docs/solver/integers.mdsays how vxc checks a proof.simplex.mdand the README no longer say that the checker usesi128.The checker does not compute Int values yet, so it does not check the
satanswers of integer queries. #4391 adds this when it sends the queries ofprover.rsto the solver.Numbers that do not fit an i128
The issue asked for this count. I took the 585
unsatanswers to theQF_LIAqueries of #4388, with:produce-proofson. These are the 584 answers within 10 s of #4417, and one that took 21 s.The largest number in a proof has 1,102 bits. So 23 of the 585 answers (4%) cannot pass a checker with
i128numbers. Products inside the check make this count higher. 200 queries have a constant of 2^63 or more, and 81 proofs have a number of 2^63 or more.Tests
smt_check.rs:=,modandite.ite.farkas.rsuse big fractions. Three tests on numbers pasti128replace the fourTooLargetests.smt_integer_queries_agree_with_z3.rsnow asks for a proof of each query. vxc must accept the proof of eachunsatanswer. 25 of the 45 queries areunsat, 13 proofs have lemmas, and 5 have splits, with cuts among them.unsatanswers of the full set.I broke the checker 19 ways, one at a time, with a switch at run time. Each break made a unit test fail, at the assertion for that check. At first, two breaks passed:
itemade the sums of its branches before the literal of its condition.I added tests for both, and both breaks fail now. The two breaks also make the test of the 45 queries fail, because vxc does not accept a proof.
I also changed the 585 proofs in 4 ways, one at a time:
In the 29 proofs that pass with a moved split, no leaf uses the bound of that split. So the proof stays valid.
Found on the way
(* 0 x)stopped the solver. The sum had a term with the coefficient 0, and the division by the GCD then divided by 0. The second commit of #4417 fixes this, with a test.Not in this PR
prover.rssends its queries to this solver withVX_SOLVER=vx, and checks the values ofsatanswers.