Skip to content

Commit

Permalink
Merge pull request #109 from GaloisInc/fix-fromIntMod
Browse files Browse the repository at this point in the history
Fix implementation of `fromIntMod` in concrete evaluation backend.
  • Loading branch information
brianhuffman authored Nov 25, 2020
2 parents 296bc6d + 2d04786 commit 93cd7bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion saw-core/src/Verifier/SAW/Simulator/Concrete.hs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ constMap =
, ("Prelude.sbvToInt", sbvToIntOp)
-- Integers mod n
, ("Prelude.toIntMod" , toIntModOp)
, ("Prelude.fromIntMod", constFun (VFun force))
, ("Prelude.fromIntMod", fromIntModOp)
, ("Prelude.intModEq" , intModEqOp)
, ("Prelude.intModAdd" , intModBinOp (+))
, ("Prelude.intModSub" , intModBinOp (-))
Expand Down Expand Up @@ -320,6 +320,12 @@ toIntModOp =
Prims.intFun "toIntModOp" $ \x -> return $
VIntMod n (x `mod` toInteger n)

fromIntModOp :: CValue
fromIntModOp =
constFun $
Prims.intModFun "fromIntModOp" $ \x -> pure $
VInt x

intModEqOp :: CValue
intModEqOp =
constFun $
Expand Down

0 comments on commit 93cd7bd

Please sign in to comment.