src/HOL/Tools/ATP/atp_problem_generate.ML
changeset 47151 eaf0ffea11aa
parent 47150 6df6e56fd7cd
child 47153 4d4f2721b3ef
equal deleted inserted replaced
47150:6df6e56fd7cd 47151:eaf0ffea11aa
  1197       | Const (@{const_name HOL.eq}, Type (_, [@{typ bool}, _])) $ t1 $ t2 =>
  1197       | Const (@{const_name HOL.eq}, Type (_, [@{typ bool}, _])) $ t1 $ t2 =>
  1198         if eq_as_iff then do_conn bs AIff NONE t1 NONE t2 else do_term bs t
  1198         if eq_as_iff then do_conn bs AIff NONE t1 NONE t2 else do_term bs t
  1199       | _ => do_term bs t
  1199       | _ => do_term bs t
  1200   in do_formula [] end
  1200   in do_formula [] end
  1201 
  1201 
  1202 fun presimplify_term ctxt t =
  1202 fun presimplify_term thy t =
  1203   t |> exists_Const (member (op =) Meson.presimplified_consts o fst) t
  1203   if exists_Const (member (op =) Meson.presimplified_consts o fst) t then
  1204        ? (Skip_Proof.make_thm (Proof_Context.theory_of ctxt)
  1204     t |> Skip_Proof.make_thm thy
  1205           #> Meson.presimplify
  1205       |> Meson.presimplify
  1206           #> prop_of)
  1206       |> prop_of
       
  1207   else
       
  1208     t
  1207 
  1209 
  1208 fun is_fun_equality (@{const_name HOL.eq},
  1210 fun is_fun_equality (@{const_name HOL.eq},
  1209                      Type (_, [Type (@{type_name fun}, _), _])) = true
  1211                      Type (_, [Type (@{type_name fun}, _), _])) = true
  1210   | is_fun_equality _ = false
  1212   | is_fun_equality _ = false
  1211 
  1213 
  1250                |> Object_Logic.atomize_term thy
  1252                |> Object_Logic.atomize_term thy
  1251      val need_trueprop = (fastype_of t = @{typ bool})
  1253      val need_trueprop = (fastype_of t = @{typ bool})
  1252    in
  1254    in
  1253      t |> need_trueprop ? HOLogic.mk_Trueprop
  1255      t |> need_trueprop ? HOLogic.mk_Trueprop
  1254        |> extensionalize_term ctxt
  1256        |> extensionalize_term ctxt
  1255        |> presimplify_term ctxt
  1257        |> presimplify_term thy
  1256        |> HOLogic.dest_Trueprop
  1258        |> HOLogic.dest_Trueprop
  1257    end
  1259    end
  1258    handle TERM _ => default_formula role)
  1260    handle TERM _ => default_formula role)
  1259   |> pair role
  1261   |> pair role
  1260 
  1262