Skip to content

Commit 0312fd3

Browse files
authored
Merge pull request #1682 from GaloisInc/rwd/uninterp-prim
Allow SAWCore primitives to be treated as uninterpreted
2 parents 54d8f45 + 032fcb1 commit 0312fd3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

saw-core/src/Verifier/SAW/Name.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module Verifier.SAW.Name
4141
, ExtCns(..)
4242
, scFreshNameURI
4343
, PrimName(..)
44+
, primNameToExtCns
4445
-- * Naming Environments
4546
, SAWNamingEnv(..)
4647
, emptySAWNamingEnv
@@ -256,7 +257,8 @@ instance Ord (PrimName e) where
256257
instance Hashable (PrimName e) where
257258
hashWithSalt x pn = hashWithSalt x (primVarIndex pn)
258259

259-
260+
primNameToExtCns :: PrimName e -> ExtCns e
261+
primNameToExtCns (PrimName varIdx nm tp) = EC varIdx (ModuleIdentifier nm) tp
260262

261263
scFreshNameURI :: Text -> VarIndex -> URI
262264
scFreshNameURI nm i = fromMaybe (panic "scFreshNameURI" ["Failed to constructed name URI", show nm, show i]) $

saw-core/src/Verifier/SAW/Simulator.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ evalTermF cfg lam recEval tf env =
156156
case ftf of
157157
Primitive pn ->
158158
do pn' <- traverse evalType pn
159-
simPrimitive cfg pn'
159+
case simConstant cfg tf (primNameToExtCns pn') of
160+
Just m -> m
161+
Nothing -> simPrimitive cfg pn'
160162

161163
UnitValue -> return VUnit
162164

0 commit comments

Comments
 (0)