src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
changeset 55257 abfd7b90bba2
parent 55256 6c317e374614
child 55258 8cc42c1f9bb5
equal deleted inserted replaced
55256:6c317e374614 55257:abfd7b90bba2
    14   type one_line_params = Sledgehammer_Reconstructor.one_line_params
    14   type one_line_params = Sledgehammer_Reconstructor.one_line_params
    15 
    15 
    16   val trace : bool Config.T
    16   val trace : bool Config.T
    17 
    17 
    18   type isar_params =
    18   type isar_params =
    19     bool * string * string * Time.time * real * bool * (term, string) atp_step list * thm
    19     bool * (string option * string option) * Time.time * real * bool
       
    20       * (term, string) atp_step list * thm
    20 
    21 
    21   val proof_text : Proof.context -> bool -> bool option -> (unit -> isar_params) -> int ->
    22   val proof_text : Proof.context -> bool -> bool option -> (unit -> isar_params) -> int ->
    22     one_line_params -> string
    23     one_line_params -> string
    23 end;
    24 end;
    24 
    25 
   106       else
   107       else
   107         add_lines_pass2 res (map (replace_dependencies_in_line (name, deps)) lines)
   108         add_lines_pass2 res (map (replace_dependencies_in_line (name, deps)) lines)
   108     end
   109     end
   109 
   110 
   110 type isar_params =
   111 type isar_params =
   111   bool * string * string * Time.time * real * bool * (term, string) atp_step list * thm
   112   bool * (string option * string option) * Time.time * real * bool * (term, string) atp_step list
       
   113     * thm
   112 
   114 
   113 val arith_methods =
   115 val arith_methods =
   114   [Arith_Method, Simp_Method, Auto_Method, Fastforce_Method, Blast_Method, Force_Method,
   116   [Arith_Method, Simp_Method, Auto_Method, Fastforce_Method, Blast_Method, Force_Method,
   115    Algebra_Method, Metis_Method, Meson_Method]
   117    Algebra_Method, Metis_Method (NONE, NONE), Meson_Method]
   116 val datatype_methods = [Simp_Method, Simp_Size_Method]
   118 val datatype_methods = [Simp_Method, Simp_Size_Method]
   117 val metislike_methods =
   119 val metislike_methods0 =
   118   [Metis_Method, Simp_Method, Auto_Method, Arith_Method, Blast_Method, Fastforce_Method,
   120   [Metis_Method (NONE, NONE), Simp_Method, Auto_Method, Arith_Method, Blast_Method,
   119    Force_Method, Algebra_Method, Meson_Method]
   121    Fastforce_Method, Force_Method, Algebra_Method, Meson_Method]
   120 val rewrite_methods =
   122 val rewrite_methods =
   121   [Auto_Method, Simp_Method, Fastforce_Method, Force_Method, Metis_Method, Meson_Method]
   123   [Auto_Method, Simp_Method, Fastforce_Method, Force_Method, Metis_Method (NONE, NONE),
   122 val skolem_methods = [Metis_Method, Blast_Method, Meson_Method]
   124    Meson_Method]
       
   125 val skolem_methods = [Metis_Method (NONE, NONE), Blast_Method, Meson_Method]
   123 
   126 
   124 fun isar_proof_text ctxt debug isar_proofs isar_params
   127 fun isar_proof_text ctxt debug isar_proofs isar_params
   125     (one_line_params as (_, _, _, _, subgoal, subgoal_count)) =
   128     (one_line_params as (_, _, _, _, subgoal, subgoal_count)) =
   126   let
   129   let
   127     fun isar_proof_of () =
   130     fun isar_proof_of () =
   128       let
   131       let
   129         val SOME (verbose, metis_type_enc, metis_lam_trans, preplay_timeout, compress_isar,
   132         val SOME (verbose, alt_metis_args, preplay_timeout, compress_isar, try0_isar, atp_proof,
   130           try0_isar, atp_proof, goal) = try isar_params ()
   133           goal) = try isar_params ()
       
   134 
       
   135         val metislike_methods = insert (op =) (Metis_Method alt_metis_args) metislike_methods0
   131 
   136 
   132         val (params, _, concl_t) = strip_subgoal goal subgoal ctxt
   137         val (params, _, concl_t) = strip_subgoal goal subgoal ctxt
   133         val (_, ctxt) =
   138         val (_, ctxt) =
   134           params
   139           params
   135           |> map (fn (s, T) => (Binding.name s, SOME T, NoSyn))
   140           |> map (fn (s, T) => (Binding.name s, SOME T, NoSyn))
   263               isar_steps outer (SOME l) (step :: accum) infs
   268               isar_steps outer (SOME l) (step :: accum) infs
   264             end
   269             end
   265         and isar_proof outer fix assms lems infs =
   270         and isar_proof outer fix assms lems infs =
   266           Proof (fix, assms, lems @ isar_steps outer NONE [] infs)
   271           Proof (fix, assms, lems @ isar_steps outer NONE [] infs)
   267 
   272 
   268         val string_of_isar_proof =
   273         val string_of_isar_proof = string_of_isar_proof ctxt subgoal subgoal_count
   269           string_of_isar_proof ctxt metis_type_enc metis_lam_trans subgoal subgoal_count
       
   270 
   274 
   271         val trace = Config.get ctxt trace
   275         val trace = Config.get ctxt trace
   272 
   276 
   273         val canonical_isar_proof =
   277         val canonical_isar_proof =
   274           refute_graph
   278           refute_graph
   282         val preplay_ctxt = ctxt
   286         val preplay_ctxt = ctxt
   283           |> enrich_context_with_local_facts canonical_isar_proof
   287           |> enrich_context_with_local_facts canonical_isar_proof
   284           |> silence_reconstructors debug
   288           |> silence_reconstructors debug
   285 
   289 
   286         val preplay_data as {preplay_outcome, overall_preplay_outcome, ...} =
   290         val preplay_data as {preplay_outcome, overall_preplay_outcome, ...} =
   287           preplay_data_of_isar_proof preplay_ctxt metis_type_enc metis_lam_trans preplay_timeout
   291           preplay_data_of_isar_proof preplay_ctxt preplay_timeout canonical_isar_proof
   288             canonical_isar_proof
       
   289 
   292 
   290         fun str_of_preplay_outcome outcome =
   293         fun str_of_preplay_outcome outcome =
   291           if Lazy.is_finished outcome then string_of_play_outcome (Lazy.force outcome) else "?"
   294           if Lazy.is_finished outcome then string_of_play_outcome (Lazy.force outcome) else "?"
   292 
   295 
   293         fun str_of_meth l meth =
   296         fun str_of_meth l meth =