Skip to content

Commit

Permalink
Update saw-remote-api with Simpset changes.
Browse files Browse the repository at this point in the history
TODO! We currently are allowing users to create simpsets from
raw terms, and probably we should only let `Theorem` values
be turned into rewrite rules.
  • Loading branch information
robdockins committed Apr 27, 2021
1 parent 5db07a7 commit ebfb9eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions saw-remote-api/src/SAWServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ import qualified SAWScript.Crucible.LLVM.MethodSpecIR as CMS (SomeLLVM, LLVMModu
import SAWScript.Options (defaultOptions)
import SAWScript.Position (Pos(..))
import SAWScript.Prover.Rewrite (basic_ss)
import SAWScript.Value (AIGProxy(..), BuiltinContext(..), JVMSetupM, LLVMCrucibleSetupM, TopLevelRO(..), TopLevelRW(..), defaultPPOpts)
import SAWScript.Value (AIGProxy(..), BuiltinContext(..), JVMSetupM, LLVMCrucibleSetupM, TopLevelRO(..), TopLevelRW(..), defaultPPOpts, SAWSimpset)
import qualified Verifier.SAW.Cryptol.Prelude as CryptolSAW
import Verifier.SAW.CryptolEnv (initCryptolEnv, bindTypedTerm)
import Verifier.SAW.Rewriter (Simpset)
import qualified Cryptol.Utils.Ident as Cryptol

import qualified Argo
Expand Down Expand Up @@ -275,7 +274,7 @@ data CrucibleSetupTypeRepr :: Type -> Type where

data ServerVal
= VTerm TypedTerm
| VSimpset Simpset
| VSimpset SAWSimpset
| VType Cryptol.Schema
| VCryptolModule CryptolModule -- from SAW, includes Term mappings
| VJVMClass JSS.Class
Expand Down Expand Up @@ -305,7 +304,7 @@ class IsServerVal a where
instance IsServerVal TypedTerm where
toServerVal = VTerm

instance IsServerVal Simpset where
instance IsServerVal SAWSimpset where
toServerVal = VSimpset

instance IsServerVal Cryptol.Schema where
Expand Down Expand Up @@ -402,7 +401,7 @@ getLLVMMethodSpecIR n =
VLLVMMethodSpecIR ir -> return ir
_other -> Argo.raise (notAnLLVMMethodSpecIR n)

getSimpset :: ServerName -> Argo.Command SAWState Simpset
getSimpset :: ServerName -> Argo.Command SAWState SAWSimpset
getSimpset n =
do v <- getServerVal n
case v of
Expand Down
2 changes: 1 addition & 1 deletion saw-remote-api/src/SAWServer/ProofScript.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ makeSimpset params = do
v <- getServerVal n
case v of
VSimpset ss' -> return (merge ss ss')
VTerm t -> return (addSimp (ttTerm t) ss)
VTerm t -> return (addSimp (ttTerm t) Nothing ss) -- TODO! making rewrite rules from terms!
_ -> Argo.raise (notASimpset n)
ss <- foldM add emptySimpset (ssElements params)
setServerVal (ssResult params) ss
Expand Down

0 comments on commit ebfb9eb

Please sign in to comment.