src/HOLCF/Tools/fixrec_package.ML
changeset 28999 abe0f11cfa4e
parent 28965 1de908189869
child 29581 b3b33e0298eb
equal deleted inserted replaced
28998:ce378dcfddab 28999:abe0f11cfa4e
   224   let
   224   let
   225     val eqns = List.concat blocks;
   225     val eqns = List.concat blocks;
   226     val lengths = map length blocks;
   226     val lengths = map length blocks;
   227     
   227     
   228     val ((bindings, srcss), strings) = apfst split_list (split_list eqns);
   228     val ((bindings, srcss), strings) = apfst split_list (split_list eqns);
   229     val names = map Name.name_of bindings;
   229     val names = map Binding.base_name bindings;
   230     val atts = map (map (prep_attrib thy)) srcss;
   230     val atts = map (map (prep_attrib thy)) srcss;
   231     val eqn_ts = map (prep_prop thy) strings;
   231     val eqn_ts = map (prep_prop thy) strings;
   232     val rec_ts = map (fn eq => chead_of (fst (dest_eqs (Logic.strip_imp_concl eq)))
   232     val rec_ts = map (fn eq => chead_of (fst (dest_eqs (Logic.strip_imp_concl eq)))
   233       handle TERM _ => fixrec_eq_err thy "not a proper equation" eq) eqn_ts;
   233       handle TERM _ => fixrec_eq_err thy "not a proper equation" eq) eqn_ts;
   234     val (_, eqn_ts') = OldPrimrecPackage.unify_consts thy rec_ts eqn_ts;
   234     val (_, eqn_ts') = OldPrimrecPackage.unify_consts thy rec_ts eqn_ts;
   276   let
   276   let
   277     val atts = map (prep_attrib thy) srcs;
   277     val atts = map (prep_attrib thy) srcs;
   278     val ts = map (prep_term thy) strings;
   278     val ts = map (prep_term thy) strings;
   279     val simps = map (fix_pat thy) ts;
   279     val simps = map (fix_pat thy) ts;
   280   in
   280   in
   281     (snd o PureThy.add_thmss [((Name.name_of name, simps), atts)]) thy
   281     (snd o PureThy.add_thmss [((Binding.base_name name, simps), atts)]) thy
   282   end;
   282   end;
   283 
   283 
   284 val add_fixpat = gen_add_fixpat Syntax.read_term_global Attrib.attribute;
   284 val add_fixpat = gen_add_fixpat Syntax.read_term_global Attrib.attribute;
   285 val add_fixpat_i = gen_add_fixpat Sign.cert_term (K I);
   285 val add_fixpat_i = gen_add_fixpat Sign.cert_term (K I);
   286 
   286