remove last few dependencies on domain_library.ML and delete it; temporarily disable emptiness check
authorhuffman
Sat Oct 16 16:22:42 2010 -0700 (2010-10-16)
changeset 400268f8f18a88685
parent 40025 876689e6bbdf
child 40027 98f2d8280eb4
remove last few dependencies on domain_library.ML and delete it; temporarily disable emptiness check
src/HOLCF/Domain.thy
src/HOLCF/IsaMakefile
src/HOLCF/Tools/Domain/domain_extender.ML
src/HOLCF/Tools/Domain/domain_library.ML
src/HOLCF/Tools/Domain/domain_theorems.ML
src/HOLCF/ex/Pattern_Match.thy
     1.1 --- a/src/HOLCF/Domain.thy	Sat Oct 16 15:26:30 2010 -0700
     1.2 +++ b/src/HOLCF/Domain.thy	Sat Oct 16 16:22:42 2010 -0700
     1.3 @@ -10,7 +10,6 @@
     1.4    ("Tools/cont_consts.ML")
     1.5    ("Tools/cont_proc.ML")
     1.6    ("Tools/Domain/domain_constructors.ML")
     1.7 -  ("Tools/Domain/domain_library.ML")
     1.8    ("Tools/Domain/domain_axioms.ML")
     1.9    ("Tools/Domain/domain_theorems.ML")
    1.10    ("Tools/Domain/domain_extender.ML")
    1.11 @@ -154,7 +153,6 @@
    1.12  
    1.13  use "Tools/cont_consts.ML"
    1.14  use "Tools/cont_proc.ML"
    1.15 -use "Tools/Domain/domain_library.ML"
    1.16  use "Tools/Domain/domain_axioms.ML"
    1.17  use "Tools/Domain/domain_constructors.ML"
    1.18  use "Tools/Domain/domain_theorems.ML"
     2.1 --- a/src/HOLCF/IsaMakefile	Sat Oct 16 15:26:30 2010 -0700
     2.2 +++ b/src/HOLCF/IsaMakefile	Sat Oct 16 16:22:42 2010 -0700
     2.3 @@ -74,7 +74,6 @@
     2.4    Tools/Domain/domain_axioms.ML \
     2.5    Tools/Domain/domain_constructors.ML \
     2.6    Tools/Domain/domain_isomorphism.ML \
     2.7 -  Tools/Domain/domain_library.ML \
     2.8    Tools/Domain/domain_take_proofs.ML \
     2.9    Tools/Domain/domain_theorems.ML \
    2.10    Tools/fixrec.ML \
     3.1 --- a/src/HOLCF/Tools/Domain/domain_extender.ML	Sat Oct 16 15:26:30 2010 -0700
     3.2 +++ b/src/HOLCF/Tools/Domain/domain_extender.ML	Sat Oct 16 16:22:42 2010 -0700
     3.3 @@ -35,7 +35,15 @@
     3.4  structure Domain_Extender :> DOMAIN_EXTENDER =
     3.5  struct
     3.6  
     3.7 -open Domain_Library;
     3.8 +open HOLCF_Library;
     3.9 +
    3.10 +fun first  (x,_,_) = x;
    3.11 +fun second (_,x,_) = x;
    3.12 +fun third  (_,_,x) = x;
    3.13 +
    3.14 +fun upd_first  f (x,y,z) = (f x,   y,   z);
    3.15 +fun upd_second f (x,y,z) = (  x, f y,   z);
    3.16 +fun upd_third  f (x,y,z) = (  x,   y, f z);
    3.17  
    3.18  (* ----- general testing and preprocessing of constructor list -------------- *)
    3.19  fun check_and_sort_domain
    3.20 @@ -94,22 +102,22 @@
    3.21               | SOME typevars =>
    3.22                   if indirect 
    3.23                   then error ("Indirect recursion of type " ^ 
    3.24 -                             quote (string_of_typ thy t))
    3.25 +                             quote (Syntax.string_of_typ_global thy t))
    3.26                   else if dname <> s orelse
    3.27                           (** BUG OR FEATURE?:
    3.28                               mutual recursion may use different arguments **)
    3.29                           remove_sorts typevars = remove_sorts typl 
    3.30                   then Type(s,map (analyse true) typl)
    3.31                   else error ("Direct recursion of type " ^ 
    3.32 -                             quote (string_of_typ thy t) ^ 
    3.33 +                             quote (Syntax.string_of_typ_global thy t) ^ 
    3.34                               " with different arguments"))
    3.35 -          | analyse indirect (TVar _) = Imposs "extender:analyse";
    3.36 +          | analyse indirect (TVar _) = error "extender:analyse";
    3.37          fun check_pcpo lazy T =
    3.38              let val sort = arg_sort lazy in
    3.39                if Sign.of_sort thy (T, sort) then T
    3.40                else error ("Constructor argument type is not of sort " ^
    3.41                            Syntax.string_of_sort_global thy sort ^ ": " ^
    3.42 -                          string_of_typ thy T)
    3.43 +                          Syntax.string_of_typ_global thy T)
    3.44              end;
    3.45          fun analyse_arg (lazy, sel, T) =
    3.46              (lazy, sel, check_pcpo lazy (analyse false T));
    3.47 @@ -167,7 +175,7 @@
    3.48          check_and_sort_domain arg_sort dtnvs' cons'' tmp_thy;
    3.49      val dts : typ list = map (Type o fst) eqs';
    3.50  
    3.51 -    fun mk_arg_typ (lazy, dest_opt, T) = if lazy then mk_uT T else T;
    3.52 +    fun mk_arg_typ (lazy, dest_opt, T) = if lazy then mk_upT T else T;
    3.53      fun mk_con_typ (bind, args, mx) =
    3.54          if null args then oneT else foldr1 mk_sprodT (map mk_arg_typ args);
    3.55      fun mk_eq_typ (_, cons) = foldr1 mk_ssumT (map mk_con_typ cons);
    3.56 @@ -179,28 +187,17 @@
    3.57  
    3.58      val ((iso_infos, take_info), thy) = add_isos iso_spec thy;
    3.59  
    3.60 -    val new_dts : (string * string list) list =
    3.61 -        map (fn ((s,Ts),_) => (s, map (fst o dest_TFree) Ts)) eqs';
    3.62 -    fun one_con (con,args,mx) : cons =
    3.63 -        (Binding.name_of con,  (* FIXME preverse binding (!?) *)
    3.64 -         ListPair.map (fn ((lazy,sel,tp),vn) =>
    3.65 -           mk_arg ((lazy, Datatype_Aux.dtyp_of_typ new_dts tp), vn))
    3.66 -                      (args, Datatype_Prop.make_tnames (map third args)));
    3.67 -    val eqs : eq list =
    3.68 -        map (fn (dtnvs,cons') => (dtnvs, map one_con cons')) eqs';
    3.69 -
    3.70      val (constr_infos, thy) =
    3.71          thy
    3.72            |> fold_map (fn ((dbind, (_,cs)), info) =>
    3.73                  Domain_Constructors.add_domain_constructors dbind cs info)
    3.74               (dbinds ~~ eqs' ~~ iso_infos);
    3.75  
    3.76 -    val (take_rews, theorems_thy) =
    3.77 -        thy
    3.78 -          |> Domain_Theorems.comp_theorems (comp_dbind, eqs)
    3.79 -              dbinds take_info constr_infos;
    3.80 +    val (take_rews, thy) =
    3.81 +        Domain_Theorems.comp_theorems comp_dbind
    3.82 +          dbinds take_info constr_infos thy;
    3.83    in
    3.84 -    theorems_thy
    3.85 +    thy
    3.86    end;
    3.87  
    3.88  fun define_isos (spec : (binding * mixfix * (typ * typ)) list) =
     4.1 --- a/src/HOLCF/Tools/Domain/domain_library.ML	Sat Oct 16 15:26:30 2010 -0700
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,239 +0,0 @@
     4.4 -(*  Title:      HOLCF/Tools/Domain/domain_library.ML
     4.5 -    Author:     David von Oheimb
     4.6 -
     4.7 -Library for domain command.
     4.8 -*)
     4.9 -
    4.10 -
    4.11 -(* infix syntax *)
    4.12 -
    4.13 -infixr 5 -->;
    4.14 -infixr 6 ->>;
    4.15 -infixr 0 ===>;
    4.16 -infixr 0 ==>;
    4.17 -infix 0 ==;
    4.18 -infix 1 ===;
    4.19 -infix 1 ~=;
    4.20 -
    4.21 -infix 9 `  ;
    4.22 -infix 9 `% ;
    4.23 -infix 9 `%%;
    4.24 -
    4.25 -
    4.26 -(* ----- specific support for domain ---------------------------------------- *)
    4.27 -
    4.28 -signature DOMAIN_LIBRARY =
    4.29 -sig
    4.30 -  val first  : 'a * 'b * 'c -> 'a
    4.31 -  val second : 'a * 'b * 'c -> 'b
    4.32 -  val third  : 'a * 'b * 'c -> 'c
    4.33 -  val upd_second : ('b -> 'd) -> 'a * 'b * 'c -> 'a * 'd * 'c
    4.34 -  val upd_third  : ('c -> 'd) -> 'a * 'b * 'c -> 'a * 'b * 'd
    4.35 -  val mapn : (int -> 'a -> 'b) -> int -> 'a list -> 'b list
    4.36 -  val atomize : Proof.context -> thm -> thm list
    4.37 -
    4.38 -  val Imposs : string -> 'a;
    4.39 -  val cpo_type : theory -> typ -> bool;
    4.40 -  val pcpo_type : theory -> typ -> bool;
    4.41 -  val string_of_typ : theory -> typ -> string;
    4.42 -
    4.43 -  (* Creating HOLCF types *)
    4.44 -  val mk_ssumT : typ * typ -> typ;
    4.45 -  val mk_sprodT : typ * typ -> typ;
    4.46 -  val mk_uT : typ -> typ;
    4.47 -  val oneT : typ;
    4.48 -  val pcpoS : sort;
    4.49 -
    4.50 -  (* Creating HOLCF terms *)
    4.51 -  val %: : string -> term;
    4.52 -  val %%: : string -> term;
    4.53 -  val ` : term * term -> term;
    4.54 -  val `% : term * string -> term;
    4.55 -  val UU : term;
    4.56 -  val ID : term;
    4.57 -  val list_ccomb : term * term list -> term;
    4.58 -  val con_app2 : string -> ('a -> term) -> 'a list -> term;
    4.59 -  val prj : ('a -> 'b -> 'a) -> ('a -> 'b -> 'a) -> 'a -> 'b list -> int -> 'a
    4.60 -  val proj : term -> 'a list -> int -> term;
    4.61 -
    4.62 -  (* Creating propositions *)
    4.63 -  val mk_conj : term * term -> term;
    4.64 -  val mk_disj : term * term -> term;
    4.65 -  val mk_imp : term * term -> term;
    4.66 -  val mk_lam : string * term -> term;
    4.67 -  val mk_all : string * term -> term;
    4.68 -  val mk_ex : string * term -> term;
    4.69 -  val mk_constrainall : string * typ * term -> term;
    4.70 -  val === : term * term -> term;
    4.71 -  val defined : term -> term;
    4.72 -  val mk_adm : term -> term;
    4.73 -  val lift : ('a -> term) -> 'a list * term -> term;
    4.74 -  val lift_defined : ('a -> term) -> 'a list * term -> term;
    4.75 -
    4.76 -  (* Creating meta-propositions *)
    4.77 -  val mk_trp : term -> term; (* HOLogic.mk_Trueprop *)
    4.78 -  val == : term * term -> term;
    4.79 -  val ===> : term * term -> term;
    4.80 -  val mk_All : string * term -> term;
    4.81 -
    4.82 -      (* Domain specifications *)
    4.83 -      eqtype arg;
    4.84 -  type cons = string * arg list;
    4.85 -  type eq = (string * typ list) * cons list;
    4.86 -  val mk_arg : (bool * Datatype.dtyp) * string -> arg;
    4.87 -  val is_lazy : arg -> bool;
    4.88 -  val rec_of : arg -> int;
    4.89 -  val dtyp_of : arg -> Datatype.dtyp;
    4.90 -  val vname : arg -> string;
    4.91 -  val upd_vname : (string -> string) -> arg -> arg;
    4.92 -  val is_rec : arg -> bool;
    4.93 -  val is_nonlazy_rec : arg -> bool;
    4.94 -  val nonlazy : arg list -> string list;
    4.95 -  val nonlazy_rec : arg list -> string list;
    4.96 -  val %# : arg -> term;
    4.97 -  val bound_arg : ''a list -> ''a -> term; (* ''a = arg or string *)
    4.98 -  val idx_name : 'a list -> string -> int -> string;
    4.99 -  val con_app : string -> arg list -> term;
   4.100 -end;
   4.101 -
   4.102 -structure Domain_Library :> DOMAIN_LIBRARY =
   4.103 -struct
   4.104 -
   4.105 -fun first  (x,_,_) = x;
   4.106 -fun second (_,x,_) = x;
   4.107 -fun third  (_,_,x) = x;
   4.108 -
   4.109 -fun upd_first  f (x,y,z) = (f x,   y,   z);
   4.110 -fun upd_second f (x,y,z) = (  x, f y,   z);
   4.111 -fun upd_third  f (x,y,z) = (  x,   y, f z);
   4.112 -
   4.113 -fun mapn f n []      = []
   4.114 -  | mapn f n (x::xs) = (f n x) :: mapn f (n+1) xs;
   4.115 -
   4.116 -fun foldr'' f (l,f2) =
   4.117 -    let fun itr []  = raise Fail "foldr''" 
   4.118 -          | itr [a] = f2 a
   4.119 -          | itr (a::l) = f(a, itr l)
   4.120 -    in  itr l  end;
   4.121 -
   4.122 -fun atomize ctxt thm =
   4.123 -    let
   4.124 -      val r_inst = read_instantiate ctxt;
   4.125 -      fun at thm =
   4.126 -          case concl_of thm of
   4.127 -            _$(Const(@{const_name HOL.conj},_)$_$_)       => at(thm RS conjunct1)@at(thm RS conjunct2)
   4.128 -          | _$(Const(@{const_name All} ,_)$Abs(s,_,_))=> at(thm RS (r_inst [(("x", 0), "?" ^ s)] spec))
   4.129 -          | _                             => [thm];
   4.130 -    in map zero_var_indexes (at thm) end;
   4.131 -
   4.132 -exception Impossible of string;
   4.133 -fun Imposs msg = raise Impossible ("Domain:"^msg);
   4.134 -
   4.135 -fun cpo_type sg t = Sign.of_sort sg (Sign.certify_typ sg t, @{sort cpo});
   4.136 -fun pcpo_type sg t = Sign.of_sort sg (Sign.certify_typ sg t, @{sort pcpo});
   4.137 -fun string_of_typ sg = Syntax.string_of_typ_global sg o Sign.certify_typ sg;
   4.138 -
   4.139 -(* ----- constructor list handling ----- *)
   4.140 -
   4.141 -type arg =
   4.142 -     (bool * Datatype.dtyp) *   (*  (lazy, recursive element) *)
   4.143 -     string;                       (*   argument name    *)
   4.144 -
   4.145 -type cons =
   4.146 -     string *         (* operator name of constr *)
   4.147 -     arg list;        (* argument list      *)
   4.148 -
   4.149 -type eq =
   4.150 -     (string *        (* name      of abstracted type *)
   4.151 -      typ list) *     (* arguments of abstracted type *)
   4.152 -     cons list;       (* represented type, as a constructor list *)
   4.153 -
   4.154 -val mk_arg = I;
   4.155 -
   4.156 -fun rec_of ((_,dtyp),_) =
   4.157 -    case dtyp of Datatype_Aux.DtRec i => i | _ => ~1;
   4.158 -(* FIXME: what about indirect recursion? *)
   4.159 -
   4.160 -fun is_lazy arg = fst (fst arg);
   4.161 -fun dtyp_of arg = snd (fst arg);
   4.162 -val     vname =       snd;
   4.163 -val upd_vname =   apsnd;
   4.164 -fun is_rec         arg = rec_of arg >=0;
   4.165 -fun is_nonlazy_rec arg = is_rec arg andalso not (is_lazy arg);
   4.166 -fun nonlazy     args   = map vname (filter_out is_lazy args);
   4.167 -fun nonlazy_rec args   = map vname (filter is_nonlazy_rec args);
   4.168 -
   4.169 -
   4.170 -(* ----- support for type and mixfix expressions ----- *)
   4.171 -
   4.172 -fun mk_uT T = Type(@{type_name "u"}, [T]);
   4.173 -fun mk_sprodT (T, U) = Type(@{type_name sprod}, [T, U]);
   4.174 -fun mk_ssumT (T, U) = Type(@{type_name ssum}, [T, U]);
   4.175 -val oneT = @{typ one};
   4.176 -
   4.177 -(* ----- support for term expressions ----- *)
   4.178 -
   4.179 -fun %: s = Free(s,dummyT);
   4.180 -fun %# arg = %:(vname arg);
   4.181 -fun %%: s = Const(s,dummyT);
   4.182 -
   4.183 -local open HOLogic in
   4.184 -val mk_trp = mk_Trueprop;
   4.185 -fun mk_conj (S,T) = conj $ S $ T;
   4.186 -fun mk_disj (S,T) = disj $ S $ T;
   4.187 -fun mk_imp  (S,T) = imp  $ S $ T;
   4.188 -fun mk_lam  (x,T) = Abs(x,dummyT,T);
   4.189 -fun mk_all  (x,P) = HOLogic.mk_all (x,dummyT,P);
   4.190 -fun mk_ex   (x,P) = mk_exists (x,dummyT,P);
   4.191 -fun mk_constrainall (x,typ,P) = %%: @{const_name All} $ (Type.constraint (typ --> boolT) (mk_lam(x,P)));
   4.192 -end
   4.193 -
   4.194 -fun mk_All  (x,P) = %%:"all" $ mk_lam(x,P); (* meta universal quantification *)
   4.195 -
   4.196 -infixr 0 ===>;  fun S ===> T = %%: "==>" $ S $ T;
   4.197 -infix 0 ==;     fun S ==  T = %%: "==" $ S $ T;
   4.198 -infix 1 ===;    fun S === T = %%: @{const_name HOL.eq} $ S $ T;
   4.199 -infix 1 ~=;     fun S ~=  T = HOLogic.mk_not (S === T);
   4.200 -
   4.201 -infix 9 `  ; fun f ` x = %%: @{const_name Rep_CFun} $ f $ x;
   4.202 -infix 9 `% ; fun f`% s = f` %: s;
   4.203 -infix 9 `%%; fun f`%%s = f` %%:s;
   4.204 -
   4.205 -fun mk_adm t = %%: @{const_name adm} $ t;
   4.206 -val ID = %%: @{const_name ID};
   4.207 -fun mk_strictify t = %%: @{const_name strictify}`t;
   4.208 -fun mk_ssplit t = %%: @{const_name ssplit}`t;
   4.209 -fun mk_sscase (x, y) = %%: @{const_name sscase}`x`y;
   4.210 -fun mk_fup (t,u) = %%: @{const_name fup} ` t ` u;
   4.211 -
   4.212 -val pcpoS = @{sort pcpo};
   4.213 -
   4.214 -val list_ccomb = Library.foldl (op `); (* continuous version of list_comb *)
   4.215 -fun con_app2 con f args = list_ccomb(%%:con,map f args);
   4.216 -fun con_app con = con_app2 con %#;
   4.217 -fun prj _  _  x (   _::[]) _ = x
   4.218 -  | prj _  _  _ []         _ = raise Fail "Domain_Library.prj: empty list"
   4.219 -  | prj f1 _  x (_::y::ys) 0 = f1 x y
   4.220 -  | prj f1 f2 x (y::   ys) j = prj f1 f2 (f2 x y) ys (j-1);
   4.221 -fun proj x = prj (fn S => K (%%: @{const_name fst} $ S)) (fn S => K (%%: @{const_name snd} $ S)) x;
   4.222 -fun lift tfn = Library.foldr (fn (x,t)=> (mk_trp(tfn x) ===> t));
   4.223 -
   4.224 -val UU = %%: @{const_name UU};
   4.225 -fun defined t = t ~= UU;
   4.226 -fun cpair (t,u) = %%: @{const_name Pair} $ t $ u;
   4.227 -fun spair (t,u) = %%: @{const_name spair}`t`u;
   4.228 -fun lift_defined f = lift (fn x => defined (f x));
   4.229 -fun bound_arg vns v = Bound (length vns - find_index (fn v' => v' = v) vns - 1);
   4.230 -
   4.231 -fun cont_eta_contract (Const("Cfun.Abs_CFun",TT) $ Abs(a,T,body)) = 
   4.232 -    (case cont_eta_contract body  of
   4.233 -       body' as (Const("Cfun.Rep_CFun",Ta) $ f $ Bound 0) => 
   4.234 -       if not (member (op =) (loose_bnos f) 0) then incr_boundvars ~1 f 
   4.235 -       else   Const("Cfun.Abs_CFun",TT) $ Abs(a,T,body')
   4.236 -     | body' => Const("Cfun.Abs_CFun",TT) $ Abs(a,T,body'))
   4.237 -  | cont_eta_contract(f$t) = cont_eta_contract f $ cont_eta_contract t
   4.238 -  | cont_eta_contract t    = t;
   4.239 -
   4.240 -fun idx_name dnames s n = s^(if length dnames = 1 then "" else string_of_int n);
   4.241 -
   4.242 -end; (* struct *)
     5.1 --- a/src/HOLCF/Tools/Domain/domain_theorems.ML	Sat Oct 16 15:26:30 2010 -0700
     5.2 +++ b/src/HOLCF/Tools/Domain/domain_theorems.ML	Sat Oct 16 16:22:42 2010 -0700
     5.3 @@ -10,8 +10,7 @@
     5.4  signature DOMAIN_THEOREMS =
     5.5  sig
     5.6    val comp_theorems :
     5.7 -      binding * Domain_Library.eq list ->
     5.8 -      binding list ->
     5.9 +      binding -> binding list ->
    5.10        Domain_Take_Proofs.take_induct_info ->
    5.11        Domain_Constructors.constr_info list ->
    5.12        theory -> thm list * theory
    5.13 @@ -154,7 +153,7 @@
    5.14      (take_rews : thm list)
    5.15      (thy : theory) =
    5.16  let
    5.17 -  val comp_dname = Sign.full_name thy comp_dbind;
    5.18 +  val comp_dname = Binding.name_of comp_dbind;
    5.19  
    5.20    val iso_infos = map #iso_info constr_infos;
    5.21    val exhausts = map #exhaust constr_infos;
    5.22 @@ -281,15 +280,15 @@
    5.23  
    5.24    val inducts = Project_Rule.projections (ProofContext.init_global thy) ind;
    5.25    fun ind_rule (dname, rule) =
    5.26 -      ((Binding.empty, [rule]),
    5.27 +      ((Binding.empty, rule),
    5.28         [Rule_Cases.case_names case_ns, Induct.induct_type dname]);
    5.29  
    5.30  in
    5.31    thy
    5.32 -  |> snd o Global_Theory.add_thmss [
    5.33 -     ((Binding.qualified true "finite_induct" comp_dbind, [finite_ind]), []),
    5.34 -     ((Binding.qualified true "induct"        comp_dbind, [ind]       ), [])]
    5.35 -  |> (snd o Global_Theory.add_thmss (map ind_rule (dnames ~~ inducts)))
    5.36 +  |> snd o Global_Theory.add_thms [
    5.37 +     ((Binding.qualified true "finite_induct" comp_dbind, finite_ind), []),
    5.38 +     ((Binding.qualified true "induct"        comp_dbind, ind       ), [])]
    5.39 +  |> (snd o Global_Theory.add_thms (map ind_rule (dnames ~~ inducts)))
    5.40  end; (* prove_induction *)
    5.41  
    5.42  (******************************************************************************)
    5.43 @@ -303,8 +302,6 @@
    5.44      (take_rews : thm list list)
    5.45      (thy : theory) : theory =
    5.46  let
    5.47 -  val comp_dname = Sign.full_name thy comp_dbind;
    5.48 -
    5.49    val iso_infos = map #iso_info constr_infos;
    5.50    val newTs = map #absT iso_infos;
    5.51  
    5.52 @@ -423,18 +420,19 @@
    5.53  (******************************************************************************)
    5.54  
    5.55  fun comp_theorems
    5.56 -    (comp_dbind : binding, eqs : Domain_Library.eq list)
    5.57 +    (comp_dbind : binding)
    5.58      (dbinds : binding list)
    5.59      (take_info : Domain_Take_Proofs.take_induct_info)
    5.60      (constr_infos : Domain_Constructors.constr_info list)
    5.61      (thy : theory) =
    5.62  let
    5.63 -val dnames = map (fst o fst) eqs;
    5.64 -val comp_dname = Sign.full_name thy comp_dbind;
    5.65 +val comp_dname = Binding.name_of comp_dbind;
    5.66  
    5.67  (* Test for emptiness *)
    5.68 +(* FIXME: reimplement emptiness test
    5.69  local
    5.70    open Domain_Library;
    5.71 +  val dnames = map (fst o fst) eqs;
    5.72    val conss = map snd eqs;
    5.73    fun rec_to ns lazy_rec (n,cons) = forall (exists (fn arg => 
    5.74          is_rec arg andalso not (member (op =) ns (rec_of arg)) andalso
    5.75 @@ -450,16 +448,19 @@
    5.76    val n__eqs = mapn (fn n => fn (_,cons) => (n,cons)) 0 eqs;
    5.77    val is_emptys = map warn n__eqs;
    5.78  end;
    5.79 +*)
    5.80  
    5.81  (* Test for indirect recursion *)
    5.82  local
    5.83 -  open Domain_Library;
    5.84 -  fun indirect_arg arg =
    5.85 -      rec_of arg = ~1 andalso Datatype_Aux.is_rec_type (dtyp_of arg);
    5.86 +  val newTs = map (#absT o #iso_info) constr_infos;
    5.87 +  fun indirect_typ (Type (_, Ts)) =
    5.88 +      exists (fn T => member (op =) newTs T orelse indirect_typ T) Ts
    5.89 +    | indirect_typ _ = false;
    5.90 +  fun indirect_arg (_, T) = indirect_typ T;
    5.91    fun indirect_con (_, args) = exists indirect_arg args;
    5.92 -  fun indirect_eq (_, cons) = exists indirect_con cons;
    5.93 +  fun indirect_eq cons = exists indirect_con cons;
    5.94  in
    5.95 -  val is_indirect = exists indirect_eq eqs;
    5.96 +  val is_indirect = exists indirect_eq (map #con_specs constr_infos);
    5.97    val _ =
    5.98        if is_indirect
    5.99        then message "Indirect recursion detected, skipping proofs of (co)induction rules"
     6.1 --- a/src/HOLCF/ex/Pattern_Match.thy	Sat Oct 16 15:26:30 2010 -0700
     6.2 +++ b/src/HOLCF/ex/Pattern_Match.thy	Sat Oct 16 16:22:42 2010 -0700
     6.3 @@ -359,6 +359,9 @@
     6.4  ML {*
     6.5  local open HOLCF_Library in
     6.6  
     6.7 +infixr 6 ->>;
     6.8 +infix 9 ` ;
     6.9 +
    6.10  val beta_rules =
    6.11    @{thms beta_cfun cont_id cont_const cont2cont_Rep_CFun cont2cont_LAM'} @
    6.12    @{thms cont2cont_fst cont2cont_snd cont2cont_Pair};