author | Christian Urban <urbanc@in.tum.de> |
Tue, 03 May 2011 15:39:30 +0100 | |
changeset 2779 | 3c769bf10e63 |
parent 2622 | e6e6a3da81aa |
child 2950 | 0911cb7bf696 |
permissions | -rw-r--r-- |
2083
9568f9f31822
tuned file names for examples
Christian Urban <urbanc@in.tum.de>
parents:
2082
diff
changeset
|
1 |
theory NoneExamples |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
2 |
imports "../Nominal2" |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
|
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
5 |
text {* |
2622 | 6 |
These examples are not covered by our binding |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
7 |
specification. |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
8 |
*} |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
9 |
|
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
10 |
atom_decl name |
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
11 |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
12 |
text {* |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
13 |
"Weirdo" example from Peter Sewell's bestiary. |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
14 |
|
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
15 |
p2 occurs in two bodies |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
16 |
*} |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
17 |
|
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
18 |
(* |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
19 |
nominal_datatype weird = |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
20 |
Foo_var "name" |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
21 |
| Foo_pair "weird" "weird" |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
22 |
| Foo x::"name" y::"name" p1::"weird" p2::"weird" p3::"weird" |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
23 |
bind x in p1 p2, |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
24 |
bind y in p2 p3 |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
25 |
*) |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
26 |
|
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
27 |
text {* |
2622 | 28 |
This example binds bound names and therefore the |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
29 |
fv-function is not respectful - the proof just fails. |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
30 |
*} |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2083
diff
changeset
|
31 |
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
32 |
(* |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
33 |
nominal_datatype trm = |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
34 |
Var "name" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
35 |
| Lam x::"name" t::"trm" bind x in t |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
36 |
| Let left::"trm" right::"trm" bind (set) "bv left" in right |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
37 |
binder |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
38 |
bv |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
39 |
where |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
40 |
"bv (Var n) = {}" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
41 |
| "bv (Lam n t) = {atom n} \<union> bv t" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
42 |
| "bv (Let l r) = bv l \<union> bv r" |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
43 |
*) |
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
44 |
|
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
45 |
text {* |
2622 | 46 |
This example uses "-" in the binding function; |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
47 |
at the moment this is unsupported |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
48 |
*} |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
49 |
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
50 |
(* |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
51 |
nominal_datatype trm' = |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
52 |
Var "name" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
53 |
| Lam l::"name" r::"trm'" bind l in r |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
54 |
| Let l::"trm'" r::"trm'" bind (set) "bv' l" in r |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
55 |
binder |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
56 |
bv' |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
57 |
where |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
58 |
"bv' (Var n) = {atom n}" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
59 |
| "bv' (Lam n t) = bv' t - {atom n}" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
60 |
| "bv' (Let l r) = bv' l \<union> bv' r" |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
61 |
*) |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
62 |
|
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
63 |
text {* |
2622 | 64 |
Again this example binds bound names - so is not respectful |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
65 |
*} |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
66 |
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
67 |
(* |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
68 |
nominal_datatype trm = |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
69 |
Var "name" |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
70 |
| Lam n::"name" l::"trm" bind n in l |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
71 |
and bla = |
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
72 |
Bla f::"trm" s::"trm" bind (set) "bv f" in s |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
73 |
binder |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
74 |
bv :: "trm \<Rightarrow> atom set" |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
75 |
where |
2622 | 76 |
"bv (Var x) = {}" |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
77 |
| "bv (Lam x b) = {atom x}" |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
78 |
*) |
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
79 |
|
2622 | 80 |
text {* |
81 |
This example has mal-formed deep recursive binders. |
|
82 |
||
83 |
- Bla1: recursive deep binder used twice |
|
84 |
- Bla2: deep binder used recursively and non-recursively |
|
85 |
- Bla3: x used in recursive deep binder and somewhere else |
|
86 |
*} |
|
87 |
||
88 |
(* |
|
89 |
nominal_datatype trm = |
|
90 |
Var "name" |
|
91 |
and bla = |
|
92 |
App "trm" "trm" |
|
93 |
| Bla1 f::"trm" s1::"trm" s2::"trm" bind "bv f" in s1 f, bind "bv f" in s2 f |
|
94 |
| Bla2 f::"trm" s1::"trm" s2::"trm" bind "bv f" in s1, bind "bv f" in s2 f |
|
95 |
| Bla3 f::"trm" s1::"trm" s2::"trm" x::"name" y::"name" bind "bv f" x in s1 f, bind y x in s2 |
|
96 |
binder |
|
97 |
bv :: "trm \<Rightarrow> atom list" |
|
98 |
where |
|
99 |
"bv (Var a) = [atom a]" |
|
100 |
*) |
|
101 |
||
102 |
||
1589
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
103 |
end |
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
104 |
|
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
105 |
|
6542026b95cd
Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
106 |