| 1 |
; $Id: defsNT.scm 2156 2008-01-25 13:25:12Z schimans $ |
| 2 |
; *********************************************************** |
| 3 |
; ; Adapt path if necessary: |
| 4 |
; (define path "~/minlog/examples/tait/diplomarbeit_schlenker/") |
| 5 |
|
| 6 |
; ; Defines the function "pload" to load files |
| 7 |
; ; from the path defined above |
| 8 |
; (define pload (lambda (x) (load (string-append path x)))) |
| 9 |
|
| 10 |
; ; Used Modules: |
| 11 |
; (pload "./initiate.scm") |
| 12 |
; (pload "./defsLamCalc.scm") |
| 13 |
; (pload "./defsSubst.scm") |
| 14 |
; (pload "./omega.scm") |
| 15 |
; |
| 16 |
; NOTICE: Uncomment modules only when file is run on its own |
| 17 |
; *********************************************************** |
| 18 |
|
| 19 |
|
| 20 |
; ======================================== |
| 21 |
; Section: The Definitions for the Proof |
| 22 |
; ======================================== |
| 23 |
; contains the specific definitions for the proof |
| 24 |
|
| 25 |
; Subsection: Miscellaneous |
| 26 |
; ========================= |
| 27 |
|
| 28 |
; Definition: "ABS" |
| 29 |
; ----------------- |
| 30 |
; binds the k-th free variable with given type rho |
| 31 |
; used as an abbreviation particularly for Ax1 and |
| 32 |
; the definition of "Eta" |
| 33 |
|
| 34 |
(add-program-constant "ABS" |
| 35 |
(py "nat => type => term => term") 1) |
| 36 |
|
| 37 |
(add-computation-rule (pt "ABS k rho s") |
| 38 |
(pt "Abs rho(Sub s (Wrap (Succ (Succ k)) |
| 39 |
((Var map(Seq 1 k)):+:(Var 0):)))")) |
| 40 |
|
| 41 |
; Definition: "ExtCtx" |
| 42 |
; -------------------- |
| 43 |
; "ExtCtx" stands for "Extend Context". |
| 44 |
; For a context "rhos" it produces as many "rho" as needed |
| 45 |
; for "k" to be in the context "rhos:+:(ExtCtx rhos k rho)" |
| 46 |
|
| 47 |
(add-program-constant "ExtCtx" |
| 48 |
(py "list type=>nat=>type=>list type") 1) |
| 49 |
|
| 50 |
(add-computation-rule (pt "ExtCtx (Nil type) 0 rho") |
| 51 |
(pt "rho:")) |
| 52 |
(add-computation-rule (pt "ExtCtx (sig::rhos) 0 rho") |
| 53 |
(pt "(Nil type)")) |
| 54 |
(add-computation-rule (pt "ExtCtx (Nil type) (Succ n) rho") |
| 55 |
(pt "rho::(ExtCtx (Nil type) n rho)")) |
| 56 |
(add-computation-rule (pt "ExtCtx (sig::rhos) (Succ n) rho") |
| 57 |
(pt "(ExtCtx rhos n rho)")) |
| 58 |
|
| 59 |
(pp (nt (pt "ExtCtx (sig::sig::sig:) 4 rho"))) |
| 60 |
; rho::rho: |
| 61 |
|
| 62 |
|
| 63 |
; Subsection: Predicates |
| 64 |
; ====================== |
| 65 |
|
| 66 |
; Subsubsection: Declaration of the Predicates |
| 67 |
; :::::::::::::::::::::::::::::::::::::::::::: |
| 68 |
|
| 69 |
; Definition: "N", "A", "Head", "Fr" |
| 70 |
; ---------------------------------- |
| 71 |
|
| 72 |
(add-predconst-name |
| 73 |
"N" (make-arity (py "list type") (py "type") |
| 74 |
(py "term") (py "term"))) |
| 75 |
|
| 76 |
(add-predconst-name |
| 77 |
"A" (make-arity (py "list type") (py "type") |
| 78 |
(py "term") (py "term"))) |
| 79 |
|
| 80 |
(add-predconst-name |
| 81 |
"Head" (make-arity (py "term") (py "term"))) |
| 82 |
|
| 83 |
(add-predconst-name |
| 84 |
"Fr" (make-arity (py "list type") (py "type") |
| 85 |
(py "term") (py "nat"))) |
| 86 |
|
| 87 |
; Definition: "SCr" |
| 88 |
; ----------------- |
| 89 |
(add-predconst-name |
| 90 |
"SCr" (make-arity (py "list type") (py "type") |
| 91 |
(py "omega") (py "term"))) |
| 92 |
|
| 93 |
; Definition: "SC" |
| 94 |
; ---------------- |
| 95 |
(add-predconst-name |
| 96 |
"SC" (make-arity (py "list type") (py "type") (py "term"))) |
| 97 |
|
| 98 |
|
| 99 |
; Subsubsection: Definition of the Predicates |
| 100 |
; ::::::::::::::::::::::::::::::::::::::::::: |
| 101 |
|
| 102 |
; Definition: "FrDef", "FrDefRev" |
| 103 |
; ------------------------------- |
| 104 |
(add-global-assumption "FrDef" |
| 105 |
(pf "all rhos,rho,r,k.Fr rhos rho r k -> |
| 106 |
(TypJ rhos r rho & ((k < Lh rhos) -> F))")) |
| 107 |
|
| 108 |
(add-global-assumption "FrDefRev" |
| 109 |
(pf "all rhos,rho,r,k.TypJ rhos r rho -> |
| 110 |
((k < Lh rhos) -> F) -> Fr rhos rho r k ")) |
| 111 |
|
| 112 |
|
| 113 |
; Definition: "SCrIotaUnfold", "SCrIotaFold", "SCrUnfold", "SCrFold" |
| 114 |
; ------------------------------------------------------------------ |
| 115 |
; represents the Definition of SCr |
| 116 |
|
| 117 |
(add-global-assumption |
| 118 |
"SCrIotaUnfold" |
| 119 |
(pf "all rhos,a^,r.SCr rhos Iota a^ r -> |
| 120 |
all k.Fr rhos Iota r k -> N rhos Iota r(ModIota a^k)")) |
| 121 |
|
| 122 |
(add-global-assumption |
| 123 |
"SCrIotaFold" |
| 124 |
(pf "all rhos,a^,r. |
| 125 |
TypJ rhos r Iota -> OmegaPart a^ =Iota -> |
| 126 |
(all k.Fr rhos Iota r k -> N rhos Iota r(ModIota a^k)) -> |
| 127 |
SCr rhos Iota a^r")) |
| 128 |
|
| 129 |
(add-global-assumption |
| 130 |
"SCrUnfold" |
| 131 |
(pf "all rhos,rho,sig,a^,r. |
| 132 |
SCr rhos(rho to sig)a^r -> |
| 133 |
all sigs,b^,s.SCr(rhos:+:sigs)rho b^s -> |
| 134 |
SCr(rhos:+:sigs)sig(Mod a^b^)(r s)")) |
| 135 |
; additionally: |
| 136 |
(add-global-assumption |
| 137 |
"SCrUnfoldTwo" |
| 138 |
(pf "all rhos,rho,a^,r.SCr rhos rho a^r -> |
| 139 |
(TypJ rhos r rho) & (OmegaPart a^ =rho)")) |
| 140 |
|
| 141 |
(add-global-assumption |
| 142 |
"SCrFold" |
| 143 |
(pf "all rhos,rho,sig,a^,r. |
| 144 |
TypJ rhos r(rho to sig) -> OmegaPart a^ =(rho to sig) -> |
| 145 |
(all sigs,b^,s.SCr(rhos:+:sigs)rho b^s -> |
| 146 |
SCr(rhos:+:sigs)sig(Mod a^b^)(r s)) -> |
| 147 |
SCr rhos(rho to sig)a^r")) |
| 148 |
|
| 149 |
; Definition: "SCrs" |
| 150 |
; ------------------ |
| 151 |
(add-ids (list (list |
| 152 |
"SCrs" (make-arity (py "list type")(py "list type") |
| 153 |
(py "list omega") (py "list term")))) |
| 154 |
'("all sigs SCrs sigs(Nil type)(Nil omega)(Nil term)" "SCrsDefNil") |
| 155 |
'("all sigs,rho,rhos,a^,as^,s,ss. |
| 156 |
STotal as^ -> |
| 157 |
SCr sigs rho a^s -> SCrs sigs rhos as^ss -> |
| 158 |
SCrs sigs(rho::rhos)(a^ ::as^)(s::ss)" "SCrsDef")) |