-
Notifications
You must be signed in to change notification settings - Fork 277
Quantifiers #6550
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
Quantifiers #6550
Conversation
kroening
commented
Dec 27, 2021
- Each commit message has a non-empty body, explaining why the change was made.
- Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
- The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
- Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
- n/a My commit message includes data points confirming performance improvements (if claimed).
- My PR is restricted to a single feature or bugfix.
- n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.
dd74a57
to
7dc065f
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6550 +/- ##
========================================
Coverage 75.98% 75.98%
========================================
Files 1578 1578
Lines 181044 181058 +14
========================================
+ Hits 137563 137579 +16
+ Misses 43481 43479 -2
Continue to review full report at Codecov.
|
4956360
to
84ff409
Compare
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.
I believe there are multiple issues in the commit introducing support for multiple variables as detailed below.
new_variables.pop_back(); | ||
auto new_expression = | ||
quantifier_exprt(expr.id(), expr.variables().back(), expr.where()); | ||
return eager_quantifier_instantiation(new_expression, ns); |
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.
This function doesn't exist at the point of this commit (else line 142 should already say "eager_quantifier_instantiation").
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.
This will go way once rebased on #6551.
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.
Now fixed with separate commit.
auto new_variables = expr.variables(); | ||
new_variables.pop_back(); | ||
auto new_expression = | ||
quantifier_exprt(expr.id(), expr.variables().back(), expr.where()); |
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 what about all the other variables, don't they just get dropped? Shouldn't expr.where()
be replaced by quantifier_exprt{expr.id(), new_variables, expr.where()}
?
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.
yes, fixed
else | ||
{ |
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.
We could reduce code churn by removing the else
here?
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.
ok
;(define-fun q2 () Bool (exists ((b (_ BitVec 8))) (not (= b #x00)))) | ||
|
||
;(define-fun q3 () Bool (not (forall ((b (_ BitVec 8))) (= b #x00)))) | ||
;(define-fun q4 () Bool (not (forall ((b (_ BitVec 8))) (not (= b #x00))))) | ||
|
||
;(define-fun q5 () Bool (exists ((a (_ BitVec 8)) (b (_ BitVec 8))) (= a b))) | ||
;(define-fun q6 () Bool (not (forall ((a (_ BitVec 8)) (b (_ BitVec 8))) (= a b)))) | ||
|
||
;(define-fun q7 () Bool (forall ((a (_ BitVec 8))) (exists ((b (_ BitVec 8))) (= a b)))) | ||
|
||
; the above are all valid, and we assert one of them is not | ||
;(assert (not (and q1 q2 q3 q4 q5 q6 q7))) |
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 are all of these commented out?
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.
Now marked as a KNOWNBUG test.
This fixes a typo in the name of the directory of one of the tests.
Quantifier instantiation may happen eagerly, or incrementally, and renaming this function clarifies that this function is doing eager instantiation.
This adds support for eager instantiation of forall or exists quantifier expressions that have more than one symbol using the trivial rewrite.
This adds support for eager instantiation of quantifiers over booleans, using George Boole's Proposition II.
The quantifier_exprt offers a convenient wrapper for doing the instantiation.
The test currently fails, and will need an implementation.
84ff409
to
e4c5999
Compare
KNOWNBUG | ||
bv-quantifier-valid.smt2 | ||
|
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^unsat$ | ||
-- |
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.
It would be helpful for either this file or the commit message to include an explanation what exactly is missing here.