author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Mon, 19 May 2014 16:45:46 +0100 | |
changeset 3236 | e2da10806a34 |
parent 3065 | 51ef8a3cb6ef |
child 3208 | da575186d492 |
permissions | -rw-r--r-- |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
1 |
theory LetRec2 |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2438
diff
changeset
|
2 |
imports "../Nominal2" |
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
5 |
atom_decl name |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
7 |
nominal_datatype trm = |
3029 | 8 |
Var "name" |
9 |
| App "trm" "trm" |
|
10 |
| Lam x::"name" t::"trm" binds x in t |
|
11 |
| Let as::"assn" t::"trm" binds "bn as" in t |
|
12 |
| Let_rec as::"assn" t::"trm" binds "bn as" in as t |
|
13 |
and assn = |
|
14 |
ANil |
|
15 |
| ACons "name" "trm" "assn" |
|
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
16 |
binder |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
17 |
bn |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
18 |
where |
3029 | 19 |
"bn (ANil) = []" |
20 |
| "bn (ACons x t as) = (atom x) # (bn as)" |
|
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
21 |
|
3029 | 22 |
thm trm_assn.eq_iff |
23 |
thm trm_assn.supp |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
24 |
|
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3029
diff
changeset
|
25 |
ML {* |
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3029
diff
changeset
|
26 |
@{term Trueprop} ; |
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3029
diff
changeset
|
27 |
@{const_name HOL.eq} |
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3029
diff
changeset
|
28 |
*} |
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3029
diff
changeset
|
29 |
|
3029 | 30 |
thm trm_assn.fv_defs |
31 |
thm trm_assn.eq_iff |
|
32 |
thm trm_assn.bn_defs |
|
33 |
thm trm_assn.perm_simps |
|
34 |
thm trm_assn.induct |
|
35 |
thm trm_assn.distinct |
|
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
36 |
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2067
diff
changeset
|
37 |
|
2561
7926f1cb45eb
respectfulness for permute_bn functions
Christian Urban <urbanc@in.tum.de>
parents:
2454
diff
changeset
|
38 |
|
7926f1cb45eb
respectfulness for permute_bn functions
Christian Urban <urbanc@in.tum.de>
parents:
2454
diff
changeset
|
39 |
section {* Tests *} |
7926f1cb45eb
respectfulness for permute_bn functions
Christian Urban <urbanc@in.tum.de>
parents:
2454
diff
changeset
|
40 |
|
7926f1cb45eb
respectfulness for permute_bn functions
Christian Urban <urbanc@in.tum.de>
parents:
2454
diff
changeset
|
41 |
|
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
42 |
(* why is this not in HOL simpset? *) |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
43 |
(* |
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
44 |
lemma set_sub: "{a, b} - {b} = {a} - {b}" |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
45 |
by auto |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
46 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
47 |
lemma lets_bla: |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
48 |
"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))" |
2101
e417be53916e
fixed a problem with non-existant alphas2
Christian Urban <urbanc@in.tum.de>
parents:
2094
diff
changeset
|
49 |
apply (auto simp add: trm_lts.eq_iff alphas set_sub supp_at_base) |
e417be53916e
fixed a problem with non-existant alphas2
Christian Urban <urbanc@in.tum.de>
parents:
2094
diff
changeset
|
50 |
done |
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
51 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
52 |
lemma lets_ok: |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
53 |
"(Lt (Lcons x (Vr x) Lnil) (Vr x)) = (Lt (Lcons y (Vr y) Lnil) (Vr y))" |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
54 |
apply (simp add: trm_lts.eq_iff) |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
55 |
apply (rule_tac x="(x \<leftrightarrow> y)" in exI) |
2101
e417be53916e
fixed a problem with non-existant alphas2
Christian Urban <urbanc@in.tum.de>
parents:
2094
diff
changeset
|
56 |
apply (simp_all add: alphas fresh_star_def eqvts supp_at_base) |
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
57 |
done |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
58 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
59 |
lemma lets_ok3: |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
60 |
"x \<noteq> y \<Longrightarrow> |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
61 |
(Lt (Lcons x (Ap (Vr y) (Vr x)) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
62 |
(Lt (Lcons y (Ap (Vr x) (Vr y)) (Lcons x (Vr x) Lnil)) (Ap (Vr x) (Vr y)))" |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
63 |
apply (simp add: alphas trm_lts.eq_iff) |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
64 |
done |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
65 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
66 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
67 |
lemma lets_not_ok1: |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
68 |
"x \<noteq> y \<Longrightarrow> |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
69 |
(Lt (Lcons x (Vr x) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
70 |
(Lt (Lcons y (Vr x) (Lcons x (Vr y) Lnil)) (Ap (Vr x) (Vr y)))" |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
71 |
apply (simp add: alphas trm_lts.eq_iff) |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
72 |
done |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
73 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
74 |
lemma lets_nok: |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
75 |
"x \<noteq> y \<Longrightarrow> x \<noteq> z \<Longrightarrow> z \<noteq> y \<Longrightarrow> |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
76 |
(Lt (Lcons x (Ap (Vr z) (Vr z)) (Lcons y (Vr z) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
77 |
(Lt (Lcons y (Vr z) (Lcons x (Ap (Vr z) (Vr z)) Lnil)) (Ap (Vr x) (Vr y)))" |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
78 |
apply (simp add: alphas trm_lts.eq_iff fresh_star_def) |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
79 |
done |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
80 |
|
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1674
diff
changeset
|
81 |
lemma lets_ok4: |
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1674
diff
changeset
|
82 |
"(Lt (Lcons x (Ap (Vr y) (Vr x)) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) = |
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1674
diff
changeset
|
83 |
(Lt (Lcons y (Ap (Vr x) (Vr y)) (Lcons x (Vr x) Lnil)) (Ap (Vr y) (Vr x)))" |
2041
3842464ee03b
Move 2 more to NewParser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1773
diff
changeset
|
84 |
apply (simp add: alphas trm_lts.eq_iff supp_at_base) |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1674
diff
changeset
|
85 |
apply (rule_tac x="(x \<leftrightarrow> y)" in exI) |
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1674
diff
changeset
|
86 |
apply (simp add: atom_eqvt fresh_star_def) |
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1674
diff
changeset
|
87 |
done |
2438
abafea9b39bb
corrected bug with fv-function generation (that was the problem with recursive binders)
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
88 |
*) |
1603
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
89 |
end |
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
90 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
91 |
|
2b367c80c0d7
Moved let properties from Term5 to ExLetRec.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
92 |