-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWpExamples.thy
More file actions
481 lines (455 loc) · 19.2 KB
/
Copy pathWpExamples.thy
File metadata and controls
481 lines (455 loc) · 19.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
section \<open>Examples of Using the Location Based Weakest Precondition Calculus to Reason about Strategies \<close>
theory WpExamples
imports Wp WpSoundness
begin
(* Example in section 5.1 *)
(* Repeat(SIKP) is a bad strategy *)
theorem repeat_skip_div : "wp (repeat SKIP) \<epsilon> UNIV (\<lambda> x. undefined) = {} \<and> wp_err (repeat SKIP) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
apply simp
apply (rule fixp_induct)
apply (rule ccpo.admissibleI)
apply (simp add: fst_Sup snd_Sup)
apply (simp add: Sup_pt)
apply (subst Abs_pt_inverse)
apply simp
apply (intro mono_intros)
apply (subst Abs_pt_inverse)
apply simp
apply (intro mono_intros)
apply simp
apply (intro mono_intros)
apply (simp add: fst_Sup snd_Sup)
apply (simp add: Sup_pt)
apply (subst Abs_pt_inverse)
apply simp
apply (intro mono_intros)
apply simp
apply simp
apply (subst Abs_pt_inverse)
apply simp
apply (intro mono_intros)
by simp
theorem repeat_skip_div_tot : "wp (repeat SKIP) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
using repeat_skip_div by (rule conjunct1)
(* Example in section 5.1 *)
(* Demonic treatment for nondeterministic choice *)
(* SKIP >< Repeat(SIKP) is a bad strategy *)
theorem choice_has_div_will_div: "wp (SKIP >< (repeat SKIP)) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
apply simp
using repeat_skip_div by simp
(* Example in section 5.1 *)
(* SKIP <+ Repeat(SIKP) is a good strategy *)
theorem lchoice_has_div_might_not_div :"wp (SKIP <+ (repeat SKIP)) \<epsilon> UNIV (\<lambda> x. undefined) = defined \<epsilon>"
by simp
theorem lchoice_has_div_might_div_left: "wp ((repeat SKIP) <+ s) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
apply simp
using repeat_skip_div by simp
theorem lchoice_has_div_might_div_right: "wp (ABORT <+ (repeat SKIP)) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
apply simp
using repeat_skip_div by simp
(* Example in section 5.2 *)
fun plus_comm :: "exp \<Rightarrow> exp option"
where
"plus_comm (Node PLUS n m) = Some (Node PLUS m n)" |
"plus_comm _ = None"
print_theorems
fun mult_comm :: "exp \<Rightarrow> exp option"
where
"mult_comm (Node MULT n m) = Some (Node MULT m n)" |
"mult_comm _ = None"
fun mult_zero :: "exp \<Rightarrow> exp option"
where
"mult_zero (Node MULT (Leaf (Nat 0)) m) = Some (Leaf (Nat 0))" |
"mult_zero _ = None"
fun plus_zero :: "exp \<Rightarrow> exp option"
where
"plus_zero (Node PLUS (Leaf (Nat 0)) m) = Some m" |
"plus_zero _ = None"
(* Example in section 5.2 *)
(* A not well composed strategy is a bad strategy *)
theorem mult_comm_plus_comm_bad: "wp (\<llangle>mult_comm\<rrangle> ;; \<llangle>plus_comm\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
apply (simp split: option.split)
apply (rule allI)
apply (rule conjI)
apply fastforce
apply clarsimp
apply (erule mult_comm.elims; simp)
by fastforce
(* Example in section 5.2 *)
(* A well composed strategy is a good strategy *)
lemma cases_plus_zero: "plus_comm x = Some xa \<Longrightarrow>
a = xa \<Longrightarrow> plus_zero xa = None \<longrightarrow> Err \<in> range E \<Longrightarrow> \<exists>m::exp. x = Node PLUS m (Leaf (label.Nat (0::nat)))"
proof -
fix a xa
show "plus_comm x = Some xa \<Longrightarrow>
a = xa \<Longrightarrow> plus_zero xa = None \<longrightarrow> Err \<in> range E \<Longrightarrow> \<exists>m::exp. x = Node PLUS m (Leaf (label.Nat (0::nat)))"
apply (cases "plus_zero xa")
apply blast
apply (erule plus_zero.elims; simp)
by (erule plus_comm.elims; simp)
qed
theorem plus_comm_seq_plus_zero_good: "wp (\<llangle>plus_comm\<rrangle> ;; \<llangle>plus_zero\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined) =
{e | e m. e = (Node PLUS m (Leaf (Nat 0)))}"
proof (rule set_eqI)
fix x
show "(x \<in> wp (\<llangle>plus_comm\<rrangle>;; \<llangle>plus_zero\<rrangle>) \<epsilon> UNIV (\<lambda>x::int \<times> tag. undefined)) =
(x \<in> {u::exp. \<exists>(e::exp) m::exp. u = e \<and> e = Node PLUS m (Leaf (label.Nat (0::nat)))})"
apply (cases "plus_comm x")
apply auto[1]
apply (simp split: option.split)
apply (rule iffI)
apply (erule imageE)
apply (simp add: cases_plus_zero)
by auto
qed
lemma cases_plus_comm: "plus_zero x = Some xa \<Longrightarrow>
a = xa \<Longrightarrow>
plus_comm xa = None \<longrightarrow> Err \<in> range E \<Longrightarrow>
\<exists>(m::exp) n::exp. x = Node PLUS (Leaf (label.Nat (0::nat))) (Node PLUS m n)"
proof -
fix a xa
show "plus_zero x = Some xa \<Longrightarrow>
a = xa \<Longrightarrow>
plus_comm xa = None \<longrightarrow> Err \<in> range E \<Longrightarrow>
\<exists>(m::exp) n::exp. x = Node PLUS (Leaf (label.Nat (0::nat))) (Node PLUS m n)"
apply (cases "plus_comm xa")
apply auto[1]
apply (erule plus_zero.elims; simp)
by (erule plus_comm.elims; simp)
qed
theorem plus_zero_seq_plus_comm_good: "wp (\<llangle>plus_zero\<rrangle> ;; \<llangle>plus_comm\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined) =
{e | e m n. e = (Node PLUS (Leaf (Nat 0)) (Node PLUS m n))}"
proof (rule set_eqI)
fix x
show "(x \<in> wp (\<llangle>plus_zero\<rrangle>;; \<llangle>plus_comm\<rrangle>) \<epsilon> UNIV (\<lambda>x::int \<times> tag. undefined)) =
(x \<in> {u::exp.
\<exists>(e::exp) (m::exp) n::exp. u = e \<and> e = Node PLUS (Leaf (label.Nat (0::nat))) (Node PLUS m n)})"
proof (cases "plus_zero x")
case None
then show ?thesis
by auto
next
case (Some a)
then show ?thesis
apply (simp split: option.split)
apply (rule iffI)
apply (erule imageE)
apply (simp add: cases_plus_comm)
by auto
qed
qed
theorem plus_comm_mult_comm_bad: "wp (\<llangle>plus_comm\<rrangle> ;; \<llangle>mult_comm\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined) = {}"
apply (simp split: option.split)
apply (rule allI)
apply (rule conjI)
apply fastforce
apply clarsimp
apply (erule plus_comm.elims; simp)
by fastforce
theorem choice_mult_comm_plus_comm_good : "wp ((\<llangle>mult_comm\<rrangle> >< \<llangle>plus_comm\<rrangle>) ;; \<llangle>mult_comm\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined)
= {e | e m n. e = (Node MULT n m)}"
proof (rule set_eqI)
fix x
show "(x \<in> wp (\<llangle>mult_comm\<rrangle>>< \<llangle>plus_comm\<rrangle>;; \<llangle>mult_comm\<rrangle>) \<epsilon> UNIV (\<lambda>x::int \<times> tag. undefined)) =
(x \<in> {u::exp. \<exists>(e::exp) (m::exp) n::exp. u = e \<and> e = Node MULT n m})"
proof (cases "mult_comm x")
case None
then show ?thesis
apply (cases "plus_comm x")
apply auto[1]
apply (erule plus_comm.elims; simp)
by auto[1]
next
case (Some a)
then show ?thesis
apply (cases "plus_comm x")
apply (erule mult_comm.elims; simp)
by (erule plus_comm.elims; simp)
qed
qed
theorem lchoice_mult_comm_plus_comm_good : "wp ((\<llangle>mult_comm\<rrangle> <+ \<llangle>plus_comm\<rrangle>) ;; \<llangle>mult_comm\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined)
= {e | e m n. e = (Node MULT n m)}"
proof (rule set_eqI)
fix x
show "(x \<in> wp (\<llangle>mult_comm\<rrangle><+ \<llangle>plus_comm\<rrangle>;; \<llangle>mult_comm\<rrangle>) \<epsilon> UNIV (\<lambda>x::int \<times> tag. undefined)) =
(x \<in> {u::exp. \<exists>(e::exp) (m::exp) n::exp. u = e \<and> e = Node MULT n m})"
proof (cases "mult_comm x")
case None
then show ?thesis
apply (cases "plus_comm x")
apply auto[1]
apply (erule plus_comm.elims; simp)
by auto[1]
next
case (Some a)
then show ?thesis
apply simp
by (erule mult_comm.elims; simp)
qed
qed
lemma cases_conj_one: "{u::exp.
(mult_comm u = None \<longrightarrow>
Err
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})})} \<inter>
{u::exp.
\<forall>x2::exp.
mult_zero u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}} =
{}"
proof (rule set_eqI)
fix x
show "(x \<in> {u::exp.
(mult_comm u = None \<longrightarrow>
Err
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})})} \<inter>
{u::exp.
\<forall>x2::exp.
mult_zero u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}}) =
(x \<in> {})"
proof (cases "mult_comm x")
case None
then show ?thesis
by clarsimp
next
case (Some a)
then show ?thesis
apply clarsimp
apply (cases "mult_zero x")
apply clarsimp
apply (cases "mult_comm a")
apply blast
apply (erule mult_comm.elims; simp)
apply (erule imageE)
apply clarsimp
apply clarsimp
apply (cases "mult_comm a")
apply blast
apply (erule mult_comm.elims; simp)
apply (erule imageE)
by clarsimp
qed
qed
lemma cases_mult_comm: "mult_comm x = None \<Longrightarrow>
mult_zero x = Some xa \<Longrightarrow>
mult_comm xa = None \<longrightarrow> Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m} \<Longrightarrow>
\<forall>x2::exp.
mult_comm xa = Some x2 \<longrightarrow> E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m} \<Longrightarrow>
False"
proof -
fix x xa
show "mult_comm x = None \<Longrightarrow>
mult_zero x = Some xa \<Longrightarrow>
mult_comm xa = None \<longrightarrow> Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m} \<Longrightarrow>
\<forall>x2::exp.
mult_comm xa = Some x2 \<longrightarrow> E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m} \<Longrightarrow>
False"
apply (cases "mult_comm xa")
apply force
by (erule mult_comm.elims; simp)
qed
lemma cases_conj_two: "{u::exp.
\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}} \<inter>
{u::exp.
(mult_zero u = None \<longrightarrow>
Err
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}) \<and>
(\<forall>x2::exp.
mult_zero u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})})} =
{}"
proof (rule set_eqI)
fix x
show "(x \<in> {u::exp.
\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}} \<inter>
{u::exp.
(mult_zero u = None \<longrightarrow>
Err
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})}) \<and>
(\<forall>x2::exp.
mult_zero u = Some x2 \<longrightarrow>
E x2
\<in> E ` {u::exp.
(mult_comm u = None \<longrightarrow>
Err \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m}) \<and>
(\<forall>x2::exp.
mult_comm u = Some x2 \<longrightarrow>
E x2 \<in> E ` {u::exp. \<exists>m::exp. u = Node MULT (Leaf (label.Nat (0::nat))) m})})}) =
(x \<in> {})"
proof (cases "mult_comm x")
case None
then show ?thesis
proof (cases "mult_zero x")
case None
then show ?thesis by clarsimp
next
case (Some a)
then show ?thesis
apply clarsimp
apply (cases "mult_comm a")
apply force
using None cases_mult_comm by force
qed
next
case (Some a)
then show ?thesis
apply clarsimp
apply (cases "mult_zero x")
apply clarsimp
apply (cases "mult_comm a")
apply force
apply (erule mult_comm.elims; simp)
apply (erule imageE)
by clarsimp
qed
qed
theorem choice_mult_comm_id_bad : "wp ((\<llangle>mult_comm\<rrangle> >< \<llangle>mult_zero\<rrangle>) ;; \<llangle>mult_comm\<rrangle>) \<epsilon>
{e | e m. e = Node MULT (Leaf (Nat 0)) m} (\<lambda> x. undefined) = {}"
apply (simp split: option.split)
apply (rule conjI)
apply (simp add: cases_conj_one)
by (simp add: cases_conj_two)
theorem lchoice_mult_comm_id_good : "wp ((\<llangle>mult_comm\<rrangle> <+ \<llangle>mult_zero\<rrangle>) ;; \<llangle>mult_comm\<rrangle>) \<epsilon>
{e | e m. e = Node MULT (Leaf (Nat 0)) m} (\<lambda> x. undefined) = {e | e m. e = Node MULT (Leaf (Nat 0)) m}"
proof (rule set_eqI)
fix x
show "(x \<in> wp (\<llangle>mult_comm\<rrangle><+ \<llangle>mult_zero\<rrangle>;; \<llangle>mult_comm\<rrangle>) \<epsilon>
{u::exp. \<exists>(e::exp) m::exp. u = e \<and> e = Node MULT (Leaf (label.Nat (0::nat))) m}
(\<lambda>x::int \<times> tag. undefined)) =
(x \<in> {u::exp. \<exists>(e::exp) m::exp. u = e \<and> e = Node MULT (Leaf (label.Nat (0::nat))) m})"
proof (cases "mult_comm x")
case None
then show ?thesis
apply clarsimp
apply (cases "mult_zero x")
apply clarsimp
apply auto[1]
apply clarsimp
by (erule mult_comm.elims; simp)
next
case (Some a)
then show ?thesis
apply clarsimp
apply (cases "mult_comm a")
apply (erule mult_comm.elims; simp)
apply (rule iffI)
apply (erule disjE)
apply (erule imageE)
apply simp
apply (erule imageE)
apply clarsimp
apply (erule mult_comm.elims; simp)
apply clarsimp
apply (erule mult_comm.elims; simp)
by clarsimp
qed
qed
theorem one_plus_zero : "wp (one \<llangle>plus_zero\<rrangle>) \<epsilon> UNIV (\<lambda> x. undefined) =
{e | l e m n. e = Node l (Node PLUS (Leaf (Nat 0)) m) n}
\<union> {e | l e m n. e = Node l n (Node PLUS (Leaf (Nat 0)) m)}"
proof (rule set_eqI)
fix x
show "(x \<in> wp (one \<llangle>plus_zero\<rrangle>) \<epsilon> UNIV (\<lambda>x::int \<times> tag. undefined)) =
(x \<in> {u::exp.
\<exists>(l::label) (e::exp) (m::exp) n::exp.
u = e \<and> e = Node l (Node PLUS (Leaf (label.Nat (0::nat))) m) n} \<union>
{u::exp.
\<exists>(l::label) (e::exp) (m::exp) n::exp.
u = e \<and> e = Node l n (Node PLUS (Leaf (label.Nat (0::nat))) m)})"
proof (cases "plus_zero (lookup (pos.Left\<triangleleft>\<epsilon>) x)")
case None
then show ?thesis
apply clarsimp
apply (cases "plus_zero (lookup (pos.Right\<triangleleft>\<epsilon>) x)")
apply clarsimp
apply auto[1]
apply clarsimp
apply rotate_tac
apply (erule plus_zero.elims; simp)
by auto[1]
next
case (Some a)
then show ?thesis
apply clarsimp
apply (cases "plus_zero (lookup (pos.Right\<triangleleft>\<epsilon>) x)")
apply clarsimp
apply (erule plus_zero.elims; simp)
apply auto[1]
apply clarsimp
apply (erule plus_zero.elims; simp)
by auto
qed
qed
end