Repository navigation
verify: Count the calls inside cppverify::choose as calls of the function it is written in - #15
Merged
Merged
Conversation
…me its axiom only where they lower it.
… checks in ARCHITECTURE.md.
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.
A spec that applied itself inside
cppverify::choosewas not recursive to the verifier: the calls in a choose's body were never checked against the measure, so a definition could contradict itself, and a proof could use it to show anything.stuck(1)would have to equalstuck(1) + 1. On main both the termination ofstuckandforty_twoverify, althoughforty_two(1)returns 0. Withoutdecreases, such a spec was accepted as a plain axiom, and an inductive predicate could apply itself inside a choose, where it is not positive.A choose is lifted to a function of its own, but it is evaluated where it is written, so its calls now belong to that function:
decreases, and an inductive predicate whose group is applied inside one is rejected.forallandexists.stuckfails atn = 1) instead of needing the spec's own hidden definition.Testing:
suite/choose_recursion.cppandsuite/choose_recursion_errors.cppfail on main, whereforty_twoverifies in both,stuckterminates,unboundedis an axiom, andliaris accepted. Removing the axiom guard from either check turnsstuckorstuck_postintospec.hidden; never assuming the axiom failspick, whose termination needs it. Verify suite: 399 passed, 1 unsupported. A verdict differential against main over the 405 Verify sources (2142 verdicts) changes nothing.