-
Notifications
You must be signed in to change notification settings - Fork 143
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
Update to use conditional elaboration #2483
Conversation
The performance charts were created before rebasing on top of #2482, so the discrepancy may be more pronounced than it really is. I will refresh them in a couple of hours. |
Great!!!!!! Are there tests running with cvc5? I am curious how the time compares between cvc5 and z3 :) |
The situtation with LH tests on CVC5 is not very straightforward, unfortunately. There are two issues at the moment:
If I exclude these two test groups, the performance seems comparable to Z3. |
Here are performance diffs comparing the CVC5 run excluding |
A combination of the latest LF changes and fac8f57 causes the current breakage of tests. Previously we've had an incorrect definition of sort signatures (missing a type abstraction prefix) for elaborated set and bag operations in LF, which caused the apply machinery to always generate additional applys for Looking at the commit, it seems the removal of |
`x `S.member` (S.difference (S.fromList (giUseVars (giSrc info))) (S.fromList (specAxiomVars info))) indeed fixes the broken https://github.com/ucsd-progsys/liquidhaskell/blob/develop/tests/pos/Maps.hs but breaks the newly introduced https://github.com/ucsd-progsys/liquidhaskell/blob/develop/tests/pos/Meas12.hs instead. |
Hard to say without knowing why you would need to filter qualifiers with giUseVars. To start somewhere, |
The PR (or rather the underlying ucsd-progsys/liquid-fixpoint#734) introduces many changes, but the relevant change here is in https://github.com/clayrat/liquid-fixpoint/blob/cvc5-theories/src/Language/Fixpoint/Smt/Theories.hs#L495-L509: - , interpSym arrMapNotS "(_ map not)" (FFunc setArrSort setArrSort)
- , interpSym arrMapOrS "(_ map or)" (FFunc setArrSort $ FFunc setArrSort setArrSort)
- , interpSym arrMapAndS "(_ map and)" (FFunc setArrSort $ FFunc setArrSort setArrSort)
- , interpSym arrMapImpS "(_ map =>)" (FFunc setArrSort $ FFunc setArrSort setArrSort)
+ , interpSym arrMapNotS "(_ map not)" (FAbs 0 $ FFunc setArrSort setArrSort)
+ , interpSym arrMapOrS "(_ map or)" (FAbs 0 $ FFunc setArrSort $ FFunc setArrSort setArrSort)
+ , interpSym arrMapAndS "(_ map and)" (FAbs 0 $ FFunc setArrSort $ FFunc setArrSort setArrSort)
+ , interpSym arrMapImpS "(_ map =>)" (FAbs 0 $ FFunc setArrSort $ FFunc setArrSort setArrSort)
....
- , interpSym arrMapPlusB "(_ map (+ (Int Int) Int))" (FFunc bagArrSort $ FFunc bagArrSort bagArrSort)
- , interpSym arrMapLeB "(_ map (<= (Int Int) Bool))" (FFunc bagArrSort $ FFunc bagArrSort setArrSort)
- , interpSym arrMapGtB "(_ map (> (Int Int) Bool))" (FFunc bagArrSort $ FFunc bagArrSort setArrSort)
- , interpSym arrMapIteB "(_ map (ite (Bool Int Int) Int))" (FFunc setArrSort $ FFunc bagArrSort $ FFunc bagArrSort bagArrSort)
+ , interpSym arrMapPlusB "(_ map (+ (Int Int) Int))" (FAbs 0 $ FFunc bagArrSort $ FFunc bagArrSort bagArrSort)
+ , interpSym arrMapLeB "(_ map (<= (Int Int) Bool))" (FAbs 0 $ FFunc bagArrSort $ FFunc bagArrSort setArrSort)
+ , interpSym arrMapGtB "(_ map (> (Int Int) Bool))" (FAbs 0 $ FFunc bagArrSort $ FFunc bagArrSort setArrSort)
+ , interpSym arrMapIteB "(_ map (ite (Bool Int Int) Int))" (FAbs 0 $ FFunc setArrSort $ FFunc bagArrSort $ FFunc bagArrSort bagArrSort) Adding the extra outer type abstraction (
|
One potential workaround for this problem is to force |
Only for my enlightenment, what do you think a well designed fix would be? |
I think the proper way forward would be to try and implement dynamic However, this change seems non-trivial and could take a while, in the meantime we could restore the filtering on |
I'm not acquainted with the sort generation at play in the PR, but AFAIU allowing for more qualifiers, as in fac8f57, is requiring more sorts to make those qualifiers well-sorted. What the proposed workaround achieves is to make the existing tests pass, while (I sense) other tests could be written that would also make verification crash because of missing sorts. Is this really the case? If so we might just disable the failing test, and document the limitation in terms that users can understand, since adding |
For CVC5 I've additionally had to disable |
Updated to latest LF version and merged with |
Btw, @clayrat -- re hanging with CVC5 -- the |
Yes, that's exactly what I'm doing now, I've even located the specific statement that's causing it to hang. The problem is that this happens near the end of a ~40 Mb file that LF generates, so I'm trying to figure out if there's any way to minimize it before trying to submit. However, doing so seems to change where the hanging happens :) |
Update to use ucsd-progsys/liquid-fixpoint#734
Some caveats:
pos/Maps
andple/pos/PolySetBar
tests had to be disabled globally because they don't work with the combination of corrected theory sort signatures (ucsd-progsys/liquid-fixpoint@55211d9) and commit fac8f57. The solution to getting them working is most likely to implement the dynamic apply generation.benchmark-bytestring/Data/ByteString/Lazy
andple/pos/Permutations
additionally have to be disabled when running the test suite with CVC5.