File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ import Verifier.SAW.Prim (rethrowEvalError)
74
74
import Verifier.SAW.Rewriter
75
75
import Verifier.SAW.Testing.Random (prepareSATQuery , runManyTests )
76
76
import Verifier.SAW.TypedAST
77
+ import qualified Verifier.SAW.Simulator.TermModel as TM
77
78
78
79
import SAWScript.Position
79
80
@@ -492,6 +493,14 @@ resolveName sc nm =
492
493
fallback = fst <$> io (scResolveUnambiguous sc tnm)
493
494
494
495
496
+ normalize_term :: TypedTerm -> TopLevel TypedTerm
497
+ normalize_term tt =
498
+ do sc <- getSharedContext
499
+ modmap <- io (scGetModuleMap sc)
500
+ tm' <- io (TM. normalizeSharedTerm sc modmap mempty mempty (ttTerm tt))
501
+ pure tt{ ttTerm = tm' }
502
+
503
+
495
504
unfoldGoal :: [String ] -> ProofScript ()
496
505
unfoldGoal unints =
497
506
execTactic $ tacticChange $ \ goal ->
Original file line number Diff line number Diff line change @@ -1209,6 +1209,11 @@ primitives = Map.fromList
1209
1209
Experimental
1210
1210
[ " hoist ifs in the current proof goal" ]
1211
1211
1212
+ , prim " normalize_term" " Term -> Term"
1213
+ (funVal1 normalize_term)
1214
+ Experimental
1215
+ [ " Normalize the given term by performing evaluation in SAWCore." ]
1216
+
1212
1217
, prim " goal_eval" " ProofScript ()"
1213
1218
(pureVal (goal_eval [] ))
1214
1219
Current
You can’t perform that action at this time.
0 commit comments