Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof conventions 2 #1134

Merged
merged 11 commits into from
Apr 13, 2021
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