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 "basic_2/static/sh.ma".
16 include "basic_2/equivalence/cpcs.ma".
18 (* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************)
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 →
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 →
37 interpretation "native type assignment (term)"
38 'NativeType h L T U = (nta h L T U).
40 (* Basic properties *********************************************************)
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.
47 (* Basic_1: was: ty3_typecheck *)
48 lemma nta_typecheck: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∃T0. ⦃h, L⦄ ⊢ ⓣU.T : T0.
51 (* Basic_1: removed theorems 4:
52 ty3_getl_subst0 ty3_fsubst0 ty3_csubst0 ty3_subst0