]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/counters/rtc_max.ma
made executable again
[helm.git] / matita / matita / contribs / lambdadelta / ground / counters / rtc_max.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground/xoa/ex_6_8.ma".
16 include "ground/arith/nat_max.ma".
17 include "ground/counters/rtc.ma".
18
19 (* MAXIMUM FOR RT-TRANSITION COUNTERS ***************************************)
20
21 definition rtc_max (c1:rtc) (c2:rtc): rtc ≝
22 match c1 with
23 [ mk_rtc ri1 rs1 ti1 ts1 ⇒
24   match c2 with
25   [ mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1∨ri2,rs1∨rs2,ti1∨ti2,ts1∨ts2〉
26   ]
27 ].
28
29 interpretation
30   "maximum (rt-transition counters)"
31   'or c1 c2 = (rtc_max c1 c2).
32
33 (* Basic constructions ******************************************************)
34
35 (*** rtc_max_rew *)
36 lemma rtc_max_unfold (ri1) (ri2) (rs1) (rs2) (ti1) (ti2) (ts1) (ts2):
37       〈ri1∨ri2,rs1∨rs2,ti1∨ti2,ts1∨ts2〉 =
38       (〈ri1,rs1,ti1,ts1〉 ∨ 〈ri2,rs2,ti2,ts2〉).
39 // qed.
40
41 lemma rtc_max_zz_dx (c): c = (c ∨ 𝟘𝟘).
42 * #ri #rs #ti #ts <rtc_max_unfold //
43 qed.
44
45 lemma rtc_max_idem (c): c = (c ∨ c).
46 * #ri #rs #ti #ts <rtc_max_unfold //
47 qed.
48
49 (* Basic inversions *********************************************************)
50
51 lemma rtc_max_inv_dx (ri) (rs) (ti) (ts) (c1) (c2):
52       〈ri,rs,ti,ts〉 = (c1 ∨ c2) →
53       ∃∃ri1,rs1,ti1,ts1,ri2,rs2,ti2,ts2.
54       (ri1∨ri2) = ri & (rs1∨rs2) = rs & (ti1∨ti2) = ti & (ts1∨ts2) = ts &
55       〈ri1,rs1,ti1,ts1〉 = c1 & 〈ri2,rs2,ti2,ts2〉 = c2.
56 #ri #rs #ti #ts * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
57 <rtc_max_unfold #H destruct /2 width=14 by ex6_8_intro/
58 qed-.
59
60 (* Main constructions *******************************************************)
61
62 theorem rtc_max_assoc: associative … rtc_max.
63 * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2 * #ri3 #rs3 #ti3 #ts3
64 <rtc_max_unfold <rtc_max_unfold //
65 qed.