]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/syntax/item.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / syntax / item.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_2/lib/bool.ma".
16 include "ground_2/lib/arith.ma".
17
18 (* ITEMS ********************************************************************)
19
20 (* atomic items *)
21 inductive item0: Type[0] ≝
22    | Sort: nat → item0 (* sort: starting at 0 *)
23    | LRef: nat → item0 (* reference by index: starting at 0 *)
24    | GRef: nat → item0 (* reference by position: starting at 0 *)
25 .
26
27 (* unary binding items *)
28 inductive bind1: Type[0] ≝
29   | Void: bind1 (* exclusion *)
30 .
31
32 (* binary binding items *)
33 inductive bind2: Type[0] ≝
34   | Abbr: bind2 (* abbreviation *)
35   | Abst: bind2 (* abstraction *)
36 .
37
38 (* binary non-binding items *)
39 inductive flat2: Type[0] ≝
40   | Appl: flat2 (* application *)
41   | Cast: flat2 (* explicit type annotation *)
42 .
43
44 (* binary items *)
45 inductive item2: Type[0] ≝
46   | Bind2: bool → bind2 → item2 (* polarized binding item *)
47   | Flat2: flat2 → item2        (* non-binding item *)
48 .
49
50 (* Basic inversion lemmas ***************************************************)
51
52 fact destruct_sort_sort_aux: ∀s1,s2. Sort s1 = Sort s2 → s1 = s2.
53 #s1 #s2 #H destruct //
54 qed-.
55
56 (* Basic properties *********************************************************)
57
58 lemma eq_item0_dec: ∀I1,I2:item0. Decidable (I1 = I2).
59 * #i1 * #i2 [2,3,4,6,7,8: @or_intror #H destruct ]
60 [2: elim (eq_nat_dec i1 i2) |1,3: elim (eq_nat_dec i1 i2) ] /2 width=1 by or_introl/
61 #Hni12 @or_intror #H destruct /2 width=1 by/
62 qed-.
63
64 lemma eq_bind1_dec: ∀I1,I2:bind1. Decidable (I1 = I2).
65 * * /2 width=1 by or_introl/
66 qed-.
67
68 (* Basic_1: was: bind_dec *)
69 lemma eq_bind2_dec: ∀I1,I2:bind2. Decidable (I1 = I2).
70 * * /2 width=1 by or_introl/
71 @or_intror #H destruct
72 qed-.
73
74 (* Basic_1: was: flat_dec *)
75 lemma eq_flat2_dec: ∀I1,I2:flat2. Decidable (I1 = I2).
76 * * /2 width=1 by or_introl/
77 @or_intror #H destruct
78 qed-.
79
80 (* Basic_1: was: kind_dec *)
81 lemma eq_item2_dec: ∀I1,I2:item2. Decidable (I1 = I2).
82 * [ #p1 ] #I1 * [1,3: #p2 ] #I2
83 [2,3: @or_intror #H destruct
84 | elim (eq_bool_dec p1 p2) #Hp
85   [ elim (eq_bind2_dec I1 I2) /2 width=1 by or_introl/ #HI ]
86   @or_intror #H destruct /2 width=1 by/
87 | elim (eq_flat2_dec I1 I2) /2 width=1 by or_introl/ #HI
88   @or_intror #H destruct /2 width=1 by/
89 ]
90 qed-.
91
92 (* Basic_1: removed theorems 21:
93             s_S s_plus s_plus_sym s_minus minus_s_s s_le s_lt s_inj s_inc
94             s_arith0 s_arith1
95             r_S r_plus r_plus_sym r_minus r_dis s_r r_arith0 r_arith1
96             not_abbr_abst bind_dec_not
97 *)