adding code equations for partial_term_of for rational numbers
authorbulwahn
Mon, 18 Jul 2011 10:34:21 +0200
changeset 43889 90d24cafb05d
parent 43888 ee4be704c2a4
child 43890 eba9c3b1f84a
adding code equations for partial_term_of for rational numbers
src/HOL/Rat.thy
--- a/src/HOL/Rat.thy	Mon Jul 18 10:34:21 2011 +0200
+++ b/src/HOL/Rat.thy	Mon Jul 18 10:34:21 2011 +0200
@@ -1171,6 +1171,21 @@
 
 end
 
+instantiation rat :: partial_term_of
+begin
+
+instance ..
+
+end
+
+lemma [code]:
+  "partial_term_of (ty :: rat itself) (Quickcheck_Narrowing.Var p tt) == Code_Evaluation.Free (STR ''_'') (Typerep.Typerep (STR ''Rat.rat'') [])"
+  "partial_term_of (ty :: rat itself) (Quickcheck_Narrowing.Ctr 0 [l, k]) ==
+     Code_Evaluation.App (Code_Evaluation.App (Code_Evaluation.Const (STR ''Rat.Fract'')
+     (Typerep.Typerep (STR ''fun'') [Typerep.Typerep (STR ''Int.int'') [], Typerep.Typerep (STR ''fun'') [Typerep.Typerep (STR ''Int.int'') [],
+        Typerep.Typerep (STR ''Rat.rat'') []]])) (partial_term_of (TYPE(int)) l)) (partial_term_of (TYPE(int)) k)" 
+by (rule partial_term_of_anything)+
+
 instantiation rat :: narrowing
 begin