src/HOL/Tools/ATP/atp_systems.ML
changeset 42613 23b13b1bd565
parent 42611 ec29be07cd9d
child 42643 c7b71b55099b
equal deleted inserted replaced
42612:bb9143d7e217 42613:23b13b1bd565
     8 signature ATP_SYSTEMS =
     8 signature ATP_SYSTEMS =
     9 sig
     9 sig
    10   type format = ATP_Problem.format
    10   type format = ATP_Problem.format
    11   type formula_kind = ATP_Problem.formula_kind
    11   type formula_kind = ATP_Problem.formula_kind
    12   type failure = ATP_Proof.failure
    12   type failure = ATP_Proof.failure
    13 
       
    14   datatype polymorphism = Polymorphic | Monomorphic | Mangled_Monomorphic
       
    15   datatype type_level =
       
    16     All_Types | Nonmonotonic_Types | Finite_Types | Const_Arg_Types | No_Types
       
    17 
       
    18   datatype type_system =
       
    19     Many_Typed |
       
    20     Preds of polymorphism * type_level |
       
    21     Tags of polymorphism * type_level
       
    22 
    13 
    23   type atp_config =
    14   type atp_config =
    24     {exec : string * string,
    15     {exec : string * string,
    25      required_execs : (string * string) list,
    16      required_execs : (string * string) list,
    26      arguments : int -> Time.time -> (unit -> (string * real) list) -> string,
    17      arguments : int -> Time.time -> (unit -> (string * real) list) -> string,
    27      proof_delims : (string * string) list,
    18      proof_delims : (string * string) list,
    28      known_failures : (failure * string) list,
    19      known_failures : (failure * string) list,
    29      hypothesis_kind : formula_kind,
    20      hypothesis_kind : formula_kind,
    30      formats : format list,
    21      formats : format list,
    31      best_slices : unit -> (real * (bool * int)) list,
    22      best_slices : unit -> (real * (bool * int)) list,
    32      best_type_systems : type_system list}
    23      best_type_systems : string list}
    33 
    24 
    34   datatype e_weight_method =
    25   datatype e_weight_method =
    35     E_Slices | E_Auto | E_Fun_Weight | E_Sym_Offset_Weight
    26     E_Slices | E_Auto | E_Fun_Weight | E_Sym_Offset_Weight
    36 
    27 
    37   val polymorphism_of_type_sys : type_system -> polymorphism
       
    38   val level_of_type_sys : type_system -> type_level
       
    39   val is_type_sys_virtually_sound : type_system -> bool
       
    40   val is_type_sys_fairly_sound : type_system -> bool
       
    41   (* for experimentation purposes -- do not use in production code *)
    28   (* for experimentation purposes -- do not use in production code *)
    42   val e_weight_method : e_weight_method Unsynchronized.ref
    29   val e_weight_method : e_weight_method Unsynchronized.ref
    43   val e_default_fun_weight : real Unsynchronized.ref
    30   val e_default_fun_weight : real Unsynchronized.ref
    44   val e_fun_weight_base : real Unsynchronized.ref
    31   val e_fun_weight_base : real Unsynchronized.ref
    45   val e_fun_weight_span : real Unsynchronized.ref
    32   val e_fun_weight_span : real Unsynchronized.ref
    56   val z3_atpN : string
    43   val z3_atpN : string
    57   val remote_prefix : string
    44   val remote_prefix : string
    58   val remote_atp :
    45   val remote_atp :
    59     string -> string -> string list -> (string * string) list
    46     string -> string -> string list -> (string * string) list
    60     -> (failure * string) list -> formula_kind -> format list -> (unit -> int)
    47     -> (failure * string) list -> formula_kind -> format list -> (unit -> int)
    61     -> type_system list -> string * atp_config
    48     -> string list -> string * atp_config
    62   val add_atp : string * atp_config -> theory -> theory
    49   val add_atp : string * atp_config -> theory -> theory
    63   val get_atp : theory -> string -> atp_config
    50   val get_atp : theory -> string -> atp_config
    64   val supported_atps : theory -> string list
    51   val supported_atps : theory -> string list
    65   val is_atp_installed : theory -> string -> bool
    52   val is_atp_installed : theory -> string -> bool
    66   val refresh_systems_on_tptp : unit -> unit
    53   val refresh_systems_on_tptp : unit -> unit
    72 
    59 
    73 open ATP_Problem
    60 open ATP_Problem
    74 open ATP_Proof
    61 open ATP_Proof
    75 
    62 
    76 (* ATP configuration *)
    63 (* ATP configuration *)
    77 
       
    78 datatype polymorphism = Polymorphic | Monomorphic | Mangled_Monomorphic
       
    79 datatype type_level =
       
    80   All_Types | Nonmonotonic_Types | Finite_Types | Const_Arg_Types | No_Types
       
    81 
       
    82 datatype type_system =
       
    83   Many_Typed |
       
    84   Preds of polymorphism * type_level |
       
    85   Tags of polymorphism * type_level
       
    86 
       
    87 val mangled_preds = Preds (Mangled_Monomorphic, All_Types)
       
    88 val const_args = Preds (Polymorphic, Const_Arg_Types)
       
    89 
       
    90 fun polymorphism_of_type_sys Many_Typed = Mangled_Monomorphic
       
    91   | polymorphism_of_type_sys (Preds (poly, _)) = poly
       
    92   | polymorphism_of_type_sys (Tags (poly, _)) = poly
       
    93 
       
    94 fun level_of_type_sys Many_Typed = All_Types
       
    95   | level_of_type_sys (Preds (_, level)) = level
       
    96   | level_of_type_sys (Tags (_, level)) = level
       
    97 
       
    98 val is_type_level_virtually_sound =
       
    99   member (op =) [All_Types, Nonmonotonic_Types]
       
   100 val is_type_sys_virtually_sound =
       
   101   is_type_level_virtually_sound o level_of_type_sys
       
   102 
       
   103 fun is_type_level_fairly_sound level =
       
   104   is_type_level_virtually_sound level orelse level = Finite_Types
       
   105 val is_type_sys_fairly_sound = is_type_level_fairly_sound o level_of_type_sys
       
   106 
    64 
   107 type atp_config =
    65 type atp_config =
   108   {exec : string * string,
    66   {exec : string * string,
   109    required_execs : (string * string) list,
    67    required_execs : (string * string) list,
   110    arguments : int -> Time.time -> (unit -> (string * real) list) -> string,
    68    arguments : int -> Time.time -> (unit -> (string * real) list) -> string,
   111    proof_delims : (string * string) list,
    69    proof_delims : (string * string) list,
   112    known_failures : (failure * string) list,
    70    known_failures : (failure * string) list,
   113    hypothesis_kind : formula_kind,
    71    hypothesis_kind : formula_kind,
   114    formats : format list,
    72    formats : format list,
   115    best_slices : unit -> (real * (bool * int)) list,
    73    best_slices : unit -> (real * (bool * int)) list,
   116    best_type_systems : type_system list}
    74    best_type_systems : string list}
   117 
    75 
   118 val known_perl_failures =
    76 val known_perl_failures =
   119   [(CantConnect, "HTTP error"),
    77   [(CantConnect, "HTTP error"),
   120    (NoPerl, "env: perl"),
    78    (NoPerl, "env: perl"),
   121    (NoLibwwwPerl, "Can't locate HTTP")]
    79    (NoLibwwwPerl, "Can't locate HTTP")]
   238        [(0.33333, (true, 100 (* FUDGE *))) (* E_Sym_Offset_Weight *),
   196        [(0.33333, (true, 100 (* FUDGE *))) (* E_Sym_Offset_Weight *),
   239         (0.33333, (true, 1000 (* FUDGE *))) (* E_Auto *),
   197         (0.33333, (true, 1000 (* FUDGE *))) (* E_Auto *),
   240         (0.33334, (true, 200 (* FUDGE *))) (* E_Fun_Weight *)]
   198         (0.33334, (true, 200 (* FUDGE *))) (* E_Fun_Weight *)]
   241      else
   199      else
   242        [(1.0, (true, 250 (* FUDGE *)))],
   200        [(1.0, (true, 250 (* FUDGE *)))],
   243    best_type_systems = [const_args, mangled_preds]}
   201    best_type_systems = ["const_args", "mangled_preds"]}
   244 
   202 
   245 val e = (eN, e_config)
   203 val e = (eN, e_config)
   246 
   204 
   247 
   205 
   248 (* SPASS *)
   206 (* SPASS *)
   269    hypothesis_kind = Conjecture,
   227    hypothesis_kind = Conjecture,
   270    formats = [Fof],
   228    formats = [Fof],
   271    best_slices =
   229    best_slices =
   272      K [(0.66667, (false, 150 (* FUDGE *))) (* with SOS *),
   230      K [(0.66667, (false, 150 (* FUDGE *))) (* with SOS *),
   273         (0.33333, (true, 150 (* FUDGE *))) (* without SOS *)],
   231         (0.33333, (true, 150 (* FUDGE *))) (* without SOS *)],
   274    best_type_systems = [mangled_preds]}
   232    best_type_systems = ["mangled_preds"]}
   275 
   233 
   276 val spass = (spassN, spass_config)
   234 val spass = (spassN, spass_config)
   277 
   235 
   278 
   236 
   279 (* Vampire *)
   237 (* Vampire *)
   305    hypothesis_kind = Conjecture,
   263    hypothesis_kind = Conjecture,
   306    formats = [Fof],
   264    formats = [Fof],
   307    best_slices =
   265    best_slices =
   308      K [(0.66667, (false, 450 (* FUDGE *))) (* with SOS *),
   266      K [(0.66667, (false, 450 (* FUDGE *))) (* with SOS *),
   309         (0.33333, (true, 450 (* FUDGE *))) (* without SOS *)],
   267         (0.33333, (true, 450 (* FUDGE *))) (* without SOS *)],
   310    best_type_systems = [mangled_preds]}
   268    best_type_systems = ["mangled_preds"]}
   311 
   269 
   312 val vampire = (vampireN, vampire_config)
   270 val vampire = (vampireN, vampire_config)
   313 
   271 
   314 
   272 
   315 (* Z3 with TPTP syntax *)
   273 (* Z3 with TPTP syntax *)