aboutsummaryrefslogtreecommitdiffhomepage
path: root/proofs
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2015-09-20 15:34:19 +0200
committerGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2015-09-20 15:34:19 +0200
commitb3bd2696c31ad2cb544f3436ddb5a237fe7fa6fe (patch)
tree059f63fda56ae254df9ed763f1572b335f08d289 /proofs
parent0c766b2e3b54d96713a79e40661653c5486822a8 (diff)
Proof: suggest Admitted->Qed only if the proof is really complete (#4349)
Diffstat (limited to 'proofs')
-rw-r--r--proofs/proof.ml10
-rw-r--r--proofs/proof.mli3
-rw-r--r--proofs/proof_global.ml2
3 files changed, 12 insertions, 3 deletions
diff --git a/proofs/proof.ml b/proofs/proof.ml
index a7077d911..c7aa5bad9 100644
--- a/proofs/proof.ml
+++ b/proofs/proof.ml
@@ -173,6 +173,12 @@ let is_done p =
(* spiwack: for compatibility with <= 8.2 proof engine *)
let has_unresolved_evar p =
Proofview.V82.has_unresolved_evar p.proofview
+let has_shelved_goals p = not (CList.is_empty (p.shelf))
+let has_given_up_goals p = not (CList.is_empty (p.given_up))
+
+let is_complete p =
+ is_done p && not (has_unresolved_evar p) &&
+ not (has_shelved_goals p) && not (has_given_up_goals p)
(* Returns the list of partial proofs to initial goals *)
let partial_proof p = Proofview.partial_proof p.entry p.proofview
@@ -305,9 +311,9 @@ end
let return p =
if not (is_done p) then
raise UnfinishedProof
- else if not (CList.is_empty (p.shelf)) then
+ else if has_shelved_goals p then
raise HasShelvedGoals
- else if not (CList.is_empty (p.given_up)) then
+ else if has_given_up_goals p then
raise HasGivenUpGoals
else if has_unresolved_evar p then
(* spiwack: for compatibility with <= 8.3 proof engine *)
diff --git a/proofs/proof.mli b/proofs/proof.mli
index a2e10d813..a0ed0654d 100644
--- a/proofs/proof.mli
+++ b/proofs/proof.mli
@@ -75,6 +75,9 @@ val initial_euctx : proof -> Evd.evar_universe_context
to be considered (this does not require that all evars have been solved). *)
val is_done : proof -> bool
+(* Like is_done, but this time it really means done (i.e. nothing left to do) *)
+val is_complete : proof -> bool
+
(* Returns the list of partial proofs to initial goals. *)
val partial_proof : proof -> Term.constr list
diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml
index c02b90916..6c963bf70 100644
--- a/proofs/proof_global.ml
+++ b/proofs/proof_global.ml
@@ -341,7 +341,7 @@ type closed_proof_output = (Term.constr * Declareops.side_effects) list * Evd.ev
let return_proof ?(allow_partial=false) () =
let { pid; proof; strength = (_,poly,_) } = cur_pstate () in
if allow_partial then begin
- if Proof.is_done proof then begin
+ if Proof.is_complete proof then begin
msg_warning (str"The proof of " ++ str (Names.Id.to_string pid) ++
str" is complete, no need to end it with Admitted");
end;