src/HOL/Tools/ATP/atp_problem.ML
changeset 57811 faab5feffb42
parent 57709 9cda0c64c37a
child 58600 c9e8ad426ab1
equal deleted inserted replaced
57810:2479dc4ef90b 57811:faab5feffb42
   535   | tptp_string_of_line format (Sym_Decl (ident, sym, ty)) =
   535   | tptp_string_of_line format (Sym_Decl (ident, sym, ty)) =
   536     tptp_string_of_format format ^ "(" ^ ident ^ ", type,\n    " ^ sym ^
   536     tptp_string_of_format format ^ "(" ^ ident ^ ", type,\n    " ^ sym ^
   537     " : " ^ string_of_type format ty ^ ").\n"
   537     " : " ^ string_of_type format ty ^ ").\n"
   538   | tptp_string_of_line format (Formula ((ident, alt), kind, phi, source, _)) =
   538   | tptp_string_of_line format (Formula ((ident, alt), kind, phi, source, _)) =
   539     tptp_string_of_format format ^ "(" ^ ident ^ ", " ^
   539     tptp_string_of_format format ^ "(" ^ ident ^ ", " ^
   540     tptp_string_of_role kind ^ "," ^ maybe_alt alt ^
   540     tptp_string_of_role kind ^ "," ^ "\n    (" ^
   541     "\n    (" ^ tptp_string_of_formula format phi ^ ")" ^
   541     tptp_string_of_formula format phi ^ ")" ^
   542     (case source of
   542     (case source of
   543        SOME tm => ", " ^ tptp_string_of_term format tm
   543       SOME tm => ", " ^ tptp_string_of_term format tm
   544      | NONE => "") ^ ").\n"
   544     | NONE => "") ^
       
   545     ")." ^ maybe_alt alt ^ "\n"
   545 
   546 
   546 fun tptp_lines format =
   547 fun tptp_lines format =
   547   maps (fn (_, []) => []
   548   maps (fn (_, []) => []
   548          | (heading, lines) =>
   549          | (heading, lines) =>
   549            "\n% " ^ heading ^ " (" ^ string_of_int (length lines) ^ ")\n" ::
   550            "\n% " ^ heading ^ " (" ^ string_of_int (length lines) ^ ")\n" ::
   640       ")."
   641       ")."
   641     fun subclass_of sub super = "subclass(" ^ sub ^ ", " ^ super ^ ")."
   642     fun subclass_of sub super = "subclass(" ^ sub ^ ", " ^ super ^ ")."
   642     fun formula pred (Formula ((ident, alt), kind, phi, _, info)) =
   643     fun formula pred (Formula ((ident, alt), kind, phi, _, info)) =
   643         if pred kind then
   644         if pred kind then
   644           let val rank = extract_isabelle_rank info in
   645           let val rank = extract_isabelle_rank info in
   645             "formula(" ^ dfg_string_of_formula poly gen_simp info phi ^
   646             "formula(" ^ dfg_string_of_formula poly gen_simp info phi ^ ", " ^ ident ^
   646             ", " ^ ident ^
       
   647             (if rank = default_rank then "" else ", " ^ string_of_int rank) ^
   647             (if rank = default_rank then "" else ", " ^ string_of_int rank) ^
   648             ")." ^ maybe_alt alt
   648             ")." ^ maybe_alt alt
   649             |> SOME
   649             |> SOME
   650           end
   650           end
   651         else
   651         else