# HG changeset patch # User wenzelm # Date 1127948341 -7200 # Node ID 6c6ecafd8c0ea661e27a4322f0ca379429b61515 # Parent bc0270e9d27f193f495ff70c1dc3fde98b4f2196 abstract_rule: tuned exception msgs; diff -r bc0270e9d27f -r 6c6ecafd8c0e src/Pure/thm.ML --- a/src/Pure/thm.ML Thu Sep 29 00:59:00 2005 +0200 +++ b/src/Pure/thm.ML Thu Sep 29 00:59:01 2005 +0200 @@ -396,7 +396,7 @@ (*attributes subsume any kind of rules or context modifiers*) type 'a attribute = 'a * thm -> 'a * thm; - + fun no_attributes x = (x, []); fun simple_fact x = [(x, [])]; fun apply_attributes (x_th, atts) = Library.apply atts x_th; @@ -814,6 +814,7 @@ (Cterm {t = x, T, sorts, ...}) (th as Thm {thy_ref, der, maxidx, hyps, shyps, tpairs, prop}) = let + val string_of = Sign.string_of_term (Theory.deref thy_ref); val (t, u) = Logic.dest_equals prop handle TERM _ => raise THM ("abstract_rule: premise not an equality", 0, [th]); val result = @@ -827,13 +828,13 @@ (Abs (a, T, abstract_over (x, t)), Abs (a, T, abstract_over (x, u)))}; fun check_occs x ts = if exists (fn t => Logic.occs (x, t)) ts then - raise THM ("abstract_rule: variable free in assumptions", 0, [th]) + raise THM ("abstract_rule: variable free in assumptions " ^ string_of x, 0, [th]) else (); in case x of Free _ => (check_occs x hyps; check_occs x (terms_of_tpairs tpairs); result) | Var _ => (check_occs x (terms_of_tpairs tpairs); result) - | _ => raise THM ("abstract_rule: not a variable", 0, [th]) + | _ => raise THM ("abstract_rule: not a variable " ^ string_of x, 0, [th]) end; (*The combination rule