-
Notifications
You must be signed in to change notification settings - Fork 42
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
WIP Syntactic simplifications #4022
base: master
Are you sure you want to change the base?
Conversation
76fa380
to
bebd5c0
Compare
Refactor `applyRule` and `applyEquation` to check `requires`/`ensures` in separate functions. This will make reviewing #4022 easier.
bebd5c0
to
c4a7dec
Compare
Fix unit tests
Run test-syntactic-simplification Fix test
322432f
to
908ddf6
Compare
[] -> | ||
unless (null restRequires') $ | ||
-- no more @syntacticRequires@, but unresolved conditions remain: abort | ||
throwRemainingRequires currentSubst restRequires' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we throw here?? i would expect at the base case to simply check the regular requires clauses...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, the simplifications marked as syntactic
must be only applied "syntactically", which means their side condition must not go to Z3. If we do not stop here, we will proceed to trying to discharge a syntactic simplification as a regular one, and, as far as I understand, we do not want that. We want them either to succeed fast or to fail fast. @PetarMax do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the code: we never want to transfer control to checkRequiresSemantically
from checkRequiresSyntactically
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the semantics of the syntactic(1)
attribute is:
- the
simplification
is syntactic, Z3 is never called - the clause 1 is the driver clause which learns its variables from the known truth, and the the substitution for these learned variables is applied to all other clauses
I.e. the whole simplification
is syntactic
, not a clause of a simplification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, for me, the clauses marked as syntactic should be checked syntactically, the other ones should be checked semantically. A simplification can have both syntactic and semantic clauses.
This still does mean, I think, that checkRequiresSyntactically
should not call checkRequiresSemantically
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But also, all syntactics should be handled first, I think.
Thanks @PetarMax, we'll modify the code to do that then. |
…g variables that only appear in the requires clause with syntactic
Fixes #3861