Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions saw-central/src/SAWCentral/Builtins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import SAWCore.Typechecker (tcInsertModule, inferCompleteTerm)
import SAWCore.Term.Functor
import SAWCore.Term.Pretty (ppTerm, scPrettyTerm)
import SAWCore.Term.Raw
import qualified SAWCore.TermNet as Net
import CryptolSAWCore.TypedTerm

import SAWCore.Prim (rethrowEvalError)
Expand Down Expand Up @@ -1563,6 +1564,9 @@ addsimp_shallow thm ss =
Nothing -> fail "addsimp: theorem not an equation"
Just rule -> pure (addRule (shallowRule rule) ss)

mergesimpsets :: SV.SAWSimpset -> SV.SAWSimpset -> TopLevel SV.SAWSimpset
mergesimpsets ss1 ss2 = pure (Net.merge ss1 ss2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't need to be in TopLevel at the Haskell level, you can remove TopLevel here and change funVal2 to pureVal where it's bound in the table. FWIW


-- TODO: remove this, it implicitly adds axioms
addsimp' :: Term -> SV.SAWSimpset -> TopLevel SV.SAWSimpset
addsimp' t ss =
Expand Down
5 changes: 5 additions & 0 deletions saw-script/src/SAWScript/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,11 @@ primitives = Map.fromList $
, "set. Returns a new set."
]

, prim "mergesimpsets" "Simpset -> Simpset -> Simpset"
(funVal2 mergesimpsets)
Current
[ "Merge two simplification sets into one." ]

, prim "addsimp'" "Term -> Simpset -> Simpset"
(funVal2 addsimp')
HideDeprecated
Expand Down
Loading