equal
deleted
inserted
replaced
9 |
9 |
10 subsection "Definition" |
10 subsection "Definition" |
11 |
11 |
12 definition |
12 definition |
13 dlift :: "(('a::type) discr -> 'b::pcpo) => ('a lift -> 'b)" where |
13 dlift :: "(('a::type) discr -> 'b::pcpo) => ('a lift -> 'b)" where |
14 "dlift f = (LAM x. case x of UU => UU | Def y => f\<cdot>(Discr y))" |
14 "dlift f = (LAM x. case x of UU \<Rightarrow> UU | Def y \<Rightarrow> f\<cdot>(Discr y))" |
15 |
15 |
16 primrec D :: "com => state discr -> state lift" |
16 primrec D :: "com \<Rightarrow> state discr \<rightarrow> state lift" |
17 where |
17 where |
18 "D(SKIP) = (LAM s. Def(undiscr s))" |
18 "D(SKIP) = (LAM s. Def(undiscr s))" |
19 | "D(X ::= a) = (LAM s. Def((undiscr s)(X := aval a (undiscr s))))" |
19 | "D(X ::= a) = (LAM s. Def((undiscr s)(X := aval a (undiscr s))))" |
20 | "D(c0 ;; c1) = (dlift(D c1) oo (D c0))" |
20 | "D(c0 ;; c1) = (dlift(D c1) oo (D c0))" |
21 | "D(IF b THEN c1 ELSE c2) = |
21 | "D(IF b THEN c1 ELSE c2) = |
35 |
35 |
36 lemma dlift_is_Def [simp]: |
36 lemma dlift_is_Def [simp]: |
37 "(dlift f\<cdot>l = Def y) = (\<exists>x. l = Def x \<and> f\<cdot>(Discr x) = Def y)" |
37 "(dlift f\<cdot>l = Def y) = (\<exists>x. l = Def x \<and> f\<cdot>(Discr x) = Def y)" |
38 by (simp add: dlift_def split: lift.split) |
38 by (simp add: dlift_def split: lift.split) |
39 |
39 |
40 lemma eval_implies_D: "(c,s) \<Rightarrow> t ==> D c\<cdot>(Discr s) = (Def t)" |
40 lemma eval_implies_D: "(c,s) \<Rightarrow> t \<Longrightarrow> D c\<cdot>(Discr s) = (Def t)" |
41 apply (induct rule: big_step_induct) |
41 apply (induct rule: big_step_induct) |
42 apply (auto) |
42 apply (auto) |
43 apply (subst fix_eq) |
43 apply (subst fix_eq) |
44 apply simp |
44 apply simp |
45 apply (subst fix_eq) |
45 apply (subst fix_eq) |
46 apply simp |
46 apply simp |
47 done |
47 done |
48 |
48 |
49 lemma D_implies_eval: "!s t. D c\<cdot>(Discr s) = (Def t) --> (c,s) \<Rightarrow> t" |
49 lemma D_implies_eval: "\<forall>s t. D c\<cdot>(Discr s) = (Def t) \<longrightarrow> (c,s) \<Rightarrow> t" |
50 apply (induct c) |
50 apply (induct c) |
51 apply fastforce |
51 apply fastforce |
52 apply fastforce |
52 apply fastforce |
53 apply force |
53 apply force |
54 apply (simp (no_asm)) |
54 apply (simp (no_asm)) |