src/HOLCF/Tools/Domain/domain_axioms.ML
changeset 35460 8cb42aa19358
parent 35446 b719dad322fa
child 35462 f5461b02d754
equal deleted inserted replaced
35459:3d8acfae6fb8 35460:8cb42aa19358
    75       let fun r i = proj (Bound 0) eqs i;
    75       let fun r i = proj (Bound 0) eqs i;
    76       in
    76       in
    77         ("copy_def", %%:(dname^"_copy") == /\ "f"
    77         ("copy_def", %%:(dname^"_copy") == /\ "f"
    78           (dc_abs oo (copy_of_dtyp map_tab r (dtyp_of_eq eqn)) oo dc_rep))
    78           (dc_abs oo (copy_of_dtyp map_tab r (dtyp_of_eq eqn)) oo dc_rep))
    79       end;
    79       end;
    80 
       
    81 (* -- definitions concerning the discriminators - *)
       
    82 
       
    83     val dis_defs = let
       
    84       fun ddef (con,_,_) = (dis_name con ^"_def",%%:(dis_name con) == 
       
    85                                               list_ccomb(%%:(dname^"_when"),map 
       
    86                                                                               (fn (con',_,args) => (List.foldr /\#
       
    87       (if con'=con then TT else FF) args)) cons))
       
    88     in map ddef cons end;
       
    89 
    80 
    90     val mat_defs =
    81     val mat_defs =
    91       let
    82       let
    92         fun mdef (con, _, _) =
    83         fun mdef (con, _, _) =
    93           let
    84           let
   132                    mk_ex("n",(%%:(dname^"_take") $ Bound 0)`Bound 1 === Bound 1)));
   123                    mk_ex("n",(%%:(dname^"_take") $ Bound 0)`Bound 1 === Bound 1)));
   133 
   124 
   134   in (dnam,
   125   in (dnam,
   135       (if definitional then [] else [abs_iso_ax, rep_iso_ax, reach_ax]),
   126       (if definitional then [] else [abs_iso_ax, rep_iso_ax, reach_ax]),
   136       (if definitional then [when_def] else [when_def, copy_def]) @
   127       (if definitional then [when_def] else [when_def, copy_def]) @
   137       dis_defs @ mat_defs @ pat_defs @
   128       mat_defs @ pat_defs @
   138       [take_def, finite_def])
   129       [take_def, finite_def])
   139   end; (* let (calc_axioms) *)
   130   end; (* let (calc_axioms) *)
   140 
   131 
   141 
   132 
   142 (* legacy type inference *)
   133 (* legacy type inference *)