src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
changeset 81254 d3c0734059ee
parent 79730 4031aafc2dda
equal deleted inserted replaced
81253:bbed9f218158 81254:d3c0734059ee
    14   type one_line_params = Sledgehammer_Proof_Methods.one_line_params
    14   type one_line_params = Sledgehammer_Proof_Methods.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 option * string option) * Time.time * real option * bool * bool
    19     bool * (string option * string option * string list) * Time.time * real option * bool * bool
    20     * (term, string) atp_step list * thm
    20     * (term, string) atp_step list * thm
    21 
    21 
    22   val proof_text : Proof.context -> bool -> bool option -> bool -> (unit -> isar_params) -> int ->
    22   val proof_text : Proof.context -> bool -> bool option -> bool -> (unit -> isar_params) -> int ->
    23     one_line_params -> string
    23     one_line_params -> string
    24   val abduce_text : Proof.context -> term list -> string
    24   val abduce_text : Proof.context -> term list -> string
   130       else
   130       else
   131         add_lines_pass2 (line :: res) lines
   131         add_lines_pass2 (line :: res) lines
   132     end
   132     end
   133 
   133 
   134 type isar_params =
   134 type isar_params =
   135   bool * (string option * string option) * Time.time * real option * bool * bool
   135   bool * (string option * string option * string list) * Time.time * real option * bool * bool
   136   * (term, string) atp_step list * thm
   136   * (term, string) atp_step list * thm
   137 
   137 
   138 val basic_systematic_methods =
   138 val basic_systematic_methods =
   139   [Metis_Method (NONE, NONE), Meson_Method, Blast_Method, SATx_Method, Argo_Method]
   139   [Metis_Method (NONE, NONE, []), Meson_Method, Blast_Method, SATx_Method, Argo_Method]
   140 val basic_simp_based_methods =
   140 val basic_simp_based_methods =
   141   [Auto_Method, Simp_Method, Fastforce_Method, Force_Method]
   141   [Auto_Method, Simp_Method, Fastforce_Method, Force_Method]
   142 val basic_arith_methods =
   142 val basic_arith_methods =
   143   [Linarith_Method, Presburger_Method, Algebra_Method]
   143   [Linarith_Method, Presburger_Method, Algebra_Method]
   144 
   144 
   145 val arith_methods = basic_arith_methods @ basic_simp_based_methods @ basic_systematic_methods
   145 val arith_methods = basic_arith_methods @ basic_simp_based_methods @ basic_systematic_methods
   146 val systematic_methods =
   146 val systematic_methods =
   147   basic_systematic_methods @ basic_arith_methods @ basic_simp_based_methods @
   147   basic_systematic_methods @ basic_arith_methods @ basic_simp_based_methods @
   148   [Metis_Method (SOME full_typesN, NONE), Metis_Method (SOME no_typesN, NONE)]
   148   [Metis_Method (SOME full_typesN, NONE, []), Metis_Method (SOME no_typesN, NONE, [])]
   149 val rewrite_methods = basic_simp_based_methods @ basic_systematic_methods @ basic_arith_methods
   149 val rewrite_methods = basic_simp_based_methods @ basic_systematic_methods @ basic_arith_methods
   150 val skolem_methods = Moura_Method :: systematic_methods
   150 val skolem_methods = Moura_Method :: systematic_methods
   151 
   151 
   152 fun isar_proof_text ctxt debug num_chained isar_proofs smt_proofs isar_params
   152 fun isar_proof_text ctxt debug num_chained isar_proofs smt_proofs isar_params
   153     (one_line_params as ((used_facts, (_, one_line_play)), banner, subgoal, subgoal_count)) =
   153     (one_line_params as ((used_facts, (_, one_line_play)), banner, subgoal, subgoal_count)) =
   481                      Proof {steps = [Prove {qualifiers = [Show], facts = (_, gfs),
   481                      Proof {steps = [Prove {qualifiers = [Show], facts = (_, gfs),
   482                        proof_methods = meth :: _, ...}], ...} =>
   482                        proof_methods = meth :: _, ...}], ...} =>
   483                      let
   483                      let
   484                        val used_facts' =
   484                        val used_facts' =
   485                          map_filter (fn s =>
   485                          map_filter (fn s =>
   486                             if exists (fn (s', (sc, _)) => s' = s andalso sc = Chained)
   486                             if exists (fn (p, (sc, _)) => content_of_pretty p = s andalso
   487                                 used_facts then
   487                                 sc = Chained) used_facts then
   488                               NONE
   488                               NONE
   489                             else
   489                             else
   490                               SOME (s, (Global, General))) gfs
   490                               SOME (Pretty.str s, (Global, General))) gfs
   491                      in
   491                      in
   492                        ((used_facts', (meth, play_outcome)), banner, subgoal, subgoal_count)
   492                        ((used_facts', (meth, play_outcome)), banner, subgoal, subgoal_count)
   493                      end
   493                      end
   494                    | _ => one_line_params)
   494                    | _ => one_line_params)
   495                  else
   495                  else