-
Notifications
You must be signed in to change notification settings - Fork 13
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
what4: Don't annotate {Nonce,}AppExpr
s
#247
base: master
Are you sure you want to change the base?
Conversation
a3199cb
to
1dd0545
Compare
1dd0545
to
bfb4b66
Compare
CI fails with:
the test: what4/what4/test/ExprBuilderSMTLib2.hs Lines 1144 to 1160 in e46dff4
I'm able to reproduce this locally with
On this branch, print e2A
print e2B
print e2C
print e2C'
print e2D yields
whereas on
|
Printf-debugging shows that this branch hits this case in what4/what4/src/What4/Expr/Builder.hs Line 1401 in e46dff4
whereas what4/what4/src/What4/Expr/Builder.hs Line 1425 in e46dff4
Counter-intuitively, it appears that hitting the more specialized case results in a less-specific answer. Possibly, the |
I think this may have to do with the fact that the catch-all case calls this function: what4/what4/src/What4/Expr/Builder.hs Lines 1213 to 1220 in e46dff4
whereas the more specific case calls
[EDIT]: This does not appear to be the problem, adding |
It appears that what4/what4/src/What4/Expr/Builder.hs Line 589 in e46dff4
whereas the result of what4/what4/src/What4/Expr/Builder.hs Line 590 in e46dff4
So I need to figure out why To be more specific, the question is why |
FWIW, let e2C' = O.BVDArith (A.range w 2 2)
let e2D = O.add e2C' (O.singleton w 1)
case O.asSingleton e2D of
Just bv -> pure () -- bv == mkBV w 3
Nothing -> error "sad" works just fine. Perhaps the abstract domain is getting lost when the binary |
Okay, I've managed to whittle down the issue to a test case, reported here (as it happens on |
Fixes #246. Really,
Annotation
shouldn't need to carry aNonce
, because the outerNonceAppExpr
will already have one. However, actually removing it is challenging due to the return type ofsbNonceExpr
, and in turnExprAllocator
'snonceExpr
, which returns anExpr
. Surely in practice, this is always aNonceAppExpr
, but there's no way to tell from the type. To avoid a larger refactor or introducing partiality, I'm keeping theNonce
inAnnotation
for now.Fixes #246, though we may want to create a follow-up about removing the
Nonce
fromAnnotation
.