Skip to content
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

Bug in What4 prover backends #958

Closed
robdockins opened this issue Nov 11, 2020 · 1 comment · Fixed by #960
Closed

Bug in What4 prover backends #958

robdockins opened this issue Nov 11, 2020 · 1 comment · Fixed by #960
Labels
bug Something not working correctly

Comments

@robdockins
Copy link
Contributor

There is some bug involving symbolic evaluation using What4 backends, probably involving the split primitive. It seems that the order of elements is reversed from what it should be.

Loading module Cryptol
Cryptol> :set prover=z3
Cryptol> :prove (\x y -> split (x#y) == [x:[32],y])
Q.E.D.
(Total Elapsed Time: 0.009s, using "Z3")
Cryptol> :set prover=w4-z3
Cryptol> :prove (\x y -> split (x#y) == [x:[32],y])
Counterexample
(\x y -> split (x # y) == [x : [32], y])
  0xffffffff 0x00000000 = False
(Total Elapsed Time: 0.027s, using "z3")
Cryptol> :prove (\x y -> split (x#y) == [y,x:[32]])
Q.E.D.
(Total Elapsed Time: 0.021s, using "z3")
@robdockins robdockins added the bug Something not working correctly label Nov 11, 2020
@robdockins
Copy link
Contributor Author

Turns out, the problem with split only occurs at bitvector types, and is because the extractWord operation is using the wrong bit order convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something not working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant