1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground_2/steps/rtc_shift.ma".
17 (* RT-TRANSITION COUNTER ****************************************************)
19 definition max (c1:rtc) (c2:rtc): rtc ≝ match c1 with [
20 mk_rtc ri1 rs1 ti1 ts1 ⇒ match c2 with [
21 mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1∨ri2, rs1∨rs2, ti1∨ti2, ts1∨ts2〉
25 interpretation "maximum (rtc)"
26 'or c1 c2 = (max c1 c2).
28 (* Basic properties *********************************************************)
30 lemma max_rew: ∀ri1,ri2,rs1,rs2,ti1,ti2,ts1,ts2.
31 〈ri1∨ri2, rs1∨rs2, ti1∨ti2, ts1∨ts2〉 =
32 (〈ri1,rs1,ti1,ts1〉 ∨ 〈ri2,rs2,ti2,ts2〉).
35 lemma max_O_dx: ∀c. c = (c ∨ 𝟘𝟘).
36 * #ri #rs #ti #ts <max_rew //
39 (* Basic inversion properties ***********************************************)
41 lemma max_inv_dx: ∀ri,rs,ti,ts,c1,c2. 〈ri,rs,ti,ts〉 = (c1 ∨ c2) →
42 ∃∃ri1,rs1,ti1,ts1,ri2,rs2,ti2,ts2.
43 (ri1∨ri2) = ri & (rs1∨rs2) = rs & (ti1∨ti2) = ti & (ts1∨ts2) = ts &
44 〈ri1,rs1,ti1,ts1〉 = c1 & 〈ri2,rs2,ti2,ts2〉 = c2.
45 #ri #rs #ti #ts * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
46 <max_rew #H destruct /2 width=14 by ex6_8_intro/
49 (* Properties with test for constrained rt-transition counter ***************)
51 lemma isrt_max: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1, c1⦄ → 𝐑𝐓⦃n2, c2⦄ → 𝐑𝐓⦃n1∨n2, c1∨c2⦄.
52 #n1 #n2 #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct
53 /2 width=3 by ex1_2_intro/
56 lemma isrt_max_O1: ∀n,c1,c2. 𝐑𝐓⦃0, c1⦄ → 𝐑𝐓⦃n, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄.
57 /2 width=1 by isrt_max/ qed.
59 lemma isrt_max_O2: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄.
60 #n #c1 #c2 #H1 #H2 >(max_O2 n) /2 width=1 by isrt_max/
63 (* Inversion properties with test for constrained rt-transition counter *****)
65 lemma isrt_inv_max: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ →
66 ∃∃n1,n2. 𝐑𝐓⦃n1, c1⦄ & 𝐑𝐓⦃n2, c2⦄ & (n1 ∨ n2) = n.
67 #n #c1 #c2 * #ri #rs #H
68 elim (max_inv_dx … H) -H #ri1 #rs1 #ti1 #ts1 #ri2 #rs2 #ti2 #ts2 #_ #_ #H1 #H2 #H3 #H4
69 elim (max_inv_O3 … H1) -H1 /3 width=5 by ex3_2_intro, ex1_2_intro/
72 lemma isrt_inv_max_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1⦄.
74 elim (isrt_inv_max … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct
75 lapply (isrt_mono … Hn2 H2) -c2 #H destruct //
78 (* Properties with shift ****************************************************)
80 lemma max_shift: ∀c1,c2. (↓c1) ∨ (↓c2) = ↓(c1∨c2).
81 * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
82 <shift_rew <shift_rew <shift_rew <max_rew //