2 ID: $Id$ |
2 ID: $Id$ |
3 Author: Olaf Mueller |
3 Author: Olaf Mueller |
4 License: GPL (GNU GENERAL PUBLIC LICENSE) |
4 License: GPL (GNU GENERAL PUBLIC LICENSE) |
5 *) |
5 *) |
6 |
6 |
7 header {* Lifting types of class term to flat pcpo's *} |
7 header {* Lifting types of class type to flat pcpo's *} |
8 |
8 |
9 theory Lift = Cprod3: |
9 theory Lift = Cprod3: |
10 |
10 |
11 defaultsort "term" |
11 defaultsort type |
12 |
12 |
13 |
13 |
14 typedef 'a lift = "UNIV :: 'a option set" .. |
14 typedef 'a lift = "UNIV :: 'a option set" .. |
15 |
15 |
16 constdefs |
16 constdefs |
17 Undef :: "'a lift" |
17 Undef :: "'a lift" |
18 "Undef == Abs_lift None" |
18 "Undef == Abs_lift None" |
19 Def :: "'a => 'a lift" |
19 Def :: "'a => 'a lift" |
20 "Def x == Abs_lift (Some x)" |
20 "Def x == Abs_lift (Some x)" |
21 |
21 |
22 instance lift :: ("term") sq_ord .. |
22 instance lift :: (type) sq_ord .. |
23 |
23 |
24 defs (overloaded) |
24 defs (overloaded) |
25 less_lift_def: "x << y == (x=y | x=Undef)" |
25 less_lift_def: "x << y == (x=y | x=Undef)" |
26 |
26 |
27 instance lift :: ("term") po |
27 instance lift :: (type) po |
28 proof |
28 proof |
29 fix x y z :: "'a lift" |
29 fix x y z :: "'a lift" |
30 show "x << x" by (unfold less_lift_def) blast |
30 show "x << x" by (unfold less_lift_def) blast |
31 { assume "x << y" and "y << x" thus "x = y" by (unfold less_lift_def) blast } |
31 { assume "x << y" and "y << x" thus "x = y" by (unfold less_lift_def) blast } |
32 { assume "x << y" and "y << z" thus "x << z" by (unfold less_lift_def) blast } |
32 { assume "x << y" and "y << z" thus "x << z" by (unfold less_lift_def) blast } |
109 theorem cpo_lift: "chain (Y::nat => 'a lift) ==> EX x. range Y <<| x" |
109 theorem cpo_lift: "chain (Y::nat => 'a lift) ==> EX x. range Y <<| x" |
110 apply (cut_tac flat_imp_chfin_poo) |
110 apply (cut_tac flat_imp_chfin_poo) |
111 apply (blast intro: lub_finch1) |
111 apply (blast intro: lub_finch1) |
112 done |
112 done |
113 |
113 |
114 instance lift :: ("term") pcpo |
114 instance lift :: (type) pcpo |
115 apply intro_classes |
115 apply intro_classes |
116 apply (erule cpo_lift) |
116 apply (erule cpo_lift) |
117 apply (rule least_lift) |
117 apply (rule least_lift) |
118 done |
118 done |
119 |
119 |
151 subsection {* Further operations *} |
151 subsection {* Further operations *} |
152 |
152 |
153 consts |
153 consts |
154 flift1 :: "('a => 'b::pcpo) => ('a lift -> 'b)" |
154 flift1 :: "('a => 'b::pcpo) => ('a lift -> 'b)" |
155 flift2 :: "('a => 'b) => ('a lift -> 'b lift)" |
155 flift2 :: "('a => 'b) => ('a lift -> 'b lift)" |
156 liftpair ::"'a::term lift * 'b::term lift => ('a * 'b) lift" |
156 liftpair ::"'a::type lift * 'b::type lift => ('a * 'b) lift" |
157 |
157 |
158 defs |
158 defs |
159 flift1_def: |
159 flift1_def: |
160 "flift1 f == (LAM x. (case x of |
160 "flift1 f == (LAM x. (case x of |
161 UU => UU |
161 UU => UU |