author | Christian Urban <urbanc@in.tum.de> |
Wed, 19 Jan 2011 19:06:52 +0100 | |
changeset 2684 | d72a7168f1cb |
child 2686 | 52e1e98edb34 |
permissions | -rw-r--r-- |
2684
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory Lambda |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
imports "../Nominal/Nominal2" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
5 |
section {* Definitions for Lambda Terms *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
6 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
7 |
text {* type of variables *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
8 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
atom_decl name |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
10 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
12 |
subsection {* Alpha-Equated Lambda Terms *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
nominal_datatype lam = |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
Var "name" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
16 |
| App "lam" "lam" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
17 |
| Lam x::"name" l::"lam" bind x in l ("Lam [_]. _" [100, 100] 100) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
18 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
19 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
20 |
text {* some automatically derived theorems *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
21 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
22 |
thm lam.distinct |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
23 |
thm lam.eq_iff |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
24 |
thm lam.fresh |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
25 |
thm lam.size |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
26 |
thm lam.exhaust |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
27 |
thm lam.strong_exhaust |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
28 |
thm lam.induct |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
29 |
thm lam.strong_induct |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
30 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
31 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
32 |
subsection {* Height Function *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
33 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
34 |
nominal_primrec |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
35 |
height :: "lam \<Rightarrow> int" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
36 |
where |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
37 |
"height (Var x) = 1" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
38 |
| "height (App t1 t2) = max (height t1) (height t2) + 1" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
39 |
| "height (Lam [x].t) = height t + 1" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
40 |
apply(rule_tac y="x" in lam.exhaust) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
41 |
apply(auto simp add: lam.distinct lam.eq_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
42 |
apply(simp add: Abs_eq_iff alphas) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
43 |
apply(clarify) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
44 |
apply(subst (4) supp_perm_eq[where p="p", symmetric]) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
45 |
apply(simp add: pure_supp fresh_star_def) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
46 |
apply(simp add: eqvt_at_def) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
47 |
done |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
48 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
49 |
termination |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
50 |
by (relation "measure size") (simp_all add: lam.size) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
51 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
52 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
53 |
subsection {* Capture-avoiding Substitution *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
54 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
55 |
nominal_primrec |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
56 |
subst :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam" ("_ [_ ::= _]" [90,90,90] 90) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
57 |
where |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
58 |
"(Var x)[y ::= s] = (if x = y then s else (Var x))" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
59 |
| "(App t1 t2)[y ::= s] = App (t1[y ::= s]) (t2[y ::= s])" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
60 |
| "atom x \<sharp> (y, s) \<Longrightarrow> (Lam [x]. t)[y ::= s] = Lam [x].(t[y ::= s])" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
61 |
apply(auto simp add: lam.distinct lam.eq_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
62 |
apply(rule_tac y="a" and c="(aa, b)" in lam.strong_exhaust) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
63 |
apply(blast)+ |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
64 |
apply(simp add: fresh_star_def) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
65 |
apply(subgoal_tac "atom xa \<sharp> [[atom x]]lst. t \<and> atom x \<sharp> [[atom xa]]lst. ta") |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
66 |
apply(subst (asm) Abs_eq_iff2) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
67 |
apply(simp add: alphas atom_eqvt) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
68 |
apply(clarify) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
69 |
apply(rule trans) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
70 |
apply(rule_tac p="p" in supp_perm_eq[symmetric]) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
71 |
apply(rule fresh_star_supp_conv) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
72 |
apply(drule fresh_star_perm_set_conv) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
73 |
apply(simp add: finite_supp) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
74 |
apply(subgoal_tac "{atom (p \<bullet> x), atom x} \<sharp>* ([[atom x]]lst. subst_sumC (t, ya, sa))") |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
75 |
apply(auto simp add: fresh_star_def)[1] |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
76 |
apply(simp (no_asm) add: fresh_star_def) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
77 |
apply(rule conjI) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
78 |
apply(simp (no_asm) add: Abs_fresh_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
79 |
apply(clarify) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
80 |
apply(drule_tac a="atom (p \<bullet> x)" in fresh_eqvt_at) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
81 |
apply(simp add: finite_supp) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
82 |
apply(simp (no_asm_use) add: fresh_Pair) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
83 |
apply(simp add: Abs_fresh_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
84 |
apply(simp) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
85 |
apply(simp add: Abs_fresh_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
86 |
apply(subgoal_tac "p \<bullet> ya = ya") |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
87 |
apply(subgoal_tac "p \<bullet> sa = sa") |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
88 |
apply(simp add: atom_eqvt eqvt_at_def) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
89 |
apply(rule perm_supp_eq) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
90 |
apply(auto simp add: fresh_star_def fresh_Pair)[1] |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
91 |
apply(rule perm_supp_eq) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
92 |
apply(auto simp add: fresh_star_def fresh_Pair)[1] |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
93 |
apply(rule conjI) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
94 |
apply(simp add: Abs_fresh_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
95 |
apply(drule sym) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
96 |
apply(simp add: Abs_fresh_iff) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
97 |
done |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
98 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
99 |
termination |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
100 |
by (relation "measure (\<lambda>(t,_,_). size t)") |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
101 |
(simp_all add: lam.size) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
102 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
103 |
lemma subst_eqvt[eqvt]: |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
104 |
shows "(p \<bullet> t[x ::= s]) = (p \<bullet> t)[(p \<bullet> x) ::= (p \<bullet> s)]" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
105 |
by (induct t x s rule: subst.induct) (simp_all) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
106 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
107 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
108 |
subsection {* Single-Step Beta-Reduction *} |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
109 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
110 |
inductive |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
111 |
beta :: "lam \<Rightarrow> lam \<Rightarrow> bool" (" _ \<longrightarrow>b _" [80,80] 80) |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
112 |
where |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
113 |
b1[intro]: "t1 \<longrightarrow>b t2 \<Longrightarrow> App t1 s \<longrightarrow>b App t2 s" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
114 |
| b2[intro]: "s1 \<longrightarrow>b s2 \<Longrightarrow> App t s1 \<longrightarrow>b App t s2" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
115 |
| b3[intro]: "t1 \<longrightarrow>b t2 \<Longrightarrow> Lam [x]. t1 \<longrightarrow>b Lam [x]. t2" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
116 |
| b4[intro]: "App (Lam [x]. t) s \<longrightarrow>b t[x ::= s]" |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
117 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
118 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
119 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
120 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
121 |
end |
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
122 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
123 |
|
d72a7168f1cb
base file for the tutorial (contains definitions for heigt, subst and beta-reduction)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
124 |