equal
deleted
inserted
replaced
18 pcpodef (Ssum) ('a, 'b) "++" (infixr "++" 10) = |
18 pcpodef (Ssum) ('a, 'b) "++" (infixr "++" 10) = |
19 "{p :: tr \<times> ('a \<times> 'b). |
19 "{p :: tr \<times> ('a \<times> 'b). |
20 (cfst\<cdot>p \<sqsubseteq> TT \<longleftrightarrow> csnd\<cdot>(csnd\<cdot>p) = \<bottom>) \<and> |
20 (cfst\<cdot>p \<sqsubseteq> TT \<longleftrightarrow> csnd\<cdot>(csnd\<cdot>p) = \<bottom>) \<and> |
21 (cfst\<cdot>p \<sqsubseteq> FF \<longleftrightarrow> cfst\<cdot>(csnd\<cdot>p) = \<bottom>)}" |
21 (cfst\<cdot>p \<sqsubseteq> FF \<longleftrightarrow> cfst\<cdot>(csnd\<cdot>p) = \<bottom>)}" |
22 by simp |
22 by simp |
|
23 |
|
24 instance "++" :: ("{finite_po,pcpo}", "{finite_po,pcpo}") finite_po |
|
25 by (rule typedef_finite_po [OF type_definition_Ssum]) |
|
26 |
|
27 instance "++" :: ("{chfin,pcpo}", "{chfin,pcpo}") chfin |
|
28 by (rule typedef_chfin [OF type_definition_Ssum less_Ssum_def]) |
23 |
29 |
24 syntax (xsymbols) |
30 syntax (xsymbols) |
25 "++" :: "[type, type] => type" ("(_ \<oplus>/ _)" [21, 20] 20) |
31 "++" :: "[type, type] => type" ("(_ \<oplus>/ _)" [21, 20] 20) |
26 syntax (HTML output) |
32 syntax (HTML output) |
27 "++" :: "[type, type] => type" ("(_ \<oplus>/ _)" [21, 20] 20) |
33 "++" :: "[type, type] => type" ("(_ \<oplus>/ _)" [21, 20] 20) |
184 unfolding beta_sscase by (simp add: Rep_Ssum_sinr) |
190 unfolding beta_sscase by (simp add: Rep_Ssum_sinr) |
185 |
191 |
186 lemma sscase4 [simp]: "sscase\<cdot>sinl\<cdot>sinr\<cdot>z = z" |
192 lemma sscase4 [simp]: "sscase\<cdot>sinl\<cdot>sinr\<cdot>z = z" |
187 by (cases z, simp_all) |
193 by (cases z, simp_all) |
188 |
194 |
|
195 subsection {* Strict sum preserves flatness *} |
|
196 |
|
197 lemma flat_less_iff: |
|
198 fixes x y :: "'a::flat" |
|
199 shows "(x \<sqsubseteq> y) = (x = \<bottom> \<or> x = y)" |
|
200 by (safe dest!: ax_flat [rule_format]) |
|
201 |
|
202 instance "++" :: (flat, flat) flat |
|
203 apply (intro_classes, clarify) |
|
204 apply (rule_tac p=x in ssumE, simp) |
|
205 apply (rule_tac p=y in ssumE, simp_all add: flat_less_iff) |
|
206 apply (rule_tac p=y in ssumE, simp_all add: flat_less_iff) |
|
207 done |
|
208 |
189 end |
209 end |