src/HOLCF/Tools/Domain/domain_theorems.ML
changeset 32952 aeb1e44fbc19
parent 32740 9dd0a2f83429
child 32957 675c0c7e6a37
equal deleted inserted replaced
32951:83392f9d303f 32952:aeb1e44fbc19
   147   val axs_pat_def = map (get_def pat_name) cons;
   147   val axs_pat_def = map (get_def pat_name) cons;
   148   val axs_sel_def =
   148   val axs_sel_def =
   149     let
   149     let
   150       fun def_of_sel sel = ga (sel^"_def") dname;
   150       fun def_of_sel sel = ga (sel^"_def") dname;
   151       fun def_of_arg arg = Option.map def_of_sel (sel_of arg);
   151       fun def_of_arg arg = Option.map def_of_sel (sel_of arg);
   152       fun defs_of_con (_, args) = List.mapPartial def_of_arg args;
   152       fun defs_of_con (_, args) = map_filter def_of_arg args;
   153     in
   153     in
   154       maps defs_of_con cons
   154       maps defs_of_con cons
   155     end;
   155     end;
   156   val ax_copy_def = ga "copy_def" dname;
   156   val ax_copy_def = ga "copy_def" dname;
   157 end; (* local *)
   157 end; (* local *)
   432   fun one_sel sel =
   432   fun one_sel sel =
   433     pg axs_sel_def (mk_trp (strict (%%:sel)))
   433     pg axs_sel_def (mk_trp (strict (%%:sel)))
   434       (K [simp_tac (HOLCF_ss addsimps when_rews) 1]);
   434       (K [simp_tac (HOLCF_ss addsimps when_rews) 1]);
   435 
   435 
   436   fun sel_strict (_, args) =
   436   fun sel_strict (_, args) =
   437     List.mapPartial (Option.map one_sel o sel_of) args;
   437     map_filter (Option.map one_sel o sel_of) args;
   438 in
   438 in
   439   val _ = trace " Proving sel_stricts...";
   439   val _ = trace " Proving sel_stricts...";
   440   val sel_stricts = maps sel_strict cons;
   440   val sel_stricts = maps sel_strict cons;
   441 end;
   441 end;
   442 
   442 
   490     in pg [] goal (K tacs) end;
   490     in pg [] goal (K tacs) end;
   491 in
   491 in
   492   val _ = trace " Proving sel_defins...";
   492   val _ = trace " Proving sel_defins...";
   493   val sel_defins =
   493   val sel_defins =
   494     if length cons = 1
   494     if length cons = 1
   495     then List.mapPartial (fn arg => Option.map sel_defin (sel_of arg))
   495     then map_filter (fn arg => Option.map sel_defin (sel_of arg))
   496                  (filter_out is_lazy (snd (hd cons)))
   496                  (filter_out is_lazy (snd (hd cons)))
   497     else [];
   497     else [];
   498 end;
   498 end;
   499 
   499 
   500 val sel_rews = sel_stricts @ sel_defins @ sel_apps;
   500 val sel_rews = sel_stricts @ sel_defins @ sel_apps;