author | Christian Urban <urbanc@in.tum.de> |
Tue, 10 Apr 2012 16:02:30 +0100 | |
changeset 3158 | 89f9d7e85e88 |
parent 3029 | 6fd3fc3254ee |
child 3071 | 11f6a561eb4b |
permissions | -rw-r--r-- |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
1 |
theory LetPat |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
2 |
imports "../Nominal2" |
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
5 |
atom_decl name |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
|
2026
7f504136149b
Another example where only alpha_eqvt fails.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1773
diff
changeset
|
7 |
nominal_datatype trm = |
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
8 |
Var "name" |
2026
7f504136149b
Another example where only alpha_eqvt fails.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1773
diff
changeset
|
9 |
| App "trm" "trm" |
3029 | 10 |
| Lam x::"name" t::"trm" binds x in t |
11 |
| Let p::"pat" "trm" t::"trm" binds "bn p" in t |
|
2026
7f504136149b
Another example where only alpha_eqvt fails.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1773
diff
changeset
|
12 |
and pat = |
3029 | 13 |
PNil |
14 |
| PVar "name" |
|
15 |
| PTup "pat" "pat" |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
16 |
binder |
3029 | 17 |
bn::"pat \<Rightarrow> atom list" |
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
18 |
where |
3029 | 19 |
"bn PNil = []" |
20 |
| "bn (PVar x) = [atom x]" |
|
21 |
| "bn (PTup p1 p2) = bn p1 @ bn p2" |
|
2300
9fb315392493
added FSet to the correct paper
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
22 |
|
3029 | 23 |
thm trm_pat.eq_iff |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
24 |
thm trm_pat.distinct |
2026
7f504136149b
Another example where only alpha_eqvt fails.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1773
diff
changeset
|
25 |
thm trm_pat.induct |
3029 | 26 |
thm trm_pat.strong_induct[no_vars] |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
27 |
thm trm_pat.exhaust |
3029 | 28 |
thm trm_pat.strong_exhaust[no_vars] |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
29 |
thm trm_pat.fv_defs |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
30 |
thm trm_pat.bn_defs |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
31 |
thm trm_pat.perm_simps |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
32 |
thm trm_pat.eq_iff |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2311
diff
changeset
|
33 |
thm trm_pat.fv_bn_eqvt |
3029 | 34 |
thm trm_pat.size |
35 |
||
36 |
(* Nominal_Abs test *) |
|
37 |
||
38 |
lemma alpha_res_alpha_set: |
|
39 |
"(bs, x) \<approx>res op = supp p (cs, y) \<longleftrightarrow> |
|
40 |
(bs \<inter> supp x, x) \<approx>set op = supp p (cs \<inter> supp y, y)" |
|
41 |
using alpha_abs_set_abs_res alpha_abs_res_abs_set by blast |
|
42 |
||
43 |
||
44 |
lemma |
|
45 |
fixes x::"'a::fs" |
|
46 |
assumes "(supp x - as) \<sharp>* p" |
|
47 |
and "p \<bullet> x = y" |
|
48 |
and "p \<bullet> (as \<inter> supp x) = bs \<inter> supp y" |
|
49 |
shows "(as, x) \<approx>res (op =) supp p (bs, y)" |
|
50 |
using assms |
|
51 |
unfolding alpha_res_alpha_set |
|
52 |
unfolding alphas |
|
53 |
apply simp |
|
54 |
apply rule |
|
55 |
apply (rule trans) |
|
56 |
apply (rule supp_perm_eq[symmetric, of _ p]) |
|
57 |
apply(subst supp_finite_atom_set) |
|
58 |
apply (metis finite_Diff finite_supp) |
|
59 |
apply (simp add: fresh_star_def) |
|
60 |
apply blast |
|
61 |
apply(perm_simp) |
|
62 |
apply(simp) |
|
63 |
done |
|
64 |
||
65 |
lemma |
|
66 |
fixes x::"'a::fs" |
|
67 |
assumes "(supp x - as) \<sharp>* p" |
|
68 |
and "p \<bullet> x = y" |
|
69 |
and "p \<bullet> as = bs" |
|
70 |
shows "(as, x) \<approx>set (op =) supp p (bs, y)" |
|
71 |
using assms |
|
72 |
unfolding alphas |
|
73 |
apply simp |
|
74 |
apply (rule trans) |
|
75 |
apply (rule supp_perm_eq[symmetric, of _ p]) |
|
76 |
apply(subst supp_finite_atom_set) |
|
77 |
apply (metis finite_Diff finite_supp) |
|
78 |
apply(simp) |
|
79 |
apply(perm_simp) |
|
80 |
apply(simp) |
|
81 |
done |
|
82 |
||
83 |
lemma |
|
84 |
fixes x::"'a::fs" |
|
85 |
assumes "(supp x - set as) \<sharp>* p" |
|
86 |
and "p \<bullet> x = y" |
|
87 |
and "p \<bullet> as = bs" |
|
88 |
shows "(as, x) \<approx>lst (op =) supp p (bs, y)" |
|
89 |
using assms |
|
90 |
unfolding alphas |
|
91 |
apply simp |
|
92 |
apply (rule trans) |
|
93 |
apply (rule supp_perm_eq[symmetric, of _ p]) |
|
94 |
apply(subst supp_finite_atom_set) |
|
95 |
apply (metis finite_Diff finite_supp) |
|
96 |
apply(simp) |
|
97 |
apply(perm_simp) |
|
98 |
apply(simp) |
|
99 |
done |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
100 |
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2030
diff
changeset
|
101 |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
102 |
end |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
103 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
104 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
105 |