Skip to content

Commit ae2b3c9

Browse files
committed
Bug fix: simplify the pclearbot tactic
1 parent 39072d6 commit ae2b3c9

File tree

2 files changed

+20
-68
lines changed

2 files changed

+20
-68
lines changed

metasrc/pacotac.py

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,36 +80,12 @@
8080
(** ** [pclearbot] simplifies all hypotheses of the form [upaco{n} gf bot{n}] to [paco{n} gf bot{n}].
8181
*)
8282
83-
Definition pclearbot_orL (P Q: Prop) := P.
84-
Definition pclearbot_orR (P Q: Prop) := Q.
85-
8683
Ltac pclearbot :=
87-
generalize _paco_mark_cons;
88-
repeat(
89-
let H := match goal with
84+
repeat match goal with
9085
""",end="")
9186
for i in range(n+1):
92-
print (" | [H: context [bot"+str(i)+"] |- _] => H")
93-
print (""" end in
94-
let NH := fresh H in
95-
revert_until H;
96-
repeat (
97-
repeat red in H;
98-
match goal with [Hcrr: context f [or] |- _] =>
99-
match Hcrr with H =>
100-
first[(
101-
let P := context f [pclearbot_orL] in
102-
assert (NH: P) by (repeat intro; edestruct H ; [eassumption|repeat (match goal with [X: _ \/ _ |- _] => destruct X end); contradiction]);
103-
clear H; rename NH into H; unfold pclearbot_orL in H
104-
) | (
105-
let P := context f [pclearbot_orR] in
106-
assert (NH: P) by (repeat intro; edestruct H ; [repeat (match goal with [X: _ \/ _ |- _] => destruct X end); contradiction|eassumption]);
107-
clear H; rename NH into H; unfold pclearbot_orR in H
108-
)]
109-
end
110-
end);
111-
revert H);
112-
intros; paco_revert_hyp _paco_mark.
87+
print (" | [H: context [bot"+str(i)+"] |- _] => destruct H as [H|H]; [|inversion H]")
88+
print (""" end.
11389
11490
(** ** [pdestruct H] and [pinversion H]
11591
*)

src/pacotac.v

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -69,48 +69,24 @@ Tactic Notation "pcofix" ident(CIH) := pcofix CIH with r.
6969
(** ** [pclearbot] simplifies all hypotheses of the form [upaco{n} gf bot{n}] to [paco{n} gf bot{n}].
7070
*)
7171

72-
Definition pclearbot_orL (P Q: Prop) := P.
73-
Definition pclearbot_orR (P Q: Prop) := Q.
74-
7572
Ltac pclearbot :=
76-
generalize _paco_mark_cons;
77-
repeat(
78-
let H := match goal with
79-
| [H: context [bot0] |- _] => H
80-
| [H: context [bot1] |- _] => H
81-
| [H: context [bot2] |- _] => H
82-
| [H: context [bot3] |- _] => H
83-
| [H: context [bot4] |- _] => H
84-
| [H: context [bot5] |- _] => H
85-
| [H: context [bot6] |- _] => H
86-
| [H: context [bot7] |- _] => H
87-
| [H: context [bot8] |- _] => H
88-
| [H: context [bot9] |- _] => H
89-
| [H: context [bot10] |- _] => H
90-
| [H: context [bot11] |- _] => H
91-
| [H: context [bot12] |- _] => H
92-
| [H: context [bot13] |- _] => H
93-
| [H: context [bot14] |- _] => H
94-
end in
95-
let NH := fresh H in
96-
revert_until H;
97-
repeat (
98-
repeat red in H;
99-
match goal with [Hcrr: context f [or] |- _] =>
100-
match Hcrr with H =>
101-
first[(
102-
let P := context f [pclearbot_orL] in
103-
assert (NH: P) by (repeat intro; edestruct H ; [eassumption|repeat (match goal with [X: _ \/ _ |- _] => destruct X end); contradiction]);
104-
clear H; rename NH into H; unfold pclearbot_orL in H
105-
) | (
106-
let P := context f [pclearbot_orR] in
107-
assert (NH: P) by (repeat intro; edestruct H ; [repeat (match goal with [X: _ \/ _ |- _] => destruct X end); contradiction|eassumption]);
108-
clear H; rename NH into H; unfold pclearbot_orR in H
109-
)]
110-
end
111-
end);
112-
revert H);
113-
intros; paco_revert_hyp _paco_mark.
73+
repeat match goal with
74+
| [H: context [bot0] |- _] => destruct H as [H|H]; [|inversion H]
75+
| [H: context [bot1] |- _] => destruct H as [H|H]; [|inversion H]
76+
| [H: context [bot2] |- _] => destruct H as [H|H]; [|inversion H]
77+
| [H: context [bot3] |- _] => destruct H as [H|H]; [|inversion H]
78+
| [H: context [bot4] |- _] => destruct H as [H|H]; [|inversion H]
79+
| [H: context [bot5] |- _] => destruct H as [H|H]; [|inversion H]
80+
| [H: context [bot6] |- _] => destruct H as [H|H]; [|inversion H]
81+
| [H: context [bot7] |- _] => destruct H as [H|H]; [|inversion H]
82+
| [H: context [bot8] |- _] => destruct H as [H|H]; [|inversion H]
83+
| [H: context [bot9] |- _] => destruct H as [H|H]; [|inversion H]
84+
| [H: context [bot10] |- _] => destruct H as [H|H]; [|inversion H]
85+
| [H: context [bot11] |- _] => destruct H as [H|H]; [|inversion H]
86+
| [H: context [bot12] |- _] => destruct H as [H|H]; [|inversion H]
87+
| [H: context [bot13] |- _] => destruct H as [H|H]; [|inversion H]
88+
| [H: context [bot14] |- _] => destruct H as [H|H]; [|inversion H]
89+
end.
11490

11591
(** ** [pdestruct H] and [pinversion H]
11692
*)

0 commit comments

Comments
 (0)