mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-17 13:01:31 +03:00
Support toInteger/fromInteger with symbolic arguments in :prove/:sat.
This commit is contained in:
parent
5332d98261
commit
571d186c6c
@ -211,14 +211,14 @@ instance BitWord SBool SWord SInteger where
|
||||
svToInteger :: SWord -> SInteger
|
||||
svToInteger w =
|
||||
case svAsInteger w of
|
||||
Nothing -> evalPanic "toInteger" ["unsupported symbolic argument"]
|
||||
Nothing -> svFromIntegral KUnbounded w
|
||||
Just x -> svInteger KUnbounded x
|
||||
|
||||
-- TODO: implement this properly in SBV using "int2bv"
|
||||
svFromInteger :: Integer -> SInteger -> SWord
|
||||
svFromInteger n i =
|
||||
case svAsInteger i of
|
||||
Nothing -> evalPanic "fromInteger" ["unsupported symbolic argument"]
|
||||
Nothing -> svFromIntegral (KBounded False (fromInteger n)) i
|
||||
Just x -> literalSWord (fromInteger n) x
|
||||
|
||||
-- Errors ----------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user