src/HOL/Tools/ATP/atp_problem_generate.ML
changeset 59582 0fbed69ff081
parent 59058 a78612c67ec0
child 59621 291934bac95e
equal deleted inserted replaced
59580:cbc38731d42f 59582:0fbed69ff081
   758                     (0 upto length Ts - 1 ~~ Ts))
   758                     (0 upto length Ts - 1 ~~ Ts))
   759 
   759 
   760 fun do_introduce_combinators ctxt Ts t =
   760 fun do_introduce_combinators ctxt Ts t =
   761   let val thy = Proof_Context.theory_of ctxt in
   761   let val thy = Proof_Context.theory_of ctxt in
   762     t |> conceal_bounds Ts
   762     t |> conceal_bounds Ts
   763       |> cterm_of thy
   763       |> Thm.cterm_of thy
   764       |> Meson_Clausify.introduce_combinators_in_cterm
   764       |> Meson_Clausify.introduce_combinators_in_cterm
   765       |> prop_of |> Logic.dest_equals |> snd
   765       |> Thm.prop_of |> Logic.dest_equals |> snd
   766       |> reveal_bounds Ts
   766       |> reveal_bounds Ts
   767   end
   767   end
   768   (* A type variable of sort "{}" will make abstraction fail. *)
   768   (* A type variable of sort "{}" will make abstraction fail. *)
   769   handle THM _ => t |> do_cheaply_conceal_lambdas Ts
   769   handle THM _ => t |> do_cheaply_conceal_lambdas Ts
   770 val introduce_combinators = simple_translate_lambdas do_introduce_combinators
   770 val introduce_combinators = simple_translate_lambdas do_introduce_combinators
  1209 
  1209 
  1210 fun presimplify_term ctxt t =
  1210 fun presimplify_term ctxt t =
  1211   if exists_Const (member (op =) Meson.presimplified_consts o fst) t then
  1211   if exists_Const (member (op =) Meson.presimplified_consts o fst) t then
  1212     t |> Skip_Proof.make_thm (Proof_Context.theory_of ctxt)
  1212     t |> Skip_Proof.make_thm (Proof_Context.theory_of ctxt)
  1213       |> Meson.presimplify ctxt
  1213       |> Meson.presimplify ctxt
  1214       |> prop_of
  1214       |> Thm.prop_of
  1215   else
  1215   else
  1216     t
  1216     t
  1217 
  1217 
  1218 fun preprocess_abstractions_in_terms trans_lams facts =
  1218 fun preprocess_abstractions_in_terms trans_lams facts =
  1219   let
  1219   let
  1748                   (helper_s <> unmangled_s andalso
  1748                   (helper_s <> unmangled_s andalso
  1749                    (not completish orelse could_specialize)) then
  1749                    (not completish orelse could_specialize)) then
  1750                  I
  1750                  I
  1751                else
  1751                else
  1752                  ths ~~ (1 upto length ths)
  1752                  ths ~~ (1 upto length ths)
  1753                  |> maps (dub_and_inst needs_sound o apfst (apsnd prop_of))
  1753                  |> maps (dub_and_inst needs_sound o apfst (apsnd Thm.prop_of))
  1754                  |> make_facts
  1754                  |> make_facts
  1755                  |> union (op = o apply2 #iformula))
  1755                  |> union (op = o apply2 #iformula))
  1756            (if completish then completish_helper_table else helper_table)
  1756            (if completish then completish_helper_table else helper_table)
  1757     end
  1757     end
  1758   | NONE => I)
  1758   | NONE => I)