Skip to content

Commit

Permalink
Merge pull request #960 from GaloisInc/issue958
Browse files Browse the repository at this point in the history
Fix the bit-order convention for `extractWord` in the What4 backend
  • Loading branch information
robdockins authored Nov 12, 2020
2 parents a7d352b + f730750 commit d00ff6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cryptol/Backend/What4.hs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ instance W4.IsSymExprBuilder sym => Backend (What4 sym) where
return (l, r)

extractWord (What4 sym _) bits idx bv =
liftIO $ SW.bvSliceBE sym idx bits bv
liftIO $ SW.bvSliceLE sym idx bits bv

wordEq (What4 sym _) x y = liftIO (SW.bvEq sym x y)
wordLessThan (What4 sym _) x y = liftIO (SW.bvult sym x y)
Expand Down
5 changes: 5 additions & 0 deletions tests/issues/issue958.icry
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:set prover=sbv-z3
:prove (\x y -> split (x#y) == [x :[64] ,y])

:set prover=w4-z3
:prove (\x y -> split (x#y) == [x :[64] ,y])
3 changes: 3 additions & 0 deletions tests/issues/issue958.icry.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Loading module Cryptol
Q.E.D.
Q.E.D.

0 comments on commit d00ff6b

Please sign in to comment.