Debian Codegraph @

examples/tait/diplomarbeit_schlenker/auxGlobal_SHORT.scm

raw
1 ; ***********************************************************
2 ; ; Adapt path if necessary:
3 ; (define path "~/minlog/examples/tait/diplomarbeit_schlenker/")
4
5 ; ; Defines the function "pload" to load files
6 ; ; from the path defined above
7 ; (define pload (lambda (x) (load (string-append path x))))
8
9 ; ; Used Modules:
10 ; (pload "./initiate.scm")
11 ; (pload "./defsLamCalc.scm")
12 ; (pload "./defsSubst.scm")
13 ; (pload "./omega.scm")
14 ; (pload "./defsNT.scm")
15 ; (pload "./defsAxiomsSpecial.scm")
16 ; (pload "./defsAxioms.scm")
17 ; (pload "./trivial.scm")
18 ; (pload "./auxSC.scm")
19
20 ; NOTICE: Uncomment modules only when file is run on its own
21 ; ***********************************************************
22
23
24 ; =============================
25 ; Section: Global Auxiliaries
26 ; =============================
27 ; contains global auxiliaries used in more than one module.
28
29 ; Subsection: Miscellaneous
30 ; =========================
31
32 ; Lemma: "SubVar"
33 ; ---------------
34 (add-global-assumption "SubVar"
35 (pf "all k,ss,m.
36 k<Lh ss -> Sub(Var k) (Wrap m ss) =
37 (k thof ss)"))
38
39 ; Lemma: "TypJArrow"
40 ; ------------------
41 (add-global-assumption "TypJArrow"
42 (pf "all rhos,rho,sig,r,s.
43 TypJ rhos r (rho to sig) -> TypJ rhos s rho ->
44 TypJ rhos (r s) sig"))
45
46 ; Lemma: "TypJTyp"
47 ; ----------------
48 (add-global-assumption "TypJTyp"
49 (pf "all rhos,rho,r.
50 TypJ rhos r rho -> rho = Typ rhos r"))
51
52
53 ; Subsection: SCrs
54 ; ================
55
56 ; Lemma: "SCrsSTotal"
57 ; -------------------
58 (add-global-assumption "SCrsSTotal"
59 (pf "all sigs,rhos,as^,ss.
60 SCrs sigs rhos as^ ss -> STotal as^"))
61
62 ; Lemma: "SCrsLh"
63 ; ---------------
64 (add-global-assumption "SCrsLh"
65 (pf "all sigs,rhos,as^,ss.SCrs sigs rhos as^ ss ->
66 (Lh as^ =Lh rhos & Lh rhos=Lh ss)"))
67
68 ; Lemma: "SCrsDefRev"
69 ; -------------------
70 (add-global-assumption
71 "SCrsDefRev"
72 (pf "all sigs,rho,rhos,a^,as^,s,ss.
73 SCrs sigs(rho::rhos)(a^ ::as^)(s::ss) ->
74 (SCr sigs rho a^s & SCrs sigs rhos as^ss)"))
75 ; proof by inversion
76
77
78 ; Subsection TypJExtCtx
79 ; =====================
80
81 ; Lemma: "TypJExtCtx"
82 ; -------------------
83 ; auxiliary for "TypJAppIntro"
84
85 (add-global-assumption "TypJExtCtx"
86 (pf "all r,rhos,rho,sigs.
87 TypJ rhos r rho -> TypJ (rhos :+: sigs) r rho"))
88
89
90 ; Subsection: "TypJAppIntro"
91 ; ==========================
92
93 ; Lemma: "TypJAppIntro"
94 ; ---------------------
95 (add-global-assumption "TypJAppIntro"
96 (pf "all rhos,sigs,rho,sig,r,s.
97 TypJ rhos r(rho to sig) -> TypJ(rhos:+:sigs)s rho ->
98 TypJ(rhos:+:sigs)(r s)sig"))
99
100
101 ; Subsection: "TypJSub"
102 ; =====================
103 ; used for "Subject Reduction" and
104 ; for an auxiliary for Lemma 3
105
106 ; Definition: "TypJsSublist"
107 ; --------------------------
108 ; TypJ for a Sublist
109 ; (easier proofs than with list of terms)
110
111 (add-program-constant "TypJsSublist"
112 (py "list type=> Sublist => list type=> boole") 1)
113
114 (add-computation-rule (pt "TypJsSublist sigs (Up n) (Nil type)")
115 (pt "T"))
116 (add-computation-rule (pt "TypJsSublist sigs (Up n) (rho::rhos)")
117 (pt "F"))
118 (add-computation-rule (pt "TypJsSublist sigs (Dot r theta) (Nil type)")
119 (pt "F"))
120
121 (add-computation-rule (pt "TypJsSublist sigs (Dot r theta) (rho::rhos)")
122 (pt "(TypJ sigs r rho) and (TypJsSublist sigs theta rhos)"))
123
124 ; Definition: "TypJs"
125 ; -------------------
126 ; TypJ for a list of terms
127
128 (add-program-constant "TypJs"
129 (py "list type=> list term => list type=> boole") 1)
130
131 (add-computation-rule (pt "TypJs sigs ss rhos")
132 (pt "TypJsSublist sigs (Wrap 0 ss) rhos"))
133
134 ; Lemma: "TypJSub"
135 ; ----------------
136 (add-global-assumption "TypJSub"
137 (pf "all r,rhos, theta, sigs,rho.TypJ rhos r rho ->
138 TypJsSublist sigs theta rhos ->
139 TypJ sigs (Sub r theta) rho"))