src/HOL/Tools/ATP/atp_problem_generate.ML
changeset 56254 a2dd9200854d
parent 56245 84fc7dfa3cd4
child 56636 bb8b37480d3f
equal deleted inserted replaced
56253:83b3c110f22d 56254:a2dd9200854d
   432                        ? add_schematic_const x
   432                        ? add_schematic_const x
   433                       | _ => I)
   433                       | _ => I)
   434 fun atp_schematic_consts_of t = add_schematic_consts_of t Symtab.empty
   434 fun atp_schematic_consts_of t = add_schematic_consts_of t Symtab.empty
   435 
   435 
   436 val tvar_a_str = "'a"
   436 val tvar_a_str = "'a"
   437 val tvar_a_z = ((tvar_a_str, 0), HOLogic.typeS)
   437 val tvar_a_z = ((tvar_a_str, 0), @{sort type})
   438 val tvar_a = TVar tvar_a_z
   438 val tvar_a = TVar tvar_a_z
   439 val tvar_a_name = tvar_name tvar_a_z
   439 val tvar_a_name = tvar_name tvar_a_z
   440 val itself_name = `make_fixed_type_const @{type_name itself}
   440 val itself_name = `make_fixed_type_const @{type_name itself}
   441 val TYPE_name = `(make_fixed_const NONE) @{const_name Pure.type}
   441 val TYPE_name = `(make_fixed_const NONE) @{const_name Pure.type}
   442 val tvar_a_atype = AType ((tvar_a_name, []), [])
   442 val tvar_a_atype = AType ((tvar_a_name, []), [])
  2402 
  2402 
  2403 fun result_type_of_decl (_, _, T, _, ary, _) = chop_fun ary T |> snd
  2403 fun result_type_of_decl (_, _, T, _, ary, _) = chop_fun ary T |> snd
  2404 
  2404 
  2405 fun rationalize_decls thy (decls as decl :: (decls' as _ :: _)) =
  2405 fun rationalize_decls thy (decls as decl :: (decls' as _ :: _)) =
  2406     let
  2406     let
  2407       val T = result_type_of_decl decl |> map_type_tvar (fn (z, _) => TVar (z, HOLogic.typeS))
  2407       val T = result_type_of_decl decl |> map_type_tvar (fn (z, _) => TVar (z, @{sort type}))
  2408     in
  2408     in
  2409       if forall (type_generalization thy T o result_type_of_decl) decls' then [decl]
  2409       if forall (type_generalization thy T o result_type_of_decl) decls' then [decl]
  2410       else decls
  2410       else decls
  2411     end
  2411     end
  2412   | rationalize_decls _ decls = decls
  2412   | rationalize_decls _ decls = decls