src/HOL/Tools/primrec_package.ML
changeset 5303 22029546d109
parent 5216 f0a66af5f2cb
child 5553 ae42b36a50c2
equal deleted inserted replaced
5302:b8598e4fb73e 5303:22029546d109
   219       Theory.add_path (if_none alt_name (space_implode "_"
   219       Theory.add_path (if_none alt_name (space_implode "_"
   220         (map (Sign.base_name o #1) defs))) |>
   220         (map (Sign.base_name o #1) defs))) |>
   221       (if eq_set (names1, names2) then Theory.add_defs_i defs'
   221       (if eq_set (names1, names2) then Theory.add_defs_i defs'
   222        else primrec_err ("functions " ^ commas names2 ^
   222        else primrec_err ("functions " ^ commas names2 ^
   223          "\nare not mutually recursive"));
   223          "\nare not mutually recursive"));
   224     val rewrites = (map mk_meta_eq rec_rewrites) @ (map (get_axiom thy' o fst) defs');
   224     val rewrites = (map meta_eq rec_rewrites) @ (map (get_axiom thy' o fst) defs');
   225     val _ = writeln ("Proving equations for primrec function(s)\n" ^
   225     val _ = writeln ("Proving equations for primrec function(s)\n" ^
   226       commas names1 ^ " ...");
   226       commas names1 ^ " ...");
   227     val char_thms = map (fn t => prove_goalw_cterm rewrites (cterm_of (sign_of thy') t)
   227     val char_thms = map (fn t => prove_goalw_cterm rewrites (cterm_of (sign_of thy') t)
   228         (fn _ => [rtac refl 1])) eqns;
   228         (fn _ => [rtac refl 1])) eqns;
   229     val tsimps = map Attribute.tthm_of char_thms;
   229     val tsimps = map Attribute.tthm_of char_thms;