src/HOL/Tools/ATP/atp_problem.ML
changeset 42967 13cb8895f538
parent 42966 4e2d6c1e5392
child 42968 74415622d293
equal deleted inserted replaced
42966:4e2d6c1e5392 42967:13cb8895f538
    25                * string fo_term option * string fo_term option
    25                * string fo_term option * string fo_term option
    26   type 'a problem = (string * 'a problem_line list) list
    26   type 'a problem = (string * 'a problem_line list) list
    27 
    27 
    28   (* official TPTP syntax *)
    28   (* official TPTP syntax *)
    29   val tptp_special_prefix : string
    29   val tptp_special_prefix : string
       
    30   val tptp_has_type : string
    30   val tptp_type_of_types : string
    31   val tptp_type_of_types : string
    31   val tptp_bool_type : string
    32   val tptp_bool_type : string
    32   val tptp_individual_type : string
    33   val tptp_individual_type : string
    33   val tptp_fun_type : string
    34   val tptp_fun_type : string
    34   val tptp_false : string
    35   val tptp_false : string
    35   val tptp_true : string
    36   val tptp_true : string
    36   val tptp_app_op : string
    37   val tptp_not : string
       
    38   val tptp_app : string
    37   val is_atp_variable : string -> bool
    39   val is_atp_variable : string -> bool
    38   val mk_anot : ('a, 'b, 'c) formula -> ('a, 'b, 'c) formula
    40   val mk_anot : ('a, 'b, 'c) formula -> ('a, 'b, 'c) formula
    39   val mk_aconn :
    41   val mk_aconn :
    40     connective -> ('a, 'b, 'c) formula -> ('a, 'b, 'c) formula
    42     connective -> ('a, 'b, 'c) formula -> ('a, 'b, 'c) formula
    41     -> ('a, 'b, 'c) formula
    43     -> ('a, 'b, 'c) formula
    75              * string fo_term option * string fo_term option
    77              * string fo_term option * string fo_term option
    76 type 'a problem = (string * 'a problem_line list) list
    78 type 'a problem = (string * 'a problem_line list) list
    77 
    79 
    78 (* official TPTP syntax *)
    80 (* official TPTP syntax *)
    79 val tptp_special_prefix = "$"
    81 val tptp_special_prefix = "$"
       
    82 val tptp_has_type = ":"
    80 val tptp_type_of_types = "$tType"
    83 val tptp_type_of_types = "$tType"
    81 val tptp_bool_type = "$o"
    84 val tptp_bool_type = "$o"
    82 val tptp_individual_type = "$i"
    85 val tptp_individual_type = "$i"
    83 val tptp_fun_type = ">"
    86 val tptp_fun_type = ">"
    84 val tptp_false = "$false"
    87 val tptp_false = "$false"
    85 val tptp_true = "$true"
    88 val tptp_true = "$true"
    86 val tptp_app_op = "@"
    89 val tptp_not = "~"
       
    90 val tptp_app = "@"
    87 
    91 
    88 fun is_atp_variable s = Char.isUpper (String.sub (s, 0))
    92 fun is_atp_variable s = Char.isUpper (String.sub (s, 0))
    89 
    93 
    90 fun mk_anot (AConn (ANot, [phi])) = phi
    94 fun mk_anot (AConn (ANot, [phi])) = phi
    91   | mk_anot phi = AConn (ANot, [phi])
    95   | mk_anot phi = AConn (ANot, [phi])
   143     end
   147     end
   144 
   148 
   145 fun string_for_quantifier AForall = "!"
   149 fun string_for_quantifier AForall = "!"
   146   | string_for_quantifier AExists = "?"
   150   | string_for_quantifier AExists = "?"
   147 
   151 
   148 fun string_for_connective ANot = "~"
   152 fun string_for_connective ANot = tptp_not
   149   | string_for_connective AAnd = "&"
   153   | string_for_connective AAnd = "&"
   150   | string_for_connective AOr = "|"
   154   | string_for_connective AOr = "|"
   151   | string_for_connective AImplies = "=>"
   155   | string_for_connective AImplies = "=>"
   152   | string_for_connective AIf = "<="
   156   | string_for_connective AIf = "<="
   153   | string_for_connective AIff = "<=>"
   157   | string_for_connective AIff = "<=>"
   203            map (string_for_problem_line format) lines)
   207            map (string_for_problem_line format) lines)
   204        problem
   208        problem
   205 
   209 
   206 
   210 
   207 (** CNF UEQ (Waldmeister) **)
   211 (** CNF UEQ (Waldmeister) **)
   208 
       
   209 exception LOST_CONJECTURE of unit
       
   210 
   212 
   211 fun is_problem_line_negated (Formula (_, _, AConn (ANot, _), _, _)) = true
   213 fun is_problem_line_negated (Formula (_, _, AConn (ANot, _), _, _)) = true
   212   | is_problem_line_negated _ = false
   214   | is_problem_line_negated _ = false
   213 
   215 
   214 fun is_problem_line_cnf_ueq
   216 fun is_problem_line_cnf_ueq