3 Require Export pr2_defs.
4 Require Export pr3_defs.
5 Require Export pc1_defs.
7 Inductive pc2 [c:C; t1,t2:T] : Prop :=
8 | pc2_r : (pr2 c t1 t2) -> (pc2 c t1 t2)
9 | pc2_x : (pr2 c t2 t1) -> (pc2 c t1 t2).
11 Hint pc2 : ltlc := Constructors pc2.
13 Inductive pc3 [c:C] : T -> T -> Prop :=
14 | pc3_r : (t:?) (pc3 c t t)
15 | pc3_u : (t2,t1:?) (pc2 c t1 t2) ->
16 (t3:?) (pc3 c t2 t3) -> (pc3 c t1 t3).
18 Hint pc3 : ltlc := Constructors pc3.
20 Section pc2_props. (******************************************************)
22 Theorem pc2_s : (c,t2,t1:?) (pc2 c t1 t2) -> (pc2 c t2 t1).
27 Theorem pc2_shift : (h:?; c,e:?) (drop h (0) c e) ->
28 (t1,t2:?) (pc2 c t1 t2) ->
29 (pc2 e (app c h t1) (app c h t2)).
30 Intros until 2; XElim H0; Intros.
39 Hints Resolve pc2_s pc2_shift : ltlc.
41 Section pc3_props. (******************************************************)
43 Theorem pc3_pr2_r : (c,t1,t2:?) (pr2 c t1 t2) -> (pc3 c t1 t2).
47 Theorem pc3_pr2_x : (c,t1,t2:?) (pr2 c t2 t1) -> (pc3 c t1 t2).
51 Theorem pc3_pc2 : (c,t1,t2:?) (pc2 c t1 t2) -> (pc3 c t1 t2).
55 Theorem pc3_t : (t2,c,t1:?) (pc3 c t1 t2) ->
56 (t3:?) (pc3 c t2 t3) -> (pc3 c t1 t3).
57 Intros t2 c t1 H; XElim H; XEAuto.
60 Hints Resolve pc3_t : ltlc.
62 Theorem pc3_s : (c,t2,t1:?) (pc3 c t1 t2) -> (pc3 c t2 t1).
63 Intros; XElim H; [ XAuto | XEAuto ].
66 Hints Resolve pc3_s : ltlc.
68 Theorem pc3_pr3_r : (c:?; t1,t2) (pr3 c t1 t2) -> (pc3 c t1 t2).
69 Intros; XElim H; XEAuto.
72 Theorem pc3_pr3_x : (c:?; t1,t2) (pr3 c t2 t1) -> (pc3 c t1 t2).
73 Intros; XElim H; XEAuto.
76 Hints Resolve pc3_pr3_r pc3_pr3_x : ltlc.
78 Theorem pc3_pr3_t : (c:?; t1,t0:?) (pr3 c t1 t0) ->
79 (t2:?) (pr3 c t2 t0) -> (pc3 c t1 t2).
80 Intros; Apply (pc3_t t0); XAuto.
83 Theorem pc3_thin_dx : (c:? ;t1,t2:?) (pc3 c t1 t2) ->
84 (u:?; f:?) (pc3 c (TTail (Flat f) u t1)
85 (TTail (Flat f) u t2)).
86 Intros; XElim H; [XAuto | Intros ].
87 EApply pc3_u; [ Inversion H | Apply H1 ]; XAuto.
90 Theorem pc3_tail_1 : (c:?; u1,u2:?) (pc3 c u1 u2) ->
91 (k:?; t:?) (pc3 c (TTail k u1 t) (TTail k u2 t)).
92 Intros until 1; XElim H; Intros.
96 EApply pc3_u; [ Inversion H | Apply H1 ]; XAuto.
99 Theorem pc3_tail_2 : (c:?; u,t1,t2:?; k:?) (pc3 (CTail c k u) t1 t2) ->
100 (pc3 c (TTail k u t1) (TTail k u t2)).
102 XElim H; [ Idtac | Intros; Inversion H ]; XEAuto.
105 Theorem pc3_tail_12 : (c:?; u1,u2:?) (pc3 c u1 u2) ->
106 (k:?; t1,t2:?) (pc3 (CTail c k u2) t1 t2) ->
107 (pc3 c (TTail k u1 t1) (TTail k u2 t2)).
109 EApply pc3_t; [ Apply pc3_tail_1 | Apply pc3_tail_2 ]; XAuto.
112 Theorem pc3_tail_21 : (c:?; u1,u2:?) (pc3 c u1 u2) ->
113 (k:?; t1,t2:?) (pc3 (CTail c k u1) t1 t2) ->
114 (pc3 c (TTail k u1 t1) (TTail k u2 t2)).
116 EApply pc3_t; [ Apply pc3_tail_2 | Apply pc3_tail_1 ]; XAuto.
119 Theorem pc3_pr3_u : (c:?; t2,t1:?) (pr2 c t1 t2) ->
120 (t3:?) (pc3 c t2 t3) -> (pc3 c t1 t3).
124 Theorem pc3_pr3_u2 : (c:?; t0,t1:?) (pr2 c t0 t1) ->
125 (t2:?) (pc3 c t0 t2) -> (pc3 c t1 t2).
126 Intros; Apply (pc3_t t0); XAuto.
129 Theorem pc3_shift : (h:?; c,e:?) (drop h (0) c e) ->
130 (t1,t2:?) (pc3 c t1 t2) ->
131 (pc3 e (app c h t1) (app c h t2)).
132 Intros until 2; XElim H0; Clear t1 t2; Intros.
139 Theorem pc3_pc1: (t1,t2:?) (pc1 t1 t2) -> (c:?) (pc3 c t1 t2).
140 Intros; XElim H; Intros.
149 Hints Resolve pc3_pr2_r pc3_pr2_x pc3_pc2 pc3_pr3_r pc3_pr3_x
150 pc3_t pc3_s pc3_pr3_t pc3_thin_dx pc3_tail_1 pc3_tail_2
151 pc3_tail_12 pc3_tail_21 pc3_pr3_u pc3_shift pc3_pc1 : ltlc.
153 Tactic Definition Pc3T :=
155 | [ _: (pr3 ?1 ?2 (TTail ?3 ?4 ?5)); _: (pc3 ?1 ?6 ?4) |- ? ] ->
156 LApply (pc3_t (TTail ?3 ?4 ?5) ?1 ?2); [ Intros H_x | XAuto ];
157 LApply (H_x (TTail ?3 ?6 ?5)); [ Clear H_x; Intros | Apply pc3_s; XAuto ]
158 | [ _: (pc3 ?1 ?2 ?3); _: (pr3 ?1 ?3 ?4) |- ? ] ->
159 LApply (pc3_t ?3 ?1 ?2); [ Intros H_x | XAuto ];
160 LApply (H_x ?4); [ Clear H_x; Intros | XAuto ].