author | Christian Urban <urbanc@in.tum.de> |
Wed, 31 Mar 2010 22:48:35 +0200 | |
changeset 1737 | 8b6a285ad480 |
parent 1656 | c9d3dda79fe3 |
permissions | -rw-r--r-- |
1600 | 1 |
theory ExPS3 |
2 |
imports "Parser" |
|
3 |
begin |
|
4 |
||
5 |
(* example 3 from Peter Sewell's bestiary *) |
|
6 |
||
7 |
atom_decl name |
|
8 |
||
9 |
ML {* val _ = recursive := false *} |
|
10 |
nominal_datatype exp = |
|
11 |
VarP "name" |
|
12 |
| AppP "exp" "exp" |
|
13 |
| LamP x::"name" e::"exp" bind x in e |
|
1656
c9d3dda79fe3
Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1604
diff
changeset
|
14 |
| LetP x::"name" p::"pat3" e1::"exp" e2::"exp" bind x in e2, bind "bp p" in e1 |
1600 | 15 |
and pat3 = |
16 |
PVar "name" |
|
17 |
| PUnit |
|
18 |
| PPair "pat3" "pat3" |
|
19 |
binder |
|
1656
c9d3dda79fe3
Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1604
diff
changeset
|
20 |
bp :: "pat3 \<Rightarrow> atom set" |
1600 | 21 |
where |
1656
c9d3dda79fe3
Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1604
diff
changeset
|
22 |
"bp (PVar x) = {atom x}" |
c9d3dda79fe3
Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1604
diff
changeset
|
23 |
| "bp (PUnit) = {}" |
c9d3dda79fe3
Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1604
diff
changeset
|
24 |
| "bp (PPair p1 p2) = bp p1 \<union> bp p2" |
1600 | 25 |
|
26 |
thm exp_pat3.fv |
|
27 |
thm exp_pat3.eq_iff |
|
28 |
thm exp_pat3.bn |
|
29 |
thm exp_pat3.perm |
|
30 |
thm exp_pat3.induct |
|
31 |
thm exp_pat3.distinct |
|
1604
5ab97f43ec24
More modification needed for compilation
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
32 |
thm exp_pat3.fv |
1656
c9d3dda79fe3
Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1604
diff
changeset
|
33 |
thm exp_pat3.supp |
1600 | 34 |
|
35 |
end |
|
36 |
||
37 |
||
38 |