File tree 9 files changed +162
-113
lines changed
saw-core/src/Verifier/SAW
saw-core-aig/src/Verifier/SAW/Simulator
saw-core-sbv/src/Verifier/SAW/Simulator
saw-core-what4/src/Verifier/SAW/Simulator
9 files changed +162
-113
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ pure3 f x y z = pure (f x y z)
170
170
prims :: AIG. IsAIG l g => g s -> Prims. BasePrims (BitBlast (l s ))
171
171
prims be =
172
172
Prims. BasePrims
173
- { Prims. bpAsBool = AIG. asConstant be
173
+ { Prims. bpIsSymbolicEvaluator = True
174
+ , Prims. bpAsBool = AIG. asConstant be
174
175
-- Bitvectors
175
176
, Prims. bpUnpack = pure1 vFromLV
176
177
, Prims. bpPack = pure1 lvFromV
Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ pure3 f x y z = pure (f x y z)
105
105
prims :: Prims. BasePrims SBV
106
106
prims =
107
107
Prims. BasePrims
108
- { Prims. bpAsBool = svAsBool
108
+ { Prims. bpIsSymbolicEvaluator = True
109
+ , Prims. bpAsBool = svAsBool
109
110
, Prims. bpUnpack = svUnpack
110
111
, Prims. bpPack = pure1 symFromBits
111
112
, Prims. bpBvAt = pure2 svAt
Original file line number Diff line number Diff line change @@ -161,7 +161,8 @@ prims :: forall sym.
161
161
Sym sym => sym -> Prims. BasePrims (What4 sym )
162
162
prims sym =
163
163
Prims. BasePrims
164
- { Prims. bpAsBool = W. asConstantPred
164
+ { Prims. bpIsSymbolicEvaluator = True
165
+ , Prims. bpAsBool = W. asConstantPred
165
166
-- Bitvectors
166
167
, Prims. bpUnpack = SW. bvUnpackBE sym
167
168
, Prims. bpPack = SW. bvPackBE sym
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ import Prelude hiding (mapM)
35
35
import Control.Applicative ((<$>) )
36
36
#endif
37
37
import Control.Monad (foldM , liftM )
38
- -- import Control.Monad.IO.Class
38
+ import Control.Monad.Trans.Except
39
39
import Control.Monad.Trans.Maybe
40
40
import Control.Monad.Fix (MonadFix (mfix ))
41
41
import Control.Monad.Identity (Identity )
@@ -624,6 +624,11 @@ evalPrim fallback pn = loop [] (primType pn)
624
624
Just v -> loop ((ready x',t): env) tp' (f v)
625
625
_ -> fallback msg ((ready x',t): env) tp'
626
626
627
+ loop env tp (Prims. PrimExcept m) =
628
+ runExceptT m >>= \ case
629
+ Right v -> pure v
630
+ Left msg -> fallback msg env tp
631
+
627
632
loop _env _tp (Prims. Prim m) = m
628
633
loop _env _tp (Prims. PrimValue v) = pure v
629
634
Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ ite b x y = if b then x else y
132
132
prims :: Prims. BasePrims Concrete
133
133
prims =
134
134
Prims. BasePrims
135
- { Prims. bpAsBool = Just
135
+ { Prims. bpIsSymbolicEvaluator = False
136
+ , Prims. bpAsBool = Just
136
137
, Prims. bpUnpack = pure1 Prim. unpackBitVector
137
138
, Prims. bpPack = pure1 Prim. packBitVector
138
139
, Prims. bpBvAt = pure2 Prim. bvAt
You can’t perform that action at this time.
0 commit comments