]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta.etc
milestone in basic_2, λδ-2A reconstructed
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc_2A1 / nta / nta.etc
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 "basic_2/static/sh.ma".
16 include "basic_2/equivalence/cpcs.ma".
17
18 (* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************)
19
20 inductive nta (h:sh): lenv → relation term ≝
21 | nta_sort: ∀L,k. nta h L (⋆k) (⋆(next h k))
22 | nta_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → nta h K V W →
23             ⇧[0, i + 1] W ≡ U → nta h L (#i) U
24 | nta_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → nta h K W V →
25             ⇧[0, i + 1] W ≡ U → nta h L (#i) U
26 | nta_bind: ∀I,L,V,W,T,U. nta h L V W → nta h (L. ⓑ{I} V) T U →
27             nta h L (ⓑ{I}V.T) (ⓑ{I}V.U)
28 | nta_appl: ∀L,V,W,T,U. nta h L V W → nta h L (ⓛW.T) (ⓛW.U) →
29             nta h L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U)
30 | nta_pure: ∀L,V,W,T,U. nta h L T U → nta h L (ⓐV.U) W →
31             nta h L (ⓐV.T) (ⓐV.U)
32 | nta_cast: ∀L,T,U. nta h L T U → nta h L (ⓝU. T) U
33 | nta_conv: ∀L,T,U1,U2,V2. nta h L T U1 → L ⊢ U1 ⬌* U2 → nta h L U2 V2 →
34             nta h L T U2
35 .
36
37 interpretation "native type assignment (term)"
38    'NativeType h L T U = (nta h L T U).
39
40 (* Basic properties *********************************************************)
41
42 (* Basic_1: was: ty3_cast *)
43 lemma nta_cast_old: ∀h,L,W,T,U.
44                     ⦃h, L⦄ ⊢ T : U → ⦃h, L⦄ ⊢ U : W → ⦃h, L⦄ ⊢ ⓝU.T : ⓝW.U.
45 /4 width=3/ qed.
46
47 (* Basic_1: was: ty3_typecheck *)
48 lemma nta_typecheck: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∃T0. ⦃h, L⦄ ⊢ ⓝU.T : T0.
49 /3 width=2/ qed.
50
51 (* Basic_1: removed theorems 4:
52             ty3_getl_subst0 ty3_fsubst0 ty3_csubst0 ty3_subst0
53 *)