src/HOL/Codatatype/Tools/bnf_def.ML
changeset 49111 9d511132394e
parent 49109 0e5b859e1c91
child 49123 263b0e330d8b
equal deleted inserted replaced
49110:2e43fb45b91b 49111:9d511132394e
  1178       Skip_Proof.prove lthy [] [] wit_goal wits_tac
  1178       Skip_Proof.prove lthy [] [] wit_goal wits_tac
  1179       |> Conjunction.elim_balanced (length wit_goals)
  1179       |> Conjunction.elim_balanced (length wit_goals)
  1180       |> map2 (Conjunction.elim_balanced o length) wit_goalss
  1180       |> map2 (Conjunction.elim_balanced o length) wit_goalss
  1181       |> map (map (Thm.close_derivation o Thm.forall_elim_vars 0))
  1181       |> map (map (Thm.close_derivation o Thm.forall_elim_vars 0))
  1182   in
  1182   in
  1183     (map2 (Thm.close_derivation oo Skip_Proof.prove lthy [] [])
  1183     map2 (Thm.close_derivation oo Skip_Proof.prove lthy [] [])
  1184       goals (map (unfold_defs_tac lthy defs) tacs))
  1184       goals (map (unfold_defs_tac lthy defs) tacs)
  1185     |> (fn thms => after_qed (map single thms @ wit_thms) lthy)
  1185     |> (fn thms => after_qed (map single thms @ wit_thms) lthy)
  1186   end) oo prepare_def const_policy fact_policy qualify
  1186   end) oo prepare_def const_policy fact_policy qualify
  1187   (fn ctxt => singleton (Type_Infer_Context.infer_types ctxt)) Ds;
  1187   (singleton o Type_Infer_Context.infer_types) Ds;
  1188 
  1188 
  1189 val bnf_def_cmd = (fn (goals, wit_goals, after_qed, lthy, defs) =>
  1189 val bnf_def_cmd = (fn (goals, wit_goals, after_qed, lthy, defs) =>
  1190   Proof.unfolding ([[(defs, [])]])
  1190   Proof.unfolding ([[(defs, [])]])
  1191     (Proof.theorem NONE (snd oo after_qed)
  1191     (Proof.theorem NONE (snd oo after_qed)
  1192       (map (single o rpair []) goals @ map (map (rpair [])) wit_goals) lthy)) oo
  1192       (map (single o rpair []) goals @ map (map (rpair [])) wit_goals) lthy)) oo