src/HOL/Tools/res_axioms.ML
changeset 27865 27a8ad9612a3
parent 27809 a1e409db516b
child 28110 9d121b171a0a
equal deleted inserted replaced
27864:827730aea9e8 27865:27a8ad9612a3
   325   case head_of (concl_of th) of
   325   case head_of (concl_of th) of
   326       Const (a,_) => (a <> "Trueprop" andalso a <> "==")
   326       Const (a,_) => (a <> "Trueprop" andalso a <> "==")
   327     | _ => false;
   327     | _ => false;
   328 
   328 
   329 fun bad_for_atp th =
   329 fun bad_for_atp th =
   330   PureThy.is_internal th
   330   Thm.is_internal th
   331   orelse too_complex (prop_of th)
   331   orelse too_complex (prop_of th)
   332   orelse exists_type type_has_empty_sort (prop_of th)
   332   orelse exists_type type_has_empty_sort (prop_of th)
   333   orelse is_strange_thm th;
   333   orelse is_strange_thm th;
   334 
   334 
   335 val multi_base_blacklist =
   335 val multi_base_blacklist =
   338 
   338 
   339 (*Keep the full complexity of the original name*)
   339 (*Keep the full complexity of the original name*)
   340 fun flatten_name s = space_implode "_X" (NameSpace.explode s);
   340 fun flatten_name s = space_implode "_X" (NameSpace.explode s);
   341 
   341 
   342 fun fake_name th =
   342 fun fake_name th =
   343   if PureThy.has_name_hint th then flatten_name (PureThy.get_name_hint th)
   343   if Thm.has_name_hint th then flatten_name (Thm.get_name_hint th)
   344   else gensym "unknown_thm_";
   344   else gensym "unknown_thm_";
   345 
   345 
   346 fun name_or_string th =
   346 fun name_or_string th =
   347   if PureThy.has_name_hint th then PureThy.get_name_hint th
   347   if Thm.has_name_hint th then Thm.get_name_hint th
   348   else Display.string_of_thm th;
   348   else Display.string_of_thm th;
   349 
   349 
   350 (*Skolemize a named theorem, with Skolem functions as additional premises.*)
   350 (*Skolemize a named theorem, with Skolem functions as additional premises.*)
   351 fun skolem_thm (s, th) =
   351 fun skolem_thm (s, th) =
   352   if member (op =) multi_base_blacklist (Sign.base_name s) orelse bad_for_atp th then []
   352   if member (op =) multi_base_blacklist (Sign.base_name s) orelse bad_for_atp th then []
   402   end;
   402   end;
   403 
   403 
   404 
   404 
   405 (**** Extract and Clausify theorems from a theory's claset and simpset ****)
   405 (**** Extract and Clausify theorems from a theory's claset and simpset ****)
   406 
   406 
   407 fun pairname th = (PureThy.get_name_hint th, th);
   407 fun pairname th = (Thm.get_name_hint th, th);
   408 
   408 
   409 fun rules_of_claset cs =
   409 fun rules_of_claset cs =
   410   let val {safeIs,safeEs,hazIs,hazEs,...} = rep_cs cs
   410   let val {safeIs,safeEs,hazIs,hazEs,...} = rep_cs cs
   411       val intros = safeIs @ hazIs
   411       val intros = safeIs @ hazIs
   412       val elims  = map Classical.classical_rule (safeEs @ hazEs)
   412       val elims  = map Classical.classical_rule (safeEs @ hazEs)