Skip to content

Commit f5918f5

Browse files
author
Brian Huffman
committed
Fix write_smtlib2 predicate/proposition term conventions.
Unlike function `writeSMTLib2` (which expects a saw-core proposition of type `sort 0`), `write_smtlib2` expects a predicate with a return type of `Bool`. Fixes #484.
1 parent 56e40a8 commit f5918f5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SAWScript/Prover/Exporter.hs

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import qualified Verifier.SAW.Simulator.BitBlast as BBSim
3636

3737

3838
import SAWScript.SAWCorePrimitives( bitblastPrimitives )
39+
import SAWScript.Proof (predicateToProp, Quantification(..))
3940
import SAWScript.Prover.SolverStats
4041
import SAWScript.Prover.Rewrite
4142
import SAWScript.Prover.Util
@@ -152,11 +153,13 @@ write_cnf sc f (TypedTerm schema t) = do
152153
writeSMTLib2 :: SharedContext -> FilePath -> Term -> IO ()
153154
writeSMTLib2 sc f t = writeUnintSMTLib2 [] sc f t
154155

155-
-- | As above, but check that the type is monomorphic and boolean.
156+
-- | Write a @Term@ representing a predicate (i.e. a monomorphic
157+
-- function returning a boolean) to an SMT-Lib version 2 file.
156158
write_smtlib2 :: SharedContext -> FilePath -> TypedTerm -> IO ()
157159
write_smtlib2 sc f (TypedTerm schema t) = do
158160
checkBooleanSchema schema
159-
writeSMTLib2 sc f t
161+
p <- predicateToProp sc Universal [] t
162+
writeSMTLib2 sc f p
160163

161164
-- | Write a @Term@ representing a theorem to an SMT-Lib version
162165
-- 2 file, treating some constants as uninterpreted.

0 commit comments

Comments
 (0)