# HG changeset patch # User huffman # Date 1121185244 -7200 # Node ID a3899ac14a1c515576ed2625a359256a8010805c # Parent c1b87ef4a1c3119b8d022e2ef51799912249e9c4 generalized types of monadic operators to class cpo; added match function for UU diff -r c1b87ef4a1c3 -r a3899ac14a1c src/HOLCF/Fixrec.thy --- a/src/HOLCF/Fixrec.thy Tue Jul 12 17:56:03 2005 +0200 +++ b/src/HOLCF/Fixrec.thy Tue Jul 12 18:20:44 2005 +0200 @@ -12,6 +12,8 @@ subsection {* Maybe monad type *} +defaultsort cpo + types 'a maybe = "one ++ 'a u" constdefs @@ -77,7 +79,7 @@ subsection {* Run operator *} constdefs - run:: "'a maybe \ 'a" + run:: "'a::pcpo maybe \ 'a" "run \ sscase\\\(fup\ID)" text {* rewrite rules for run *} @@ -119,8 +121,13 @@ subsection {* Match functions for built-in types *} +defaultsort pcpo + constdefs - match_cpair :: "'a \ 'b \ ('a \ 'b) maybe" + match_UU :: "'a \ unit maybe" + "match_UU \ \ x. fail" + + match_cpair :: "'a::cpo \ 'b::cpo \ ('a \ 'b) maybe" "match_cpair \ csplit\(\ x y. return\)" match_spair :: "'a \ 'b \ ('a \ 'b) maybe" @@ -132,7 +139,7 @@ match_sinr :: "'a \ 'b \ 'b maybe" "match_sinr \ sscase\(\ x. fail)\return" - match_up :: "'a u \ 'a maybe" + match_up :: "'a::cpo u \ 'a maybe" "match_up \ fup\return" match_ONE :: "one \ unit maybe" @@ -144,6 +151,10 @@ match_FF :: "tr \ unit maybe" "match_FF \ flift1 (\b. if b then fail else return\())" +lemma match_UU_simps [simp]: + "match_UU\x = fail" +by (simp add: match_UU_def) + lemma match_cpair_simps [simp]: "match_cpair\ = return\" by (simp add: match_cpair_def)