Skip to content

Commit

Permalink
Merge pull request #1134 from GaloisInc/proof-conventions2
Browse files Browse the repository at this point in the history
Proof conventions 2
  • Loading branch information
mergify[bot] authored Apr 13, 2021
2 parents 46249db + 84012ac commit 9b51cd1
Show file tree
Hide file tree
Showing 18 changed files with 552 additions and 392 deletions.
2 changes: 1 addition & 1 deletion examples/misc/prove.saw
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
let f = {{ \ (x : [8]) -> (x + x) == (1 * x) }};
r <- prove abc f;
caseProofResult r
(print "Q.E.D.")
(\thm -> print "Q.E.D.")
(\v -> do { print "Oops." ; print v; print {{ f v }}; });
print "Done.";
2 changes: 1 addition & 1 deletion intTests/support/prove_or_die.saw
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let prove_or_die name thm = do {
print name;
r <- prove abc thm;
caseProofResult r
(print "True")
(\thm -> print "True")
(\c -> do {
print "False";
exit 1;
Expand Down
8 changes: 5 additions & 3 deletions saw-remote-api/src/SAWServer/ProofScript.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import qualified Argo
import qualified Argo.Doc as Doc
import qualified SAWScript.Builtins as SB
import qualified SAWScript.Value as SV
import qualified SAWScript.Proof as PF
import SAWServer
( ServerVal(VTerm, VSimpset),
ServerName,
Expand Down Expand Up @@ -170,10 +171,11 @@ prove params = do
proofScript <- interpretProofScript (ppScript params)
res <- tl $ SB.provePrim proofScript t
case res of
SV.Valid _ -> return ProofValid
SV.InvalidMulti _ _ -> return ProofInvalid
PF.ValidProof{} -> return ProofValid
PF.InvalidProof{} -> return ProofInvalid
PF.UnfinishedProof{} -> return ProofInvalid

interpretProofScript :: ProofScript -> Argo.Command SAWState (SV.ProofScript SV.SatResult)
interpretProofScript :: ProofScript -> Argo.Command SAWState (SV.ProofScript ())
interpretProofScript (ProofScript ts) = go ts
where go [UseProver ABC] = return $ SB.proveABC
go [UseProver (CVC4 unints)] = return $ SB.proveUnintCVC4 unints
Expand Down
Loading

0 comments on commit 9b51cd1

Please sign in to comment.