270 fun ext_inst_subclass prep_classrel raw_cc tac thy = |
270 fun ext_inst_subclass prep_classrel raw_cc tac thy = |
271 let |
271 let |
272 val (c1, c2) = prep_classrel thy raw_cc; |
272 val (c1, c2) = prep_classrel thy raw_cc; |
273 val txt = quote (Sign.string_of_classrel thy [c1, c2]); |
273 val txt = quote (Sign.string_of_classrel thy [c1, c2]); |
274 val _ = message ("Proving class inclusion " ^ txt ^ " ..."); |
274 val _ = message ("Proving class inclusion " ^ txt ^ " ..."); |
275 val th = Tactic.prove thy [] [] (mk_classrel (c1, c2)) (K tac) handle ERROR => |
275 val th = Goal.prove thy [] [] (mk_classrel (c1, c2)) (K tac) handle ERROR_MESSAGE msg => |
276 error ("The error(s) above occurred while trying to prove " ^ txt); |
276 error (msg ^ "\nThe error(s) above occurred while trying to prove " ^ txt); |
277 in add_classrel_thms [th] thy end; |
277 in add_classrel_thms [th] thy end; |
278 |
278 |
279 fun ext_inst_arity prep_arity raw_arity tac thy = |
279 fun ext_inst_arity prep_arity raw_arity tac thy = |
280 let |
280 let |
281 val arity = prep_arity thy raw_arity; |
281 val arity = prep_arity thy raw_arity; |
282 val txt = quote (Sign.string_of_arity thy arity); |
282 val txt = quote (Sign.string_of_arity thy arity); |
283 val _ = message ("Proving type arity " ^ txt ^ " ..."); |
283 val _ = message ("Proving type arity " ^ txt ^ " ..."); |
284 val props = (mk_arities arity); |
284 val props = (mk_arities arity); |
285 val ths = Tactic.prove_multi thy [] [] props |
285 val ths = Goal.prove_multi thy [] [] props |
286 (fn _ => Tactic.smart_conjunction_tac (length props) THEN tac) |
286 (fn _ => Tactic.smart_conjunction_tac (length props) THEN tac) handle ERROR_MESSAGE msg => |
287 handle ERROR => error ("The error(s) above occurred while trying to prove " ^ txt); |
287 error (msg ^ "\nThe error(s) above occurred while trying to prove " ^ txt); |
288 in add_arity_thms ths thy end; |
288 in add_arity_thms ths thy end; |
289 |
289 |
290 in |
290 in |
291 |
291 |
292 val add_inst_subclass = ext_inst_subclass read_classrel; |
292 val add_inst_subclass = ext_inst_subclass read_classrel; |