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

[destruct H] in a section can fail to clear [H] #2901

Open
coqbot opened this issue Sep 11, 2012 · 2 comments
Open

[destruct H] in a section can fail to clear [H] #2901

coqbot opened this issue Sep 11, 2012 · 2 comments
Labels
part: sections The section mechanism of Coq. part: tactics

Comments

@coqbot
Copy link
Contributor

coqbot commented Sep 11, 2012

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#2901
From: @ntc2
Reported version: 8.3
CC: @robbertkrebbers, @ntc2, @ppedrot

See also: BZ#2243

@coqbot
Copy link
Contributor Author

coqbot commented Sep 11, 2012

Comment author: @ntc2

Created attachment 356
Coq file with simple examples illustrating the bug (examples same in the description).

Using [destruct H] in a [Section] can fail to clear [H]. Outside of a section [H] is always cleared.

This bug is the real cause of the tactic loop in the
[firstorder'] example in CPDT (Ch 14.2 in the current draft).

Here is a simplified example of the problem (also included as attached .v file), tested in Coq 8.3pl4 on GNU/Linux:

(* Outside of a [Section] there is no problem *)
Theorem p :
forall (P Q : Prop), P /\ Q -> P.
   intros P Q H.
   destruct H. (* clears [H] as expected *)
   Abort.

(* But inside a [Section] there is a problem *)
Section section1.
   Variables P Q : Prop.
   Hypothesis H : P /\ Q.
   Theorem p : P.
     destruct H. (* does *not* clear [H] !!! ??? *)
     Abort.
End section1.

(* The problem goes away if rename [H] to [H'] *)
Section section2.
   Variables P Q : Prop.
   Hypothesis H : P /\ Q.
   Theorem p : P.
     rename H into H'.
     destruct H'. (* clears [H'] as expected *)
     Abort.
End section2.

(* But remains if we rename [H] identically *)
Section section3.
   Variables P Q : Prop.
   Hypothesis H : P /\ Q.
   Theorem p : P.
     rename H into H.
     destruct H. (* does *not* clear [H] !!! ??? *)
     Abort.
End section3.

Bug BZ#2243 may be related.

Attached file: destruct_in_section_bug_simplified.v (application/octet-stream, 1153 bytes)
Description: Coq file with simple examples illustrating the bug (examples same in the description).

@coqbot
Copy link
Contributor Author

coqbot commented Nov 22, 2016

Comment author: @silene

*** Bug BZ#5220 has been marked as a duplicate of this bug. ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: sections The section mechanism of Coq. part: tactics
Projects
None yet
Development

No branches or pull requests

2 participants