author | Christian Urban <urbanc@in.tum.de> |
Fri, 17 Feb 2012 11:50:09 +0000 | |
branch | Nominal2-Isabelle2011-1 |
changeset 3122 | 5a8ed4dad895 |
parent 3071 | 11f6a561eb4b |
permissions | -rw-r--r-- |
1795 | 1 |
theory TypeSchemes |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2451
diff
changeset
|
2 |
imports "../Nominal2" |
1795 | 3 |
begin |
4 |
||
5 |
section {*** Type Schemes ***} |
|
6 |
||
2556
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
7 |
atom_decl name |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
8 |
|
2486
b4ea19604b0b
cleaned up two examples
Christian Urban <urbanc@in.tum.de>
parents:
2480
diff
changeset
|
9 |
(* defined as a single nominal datatype *) |
1795 | 10 |
|
11 |
nominal_datatype ty = |
|
12 |
Var "name" |
|
13 |
| Fun "ty" "ty" |
|
14 |
and tys = |
|
2950
0911cb7bf696
changed bind to binds in specifications; bind will cause trouble with Monad_Syntax
Christian Urban <urbanc@in.tum.de>
parents:
2886
diff
changeset
|
15 |
All xs::"name fset" ty::"ty" binds (set+) xs in ty |
2434 | 16 |
|
2468 | 17 |
thm ty_tys.distinct |
18 |
thm ty_tys.induct |
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
19 |
thm ty_tys.inducts |
2885
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2867
diff
changeset
|
20 |
thm ty_tys.exhaust |
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2867
diff
changeset
|
21 |
thm ty_tys.strong_exhaust |
2468 | 22 |
thm ty_tys.fv_defs |
23 |
thm ty_tys.bn_defs |
|
24 |
thm ty_tys.perm_simps |
|
25 |
thm ty_tys.eq_iff |
|
26 |
thm ty_tys.fv_bn_eqvt |
|
27 |
thm ty_tys.size_eqvt |
|
28 |
thm ty_tys.supports |
|
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2486
diff
changeset
|
29 |
thm ty_tys.supp |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
30 |
thm ty_tys.fresh |
1795 | 31 |
|
2676
028d5511c15f
some tryes about substitution over type-schemes
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
32 |
section {* defined as two separate nominal datatypes *} |
2486
b4ea19604b0b
cleaned up two examples
Christian Urban <urbanc@in.tum.de>
parents:
2480
diff
changeset
|
33 |
|
2308
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
34 |
nominal_datatype ty2 = |
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
35 |
Var2 "name" |
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
36 |
| Fun2 "ty2" "ty2" |
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
37 |
|
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
38 |
nominal_datatype tys2 = |
2950
0911cb7bf696
changed bind to binds in specifications; bind will cause trouble with Monad_Syntax
Christian Urban <urbanc@in.tum.de>
parents:
2886
diff
changeset
|
39 |
All2 xs::"name fset" ty::"ty2" binds (set+) xs in ty |
2337
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2308
diff
changeset
|
40 |
|
2468 | 41 |
thm tys2.distinct |
2630
8268b277d240
automated all strong induction lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2622
diff
changeset
|
42 |
thm tys2.induct tys2.strong_induct |
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
43 |
thm tys2.exhaust tys2.strong_exhaust |
2468 | 44 |
thm tys2.fv_defs |
45 |
thm tys2.bn_defs |
|
46 |
thm tys2.perm_simps |
|
47 |
thm tys2.eq_iff |
|
48 |
thm tys2.fv_bn_eqvt |
|
49 |
thm tys2.size_eqvt |
|
50 |
thm tys2.supports |
|
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2486
diff
changeset
|
51 |
thm tys2.supp |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
52 |
thm tys2.fresh |
2468 | 53 |
|
2676
028d5511c15f
some tryes about substitution over type-schemes
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
54 |
text {* Some Tests about Alpha-Equality *} |
1795 | 55 |
|
56 |
lemma |
|
57 |
shows "All {|a, b|} (Fun (Var a) (Var b)) = All {|b, a|} (Fun (Var a) (Var b))" |
|
2676
028d5511c15f
some tryes about substitution over type-schemes
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
58 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 59 |
apply(rule_tac x="0::perm" in exI) |
2676
028d5511c15f
some tryes about substitution over type-schemes
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
60 |
apply(simp add: alphas fresh_star_def ty_tys.supp supp_at_base) |
1795 | 61 |
done |
62 |
||
63 |
lemma |
|
64 |
shows "All {|a, b|} (Fun (Var a) (Var b)) = All {|a, b|} (Fun (Var b) (Var a))" |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
65 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 66 |
apply(rule_tac x="(atom a \<rightleftharpoons> atom b)" in exI) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
67 |
apply(simp add: alphas fresh_star_def supp_at_base ty_tys.supp) |
1795 | 68 |
done |
69 |
||
70 |
lemma |
|
71 |
shows "All {|a, b, c|} (Fun (Var a) (Var b)) = All {|a, b|} (Fun (Var a) (Var b))" |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
72 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 73 |
apply(rule_tac x="0::perm" in exI) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
74 |
apply(simp add: alphas fresh_star_def ty_tys.supp supp_at_base) |
1795 | 75 |
done |
76 |
||
77 |
lemma |
|
78 |
assumes a: "a \<noteq> b" |
|
79 |
shows "\<not>(All {|a, b|} (Fun (Var a) (Var b)) = All {|c|} (Fun (Var c) (Var c)))" |
|
80 |
using a |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
81 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 82 |
apply(clarify) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
83 |
apply(simp add: alphas fresh_star_def ty_tys.eq_iff ty_tys.supp supp_at_base) |
1795 | 84 |
apply auto |
85 |
done |
|
86 |
||
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
87 |
|
1795 | 88 |
|
89 |
||
90 |
end |