|
1 theory LetRec2 |
|
2 imports "../NewParser" |
|
3 begin |
|
4 |
|
5 atom_decl name |
|
6 |
|
7 nominal_datatype trm = |
|
8 Vr "name" |
|
9 | Ap "trm" "trm" |
|
10 | Lm x::"name" t::"trm" bind (set) x in t |
|
11 | Lt a::"lts" t::"trm" bind "bn a" in a t |
|
12 and lts = |
|
13 Lnil |
|
14 | Lcons "name" "trm" "lts" |
|
15 binder |
|
16 bn |
|
17 where |
|
18 "bn Lnil = []" |
|
19 | "bn (Lcons x t l) = (atom x) # (bn l)" |
|
20 |
|
21 |
|
22 thm trm_lts.fv |
|
23 thm trm_lts.eq_iff |
|
24 thm trm_lts.bn |
|
25 thm trm_lts.perm |
|
26 thm trm_lts.induct |
|
27 thm trm_lts.distinct |
|
28 thm trm_lts.supp |
|
29 thm trm_lts.fv[simplified trm_lts.supp] |
|
30 |
|
31 |
|
32 (* why is this not in HOL simpset? *) |
|
33 (* |
|
34 lemma set_sub: "{a, b} - {b} = {a} - {b}" |
|
35 by auto |
|
36 |
|
37 lemma lets_bla: |
|
38 "x \<noteq> z \<Longrightarrow> y \<noteq> z \<Longrightarrow> x \<noteq> y \<Longrightarrow>(Lt (Lcons x (Vr y) Lnil) (Vr x)) \<noteq> (Lt (Lcons x (Vr z) Lnil) (Vr x))" |
|
39 apply (auto simp add: trm_lts.eq_iff alphas set_sub supp_at_base) |
|
40 done |
|
41 |
|
42 lemma lets_ok: |
|
43 "(Lt (Lcons x (Vr x) Lnil) (Vr x)) = (Lt (Lcons y (Vr y) Lnil) (Vr y))" |
|
44 apply (simp add: trm_lts.eq_iff) |
|
45 apply (rule_tac x="(x \<leftrightarrow> y)" in exI) |
|
46 apply (simp_all add: alphas fresh_star_def eqvts supp_at_base) |
|
47 done |
|
48 |
|
49 lemma lets_ok3: |
|
50 "x \<noteq> y \<Longrightarrow> |
|
51 (Lt (Lcons x (Ap (Vr y) (Vr x)) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
|
52 (Lt (Lcons y (Ap (Vr x) (Vr y)) (Lcons x (Vr x) Lnil)) (Ap (Vr x) (Vr y)))" |
|
53 apply (simp add: alphas trm_lts.eq_iff) |
|
54 done |
|
55 |
|
56 |
|
57 lemma lets_not_ok1: |
|
58 "x \<noteq> y \<Longrightarrow> |
|
59 (Lt (Lcons x (Vr x) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
|
60 (Lt (Lcons y (Vr x) (Lcons x (Vr y) Lnil)) (Ap (Vr x) (Vr y)))" |
|
61 apply (simp add: alphas trm_lts.eq_iff) |
|
62 done |
|
63 |
|
64 lemma lets_nok: |
|
65 "x \<noteq> y \<Longrightarrow> x \<noteq> z \<Longrightarrow> z \<noteq> y \<Longrightarrow> |
|
66 (Lt (Lcons x (Ap (Vr z) (Vr z)) (Lcons y (Vr z) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
|
67 (Lt (Lcons y (Vr z) (Lcons x (Ap (Vr z) (Vr z)) Lnil)) (Ap (Vr x) (Vr y)))" |
|
68 apply (simp add: alphas trm_lts.eq_iff fresh_star_def) |
|
69 done |
|
70 |
|
71 lemma lets_ok4: |
|
72 "(Lt (Lcons x (Ap (Vr y) (Vr x)) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) = |
|
73 (Lt (Lcons y (Ap (Vr x) (Vr y)) (Lcons x (Vr x) Lnil)) (Ap (Vr y) (Vr x)))" |
|
74 apply (simp add: alphas trm_lts.eq_iff supp_at_base) |
|
75 apply (rule_tac x="(x \<leftrightarrow> y)" in exI) |
|
76 apply (simp add: atom_eqvt fresh_star_def) |
|
77 done |
|
78 |
|
79 end |
|
80 |
|
81 |
|
82 |