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