File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -896,6 +896,20 @@ primitives = Map.fromList
896
896
, " subshell and resume execution."
897
897
]
898
898
899
+ , prim " proof_checkpoint" " ProofScript (() -> ProofScript ())"
900
+ (pureVal proof_checkpoint)
901
+ Experimental
902
+ [ " Capture the current state of the proof and return a"
903
+ , " ProofScript monadic action that, if invoked, will reset the"
904
+ , " state of the proof back to to what it was at the"
905
+ , " moment checkpoint was invoked."
906
+ , " "
907
+ , " NOTE that this facility is highly experimental and may not"
908
+ , " be entirely reliable. It is intended only for proof development"
909
+ , " where it can speed up the process of experimenting with"
910
+ , " mid-proof changes. Finalized proofs should not use this facility."
911
+ ]
912
+
899
913
, prim " define" " String -> Term -> TopLevel Term"
900
914
(pureVal definePrim)
901
915
Current
Original file line number Diff line number Diff line change @@ -624,6 +624,15 @@ checkpoint = TopLevel_ $
624
624
do printOutLnTop Info " Restoring state from checkpoint"
625
625
restoreCheckpoint chk
626
626
627
+ -- | Capture the current proof state and return an
628
+ -- action that, if invoked, resets the state back to that point.
629
+ proof_checkpoint :: ProofScript (() -> ProofScript () )
630
+ proof_checkpoint =
631
+ do ps <- get
632
+ return $ \ _ ->
633
+ do scriptTopLevel (printOutLnTop Info " Restoring proof state from checkpoint" )
634
+ put ps
635
+
627
636
throwTopLevel :: String -> TopLevel a
628
637
throwTopLevel msg = do
629
638
pos <- getPosition
You can’t perform that action at this time.
0 commit comments