lift_definition(code_dt) f5 :: "'a \ (bool2 \ 'a) option" is "\x. Some (True, x)" by simp
(* ugly (i.e., sensitive to rewriting done in my tactics) definition of T *)
typedef'a T = "{ x::'a. \<forall>(y::'a) z::'a. \<exists>(w::'a). (z = z) \<and> eq_onp top y y \<or> rel_prod (eq_onp top) (eq_onp top) (x, y) (x, y) \<longrightarrow> pred_prod top top (w, w) }" by auto
setup_lifting type_definition_T
lift_definition(code_dt) f6 :: "bool T option"is"Some True"by simp
lift_definition(code_dt) f7 :: "(bool T \ int) option" is "Some (True, 42)" by simp
lift_definition(code_dt) f8 :: "bool T \ int \ (bool T \ int) option" is"\x y. if x then Some (x, y) else None" by simp
lift_definition(code_dt) f9 :: "nat \ ((bool T \ int) option) list \ nat" is"\x. ([Some (True, 42)], x)" by simp
(* complicated nested datatypes *)
(* stolen from Datatype_Examples *) datatype'a tree = Empty | Node 'a "'a tree list"
datatype'a ttree = TEmpty | TNode 'a "'a ttree list tree"
datatype'a tttree = TEmpty | TNode 'a "'a tttree list ttree list tree"
lift_definition(code_dt) f10 :: "int \ int T tree" is "\i. Node i [Node i Nil, Empty]" by simp
lift_definition(code_dt) f11 :: "int \ int T ttree" is"\i. ttree.TNode i (Node [ttree.TNode i Empty] [])" by simp
lift_definition(code_dt) f12 :: "int \ int T tttree" is "\i. tttree.TNode i Empty" by simp
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.