export one more ML function
authorblanchet
Mon, 08 Sep 2014 14:03:01 +0200
changeset 58209 2e771e0e50ee
parent 58208 cd7868fd8f01
child 58210 a456b2c03491
export one more ML function
src/HOL/Tools/BNF/bnf_fp_def_sugar.ML
--- a/src/HOL/Tools/BNF/bnf_fp_def_sugar.ML	Mon Sep 08 14:03:01 2014 +0200
+++ b/src/HOL/Tools/BNF/bnf_fp_def_sugar.ML	Mon Sep 08 14:03:01 2014 +0200
@@ -81,6 +81,8 @@
     int list list -> term ->
     typ list list
     * (typ list list list list * typ list list list * typ list list list list * typ list)
+  val define_co_rec_as: BNF_Util.fp_kind -> typ -> typ list -> binding -> term -> local_theory ->
+    (term * thm) * local_theory
   val define_rec:
     typ list list * typ list list list list * term list list * term list list list list ->
     (string -> binding) -> typ list -> typ list -> term list -> term -> Proof.context ->
@@ -521,7 +523,7 @@
     Term.lambda c (mk_IfN absT cps ts)
   end;
 
-fun define_co_rec fp fpT Cs b rhs lthy0 =
+fun define_co_rec_as fp fpT Cs b rhs lthy0 =
   let
     val thy = Proof_Context.theory_of lthy0;
 
@@ -546,7 +548,7 @@
     val (ctor_rec_absTs, fpT) = strip_typeN nn (fastype_of ctor_rec)
       |>> map domain_type ||> domain_type;
   in
-    define_co_rec Least_FP fpT Cs (mk_binding recN)
+    define_co_rec_as Least_FP fpT Cs (mk_binding recN)
       (fold_rev (fold_rev Term.lambda) fss (Term.list_comb (ctor_rec,
          map4 (fn ctor_rec_absT => fn rep => fn fs => fn xsss =>
              mk_case_absumprod ctor_rec_absT rep fs (map (map HOLogic.mk_tuple) xsss)
@@ -559,7 +561,7 @@
     val nn = length fpTs;
     val fpT = range_type (snd (strip_typeN nn (fastype_of dtor_corec)));
   in
-    define_co_rec Greatest_FP fpT Cs (mk_binding corecN)
+    define_co_rec_as Greatest_FP fpT Cs (mk_binding corecN)
       (fold_rev (fold_rev Term.lambda) pgss (Term.list_comb (dtor_corec,
          map5 mk_preds_getterss_join cs cpss f_absTs abss cqgsss)))
   end;