2436
|
1 |
theory TypeVarsTest
|
2454
|
2 |
imports "../Nominal2"
|
2436
|
3 |
begin
|
|
4 |
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
5 |
(* a nominal datatype with type variables and sorts *)
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
6 |
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
7 |
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
8 |
(* the sort constraints need to be attached to the *)
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
9 |
(* first occurence of the type variables on the *)
|
2622
|
10 |
(* right-hand side *)
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
11 |
|
2436
|
12 |
atom_decl name
|
|
13 |
|
|
14 |
class s1
|
|
15 |
class s2
|
|
16 |
|
2571
|
17 |
instance nat :: s1 ..
|
|
18 |
instance int :: s2 ..
|
|
19 |
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
20 |
nominal_datatype ('a, 'b, 'c) lam =
|
2436
|
21 |
Var "name"
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
22 |
| App "('a::s1, 'b::s2, 'c::at) lam" "('a, 'b, 'c) lam"
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
23 |
| Lam x::"name" l::"('a, 'b, 'c) lam" bind x in l
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
24 |
| Foo "'a" "'b"
|
2622
|
25 |
| Bar x::"'c" l::"('a, 'b, 'c) lam" bind x in l (* Bar binds a polymorphic atom *)
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
26 |
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
27 |
term Foo
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
28 |
term Bar
|
2436
|
29 |
|
|
30 |
thm lam.distinct
|
|
31 |
thm lam.induct
|
2617
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
32 |
thm lam.exhaust
|
e44551d067e6
properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
33 |
thm lam.strong_exhaust
|
2436
|
34 |
thm lam.fv_defs
|
|
35 |
thm lam.bn_defs
|
|
36 |
thm lam.perm_simps
|
|
37 |
thm lam.eq_iff
|
|
38 |
thm lam.fv_bn_eqvt
|
|
39 |
thm lam.size_eqvt
|
2557
781fbc8c0591
fixed locally the problem with the function package; all tests work again
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
40 |
|
2730
|
41 |
(* FIXME: only works for type variables 'a 'b 'c *)
|
|
42 |
|
|
43 |
nominal_datatype ('a, 'b, 'c) psi =
|
|
44 |
PsiNil
|
|
45 |
| Output "'a" "'a" "('a, 'b, 'c) psi"
|
|
46 |
|
2436
|
47 |
|
|
48 |
end
|
|
49 |
|
|
50 |
|
|
51 |
|