From 40f8632178d8418f2492f9b19405621ac70ea671 Mon Sep 17 00:00:00 2001 From: Gaëtan Gilbert Date: Fri, 28 Aug 2020 12:50:05 +0200 Subject: Make abstract compatible with mangle names Fix #12928 Fix #3146 --- test-suite/bugs/closed/bug_12928.v | 7 +++++++ test-suite/bugs/closed/bug_3146.v | 5 +++++ test-suite/success/name_mangling.v | 8 +++----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 test-suite/bugs/closed/bug_12928.v create mode 100644 test-suite/bugs/closed/bug_3146.v (limited to 'test-suite') diff --git a/test-suite/bugs/closed/bug_12928.v b/test-suite/bugs/closed/bug_12928.v new file mode 100644 index 0000000000..2f4d1dd16d --- /dev/null +++ b/test-suite/bugs/closed/bug_12928.v @@ -0,0 +1,7 @@ + +Lemma test: forall (x:bool) (x: nat), nat. +Proof. intros y x; abstract (exact x). Qed. + +Set Mangle Names. +Lemma test': forall x : nat, nat. +Proof. intros x. abstract exact x. Qed. diff --git a/test-suite/bugs/closed/bug_3146.v b/test-suite/bugs/closed/bug_3146.v new file mode 100644 index 0000000000..c42e28818a --- /dev/null +++ b/test-suite/bugs/closed/bug_3146.v @@ -0,0 +1,5 @@ +Axiom x : True. +Goal nat -> nat. + intro x. + abstract (exact x). +Qed. diff --git a/test-suite/success/name_mangling.v b/test-suite/success/name_mangling.v index e982414206..e84d221d59 100644 --- a/test-suite/success/name_mangling.v +++ b/test-suite/success/name_mangling.v @@ -1,7 +1,6 @@ -(* -*- coq-prog-args: ("-mangle-names" "_") -*- *) +Set Mangle Names. (* Check that refine policy of redefining previous names make these names private *) -(* abstract can change names in the environment! See bug #3146 *) Goal True -> True. intro. @@ -58,7 +57,7 @@ Abort. Goal False -> False. intro H. -Fail abstract exact H. +abstract exact H. Abort. (* Variant *) @@ -74,8 +73,7 @@ Goal False -> False. intro H. (* Name H' is from Ltac here, so it preserves the privacy *) (* But abstract messes everything up *) -Fail let H' := H in abstract exact H'. -let H' := H in exact H'. +let H' := H in abstract exact H'. Qed. (* Variant *) -- cgit v1.2.3 From 2269c97be12263f96a538c1c5311b78b3eb67915 Mon Sep 17 00:00:00 2001 From: Gaëtan Gilbert Date: Fri, 28 Aug 2020 15:38:04 +0200 Subject: Name saved goals in name_mangling test Should be more robust with async proofs --- test-suite/success/name_mangling.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test-suite') diff --git a/test-suite/success/name_mangling.v b/test-suite/success/name_mangling.v index e84d221d59..d99e407b0d 100644 --- a/test-suite/success/name_mangling.v +++ b/test-suite/success/name_mangling.v @@ -69,7 +69,7 @@ Abort. (* Example from Jason *) -Goal False -> False. +Lemma lem1 : False -> False. intro H. (* Name H' is from Ltac here, so it preserves the privacy *) (* But abstract messes everything up *) @@ -109,7 +109,7 @@ Goal forall b : False, b = b. Fail destruct b0. Abort. -Goal forall b : False, b = b. +Lemma lem2 : forall b : False, b = b. now destruct b. Qed. End foo. -- cgit v1.2.3