-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support quantifiers in ACSL #704
Conversation
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.
👍 Thanks for taking care of this. Looks good to me, I've only left some smaller comments.
Could you maybe add some small test cases? (maybe some using verification/Automizer and some for Referee?)
.../de/uni_freiburg/informatik/ultimate/cdt/translation/implementation/base/MainDispatcher.java
Show resolved
Hide resolved
...ltimate/cdt/translation/implementation/base/expressiontranslation/ExpressionTranslation.java
Outdated
Show resolved
Hide resolved
...src/de/uni_freiburg/informatik/ultimate/cdt/translation/implementation/base/ACSLHandler.java
Outdated
Show resolved
Hide resolved
...src/de/uni_freiburg/informatik/ultimate/cdt/translation/implementation/base/ACSLHandler.java
Outdated
Show resolved
Hide resolved
Regarding the test cases: I wanted to wait for #703 to write some tests with quantifiers over arrays, but I will just add some simple tests to demonstrate the basic functionality, |
...src/de/uni_freiburg/informatik/ultimate/cdt/translation/implementation/base/ACSLHandler.java
Outdated
Show resolved
Hide resolved
ca48b46
to
d288eb8
Compare
...k/ultimate/cdt/translation/implementation/base/expressiontranslation/IntegerTranslation.java
Show resolved
Hide resolved
...ormatik/ultimate/plugins/generator/codecheck/preferences/CodeCheckPreferenceInitializer.java
Outdated
Show resolved
Hide resolved
* Introduce ScopedHashMap for quantified variables and use it for the handling of IdentifierExpressions * Use type constraints in Boogie-quantifiers (with implication for \forall and "and" for \exists)
Otherwise the tests with quantifiers fail
7253c6b
to
e4645c2
Compare
This PR adds support for quantifiers in ACSL.
NotDefinedExpression
. There was also a AST object for aQuantifierExpression
that I just adapted to our needs.ACSLHandler
. The crucial steps in this translation are that we have to handle the quantified variables in the expression inside the quantifier properly (track the variables in aScopedHashMap
and first lookup when handling anIdentifierExpression
) and that we add type constraints over the quantified variables (ACSL may use bounded types that are translated to an unbounded type in Boogie).Note that we can only handle quantified expressions, where the inner expressions is side-effect free (which also does not allow any auxiliary statements). Therefore, quantified expressions that contain dereferences are currently not supported, but this should be fixed in #703.