Skip to content

Commit

Permalink
Bump cryptol submodule, update withSolver calls.
Browse files Browse the repository at this point in the history
Update simple-smt version and enable `-threaded` runtime.
This tracks the changes from GaloisInc/cryptol#1225

The threaded runtime is necessary to keep `waitForProcess`
from stalling all threads in simple-smt.
  • Loading branch information
robdockins committed Jul 23, 2021
1 parent a3b0e53 commit 58d3648
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cabal.GHC-8.10.3.config
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ constraints: any.Cabal ==3.2.1.0,
any.simple-get-opt ==0.4,
any.simple-sendfile ==0.2.30,
simple-sendfile +allow-bsd,
any.simple-smt ==0.9.5,
any.simple-smt ==0.9.7,
any.smallcheck ==1.2.1,
any.split ==0.2.3.4,
any.splitmix ==0.1.0.3,
Expand Down
2 changes: 1 addition & 1 deletion cabal.GHC-8.10.4.config
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ constraints: any.Cabal ==3.2.1.0,
any.simple-get-opt ==0.4,
any.simple-sendfile ==0.2.30,
simple-sendfile +allow-bsd,
any.simple-smt ==0.9.5,
any.simple-smt ==0.9.7,
any.smallcheck ==1.2.1,
any.split ==0.2.3.4,
any.splitmix ==0.1.0.3,
Expand Down
2 changes: 1 addition & 1 deletion cabal.GHC-8.8.4.config
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ constraints: any.Cabal ==3.0.1.0,
any.simple-get-opt ==0.4,
any.simple-sendfile ==0.2.30,
simple-sendfile +allow-bsd,
any.simple-smt ==0.9.5,
any.simple-smt ==0.9.7,
any.smallcheck ==1.2.1,
any.split ==0.2.3.4,
any.splitmix ==0.1.0.3,
Expand Down
4 changes: 2 additions & 2 deletions cryptol-saw-core/css/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ cssMain css [inputModule,name] | cssMode css == NormalMode = do
modEnv <- CM.initialModuleEnv
let minp = CM.ModuleInput True (pure defaultEvalOpts) BS.readFile modEnv
(e,warn) <-
SMT.withSolver (meSolverConfig modEnv) $ \s ->
SMT.withSolver (return ()) (meSolverConfig modEnv) $ \s ->
CM.loadModuleByPath inputModule (minp s)
mapM_ (print . pp) warn
case e of
Expand Down Expand Up @@ -136,7 +136,7 @@ extractCryptol sc modEnv input = do
Right x -> return x
let minp = CM.ModuleInput True (pure defaultEvalOpts) BS.readFile modEnv
(exprResult, exprWarnings) <-
SMT.withSolver (meSolverConfig modEnv) $ \s ->
SMT.withSolver (return ()) (meSolverConfig modEnv) $ \s ->
CM.checkExpr pexpr (minp s)
mapM_ (print . pp) exprWarnings
((_, expr, schema), _modEnv') <-
Expand Down
4 changes: 2 additions & 2 deletions cryptol-saw-core/src/Verifier/SAW/CryptolEnv.hs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ resolveIdentifier env nm =
nameEnv = getNamingEnv env

doResolve pnm =
SMT.withSolver (meSolverConfig modEnv) $ \s ->
SMT.withSolver (return ()) (meSolverConfig modEnv) $ \s ->
do let minp = MM.ModuleInput True (pure defaultEvalOpts) ?fileReader modEnv
(res, _ws) <- MM.runModuleM (minp s) $
MM.interactive (MB.rename interactiveName nameEnv (MR.renameVar MR.NameUse pnm))
Expand Down Expand Up @@ -653,7 +653,7 @@ liftModuleM ::
ME.ModuleEnv -> MM.ModuleM a -> IO (a, ME.ModuleEnv)
liftModuleM env m =
do let minp = MM.ModuleInput True (pure defaultEvalOpts) ?fileReader env
SMT.withSolver (meSolverConfig env) $ \s ->
SMT.withSolver (return ()) (meSolverConfig env) $ \s ->
MM.runModuleM (minp s) m >>= moduleCmdResult

defaultEvalOpts :: E.EvalOpts
Expand Down
4 changes: 2 additions & 2 deletions saw-script.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ executable saw
, cryptol-saw-core
, aig

GHC-options: -O2 -Wall -Werror -fno-ignore-asserts -fno-spec-constr-count
GHC-options: -O2 -Wall -Werror -threaded -fno-ignore-asserts -fno-spec-constr-count

test-suite integration_tests
type: exitcode-stdio-1.0
hs-source-dirs: intTests

ghc-options: -Wall
ghc-options: -Wall -threaded
default-language: Haskell2010

main-is: IntegrationTest.hs
Expand Down
2 changes: 1 addition & 1 deletion src/SAWScript/AutoMatch/Cryptol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ getDeclsCryptol path = do
modEnv <- M.initialModuleEnv
let minp = M.ModuleInput True (pure evalOpts) BS.readFile modEnv
(result, warnings) <-
SMT.withSolver (meSolverConfig modEnv) $ \s ->
SMT.withSolver (return ()) (meSolverConfig modEnv) $ \s ->
M.loadModuleByPath path (minp s)
return $ do
forM_ warnings $ liftF . flip Warning () . pretty
Expand Down
2 changes: 1 addition & 1 deletion src/SAWScript/Builtins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ defaultTypedTerm :: Options -> SharedContext -> C.SolverConfig -> TypedTerm -> I
defaultTypedTerm opts sc cfg tt@(TypedTerm (TypedTermSchema schema) trm)
| null (C.sVars schema) = return tt
| otherwise = do
mdefault <- C.withSolver cfg (\s -> C.defaultReplExpr s undefined schema)
mdefault <- C.withSolver (return ()) cfg (\s -> C.defaultReplExpr s undefined schema)
let inst = do (soln, _) <- mdefault
mapM (`lookup` soln) (C.sVars schema)
case inst of
Expand Down

0 comments on commit 58d3648

Please sign in to comment.