-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove preconditions from axioms [not yet ready for review] #1400
Open
typerSniper
wants to merge
39
commits into
dafny-lang:master
Choose a base branch
from
typerSniper:remove-preconditions-from-axioms
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Remove preconditions from axioms [not yet ready for review] #1400
typerSniper
wants to merge
39
commits into
dafny-lang:master
from
typerSniper:remove-preconditions-from-axioms
Conversation
This file contains 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
…ove-cancall-disjuncts
…ove-cancall-disjuncts
…n#canCall ==> f#canCall to the axiom
… the lhs, for the rhs
This was referenced Oct 28, 2021
Oh, no! I clicked the "marked this pull request as ready for review now" button by mistake. I will revert to the old-fashioned way of writing "[not yet ready for review]" in the title. |
RustanLeino
changed the title
Remove preconditions from axioms
Remove preconditions from axioms [not yet ready for review]
Oct 28, 2021
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.
This is the PR for removing the preconditions from consequence and definition axioms. Its a work in progress with several more bugs still to fix. Please see the commit messages at from Aug 26-27 for each detail.
By adding can calls to the post-condition of the function, we are able to perform induction : because we assume the canCall (and thus the consequence axiom) for every input != actual input. This with the decreases check for termination makes sure that this is sound (See
FibWithExtraPost
indafny0/FunctionSpecifications.dfy
)Cascading requires requires obligations can be avoided by canCall: performance + pruning (elaborate). Performance-wise it saves the solver from having to prove pre-conditions (in order to use consequence/definition axioms) repeatedly. Technically speaking, in order to prove a method/lemma/function, only the following functions are necessary:
That is, everything reachable from the preconditions of
level 2
can be safely pruned away. Once this PR works, this should happen automatically!The
isA
forcase BinaryExpr.ResolvedOpcode.NeqCommon:
only needs to be added when exactly one ofe.E1
ande.E2
is both: a DatatypeValue and Nullary.This is a bit lazy but I didn't get time to check the following line in
Translator.cs
:var canCallImp = BplImp(canCallFunc, canCallOverridingFunc);
Specifically, I am unsure of the order of arguments. This corresponds to giving can calls in the
override axiom
. The best way is to generate code and check it, which I should soon. But I'm semi-confident, this is correct as it is. A test for this seems important.