src/ZF/Tools/primrec_package.ML
changeset 70474 235396695401
parent 69593 3dda49e08b9d
child 71081 45a1fcee14a0
equal deleted inserted replaced
70473:9179e7a98196 70474:235396695401
   170 
   170 
   171     val ([def_thm], thy1) = thy
   171     val ([def_thm], thy1) = thy
   172       |> Sign.add_path (Long_Name.base_name fname)
   172       |> Sign.add_path (Long_Name.base_name fname)
   173       |> Global_Theory.add_defs false [Thm.no_attributes (apfst Binding.name def)];
   173       |> Global_Theory.add_defs false [Thm.no_attributes (apfst Binding.name def)];
   174 
   174 
   175     val rewrites = def_thm :: map mk_meta_eq (#rec_rewrites con_info)
   175     val rewrites = def_thm :: map (mk_meta_eq o Thm.transfer thy1) (#rec_rewrites con_info)
   176     val eqn_thms =
   176     val eqn_thms =
   177       eqn_terms |> map (fn t =>
   177       eqn_terms |> map (fn t =>
   178         Goal.prove_global thy1 [] [] (Ind_Syntax.traceIt "next primrec equation = " thy1 t)
   178         Goal.prove_global thy1 [] [] (Ind_Syntax.traceIt "next primrec equation = " thy1 t)
   179           (fn {context = ctxt, ...} =>
   179           (fn {context = ctxt, ...} =>
   180             EVERY [rewrite_goals_tac ctxt rewrites, resolve_tac ctxt @{thms refl} 1]));
   180             EVERY [rewrite_goals_tac ctxt rewrites, resolve_tac ctxt @{thms refl} 1]));