aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Tassi2020-02-28 16:51:24 +0100
committerEnrico Tassi2020-02-28 16:51:24 +0100
commit5c7d89641085e125471db089239e73a064073024 (patch)
treed1a170a097b1b4b57232613948b3b7fec9f5865f
parentaeca986089d005054496ed4bcf1b920e8fa02173 (diff)
parent721b6704a0fbee1be627c67e0a883fa40a81deb6 (diff)
Merge PR #11609: [stm] Use Default Proof Using only with Proof
-rw-r--r--stm/stm.ml7
-rw-r--r--test-suite/bugs/closed/bug_11342.v19
-rw-r--r--test-suite/output/bug_11342.out1
-rw-r--r--test-suite/output/bug_11342.v12
-rw-r--r--test-suite/output/bug_11608.out1
-rw-r--r--test-suite/output/bug_11608.v13
6 files changed, 50 insertions, 3 deletions
diff --git a/stm/stm.ml b/stm/stm.ml
index c79a1eed3d..95c58b9043 100644
--- a/stm/stm.ml
+++ b/stm/stm.ml
@@ -2157,22 +2157,23 @@ let collect_proof keep cur hd brkind id =
let has_default_proof_using = Option.has_some (Proof_using.get_default_proof_using ()) in
let proof_using_ast = function
| VernacProof(_,Some _) -> true
+ | VernacProof(_,None) -> has_default_proof_using
| _ -> false
in
let proof_using_ast = function
| Some (_, v) when proof_using_ast v.expr.CAst.v.expr
&& (not (Vernacprop.has_Fail v.expr)) -> Some v
| _ -> None in
- let has_proof_using x = has_default_proof_using || (proof_using_ast x <> None) in
+ let has_proof_using x = proof_using_ast x <> None in
let proof_no_using = function
- | VernacProof(t,None) -> t
+ | VernacProof(t,None) -> if has_default_proof_using then None else t
| _ -> assert false
in
let proof_no_using = function
| Some (_, v) -> proof_no_using v.expr.CAst.v.expr, v
| _ -> assert false in
let has_proof_no_using = function
- | VernacProof(_,None) -> true
+ | VernacProof(_,None) -> not has_default_proof_using
| _ -> false
in
let has_proof_no_using = function
diff --git a/test-suite/bugs/closed/bug_11342.v b/test-suite/bugs/closed/bug_11342.v
new file mode 100644
index 0000000000..3c163fb772
--- /dev/null
+++ b/test-suite/bugs/closed/bug_11342.v
@@ -0,0 +1,19 @@
+(* -*- mode: coq; coq-prog-args: ("-vos") -*- *)
+
+Section foo.
+ Context {H:True}.
+ Set Default Proof Using "Type".
+ Theorem test2 : True.
+ Proof.
+ (* BUG: this gets run when compiling with -vos *)
+ fail "proof with default using".
+ exact I.
+ Qed.
+
+ Theorem test3 : True.
+ Proof using Type.
+ (* this isn't run with -vos *)
+ fail "using".
+ exact I.
+ Qed.
+End foo.
diff --git a/test-suite/output/bug_11342.out b/test-suite/output/bug_11342.out
new file mode 100644
index 0000000000..9aac16de0d
--- /dev/null
+++ b/test-suite/output/bug_11342.out
@@ -0,0 +1 @@
+without using
diff --git a/test-suite/output/bug_11342.v b/test-suite/output/bug_11342.v
new file mode 100644
index 0000000000..73131a3190
--- /dev/null
+++ b/test-suite/output/bug_11342.v
@@ -0,0 +1,12 @@
+(* -*- mode: coq; coq-prog-args: ("-vos") -*- *)
+
+Section foo.
+ Context {H:True}.
+ Theorem test1 : True.
+ Proof.
+ (* this gets printed with -vos because there's no annotation (either [Set
+ Default Proof Using ...] or an explicit [Proof using ...]) *)
+ idtac "without using".
+ exact I.
+ Qed.
+End foo.
diff --git a/test-suite/output/bug_11608.out b/test-suite/output/bug_11608.out
new file mode 100644
index 0000000000..793ff768d4
--- /dev/null
+++ b/test-suite/output/bug_11608.out
@@ -0,0 +1 @@
+creating x without [Proof.]
diff --git a/test-suite/output/bug_11608.v b/test-suite/output/bug_11608.v
new file mode 100644
index 0000000000..3929082913
--- /dev/null
+++ b/test-suite/output/bug_11608.v
@@ -0,0 +1,13 @@
+(* -*- mode: coq; coq-prog-args: ("-vos") -*- *)
+
+Set Default Proof Using "Type".
+
+Section foo.
+ Context (A:Type).
+ Definition x : option A.
+ (* this can get printed with -vos since without "Proof." there's no Proof
+ using, even with a default annotation. *)
+ idtac "creating x without [Proof.]".
+ exact None.
+ Qed.
+End foo.