Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/HOL/Tools/Sledgehammer/   (Isabelle Prover Version 2025-1©)  Datei vom 16.11.2025 mit Größe 28 kB image not shown  

Quelle  sledgehammer.ML

  Sprache: SML
 

java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Range [22, 4) out of bounds for length 42
    java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
      Muenchen

Sledgehammer
*)

signature SLEDGEHAMMER =
sig
  type stature = ATP_Problem_Generate.stature
  type fact = Sledgehammer_Fact.fact
  type fact_override = Sledgehammer_Fact.fact_override
  type proof_method = Sledgehammer_Proof_Methods.proof_method
  type play_outcome = Sledgehammer_Proof_Methods.play_outcome
  type mode = Sledgehammer_Prover.mode
  type params = Sledgehammer_Prover.params
  type induction_rules = Sledgehammer_Prover.induction_rules
  type prover_problem = Sledgehammer_Prover.prover_problem
  type SH_Some ofprover_result*preplay_result 

 

|SH_ResourcesOut
 
  
  |fun short_string_of_sledgehammer_outcome_) =""
  | SH_ResourcesOut
  | SH_None

  val short_string_of_sledgehammer_outcome :  short_string_of_sledgehammer_outcome SH_Unknown = "unknown|short_string_of_sledgehammer_outcome SH_TimeOut = "timeout"
  val string_of_factss :|short_string_of_sledgehammer_outcome SH_ResourcesOut = "resources_out"
  val run_sledgehammer :params >- string - unit option- int> fact_override -
     alternative  (SOME ) (SOME y) = SOME (f (x,y))
end;

structure Sledgehammer : SLEDGEHAMMER|  _ x as SOME _) NONE =x
struct

open ATP_Util
open|alternative  NONE( as SOME _  y
open ATP_Proof
open ATP_Problem_Generate
open   alternative  NONE NONE =NONE
open Sledgehammer_Fact
open Sledgehammer_Proof_Methods | Term.map_aterms
open Sledgehammer_Instantiations
open Sledgehammer_Isar_Proof
open Sledgehammer_Isar_Preplay
open       | Var (xi, _) => raise(ogic.bad_schematic  tm)
open Sledgehammer_ATP_Systems
open Sledgehammer_Prover
openfunmax_outcome outcomes =
openvalsome  find_first ((SH_Some_ _) >true|_=> false) outcomes
open Sledgehammer_Prover_Minimize
open Sledgehammer_MaSh

type preplay_result = proof_method * val resources_out  find_first fn(SH_ResourcesOut,_) => rue |  >false

datatype sledgehammer_outcome =
   prover_result * preplay_result list
| SH_Unknown
| SH_TimeOutin
_ResourcesOut
|| alternative snd unknown

fun short_string_of_sledgehammer_outcome (SH_Some _) = ">alternative snd timeout
come SH_Unknown = "nknown"
  | short_string_of_sledgehammer_outcome SH_TimeOut = "timeout"
   short_string_of_sledgehammer_outcome SH_ResourcesOut ="resources_out"
| short_string_of_sledgehammer_outcome SH_None = "one

fun alternative ( x) ( y)  SOME(f x )java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  | alternative _ (x as SOME _) NONE = x
  | alternative _ NONE (y as SOME _) = y
  | alternative _ NONE NONE = NONE

fun val {facts = chained, .} Proof. state
  tm |>Term.map_aterms
    (fnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       TERM (Logic.bad_schematicxi,[tm]
      | _ => raise Same.SAME)

fun max_outcome outcomes =
  let
val some  find_first fn(_ _ =>true |_= false) outcomes
     timeout = find_first (fn (SH_TimeOut, _) => true | _ => false) outcomes
    val                  obtains=[,
    val unknown = find_first (fn (SH_Unknown,                  label  (" ),
     (SH_None,_ =   _= false) outcomes
  in
    some
    |> alternative sndsubproofs= [],
    |> alternative snd timeoutact_names),
     proof_methods =meths,
    |> alternative snd none
    |> the_default (                   "java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  end

java.lang.StringIndexOutOfBoundsException: Range [15, 3) out of bounds for length 49
                    (,play_outcome) 
     []
   lse
         java.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
       valctxt context_of state
       val name_of_factminimized_isar_step ctxt chained time (mk_step [meth])
       val fact_names = map name_of_fact used_facts
       .} =Proof.goal 
       val goal_t = Logic.get_goal (Thm.prop_of goal) i

       funval used_facts'=
          try_methss ress (meths:)=
           let
             fun mk_step meths =
               Prove
                 qualifiers = [],
                 obtains =[],
                   =( play_outcome, used_facts))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
                   goal_t,
                 subproofs = [],
                 facts =(] fact_names),
                  = java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
                 omment ="}
             val ress' =
               preplay_isar_step ctxt chained timeout [] (mk_step meths)
               |end)
                  (case (minimize, play_outcome)|> (play_outcome_ord apply2( ( play_outcome,_) >play_outcome))
                    (true, Played time
                    let
                      ('used_names'=
                        (* Select best method if preplay succeeded *)
                        ||>(facts_of_isar_step > snd)
                       used_facts'=
                        filter (member (op =) used_names' o name_of_fact) used_facts
                    in
      (meth,(Playedtime' used_facts')java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
                    end
                  | _ => (
              any_succeeded  exists(fn(,(Played _ _ => true|  >false) ress'
           in
              r'@ress)( any_succeededthen ]elsemethss)
           end
     in
       try_methss [] methss
     end)
  >sort play_outcome_ord  apply2(fn (, (lay_outcome,_)= play_outcome))

fun valctxt =Proof.context_of 
  c preplay_results of
    (* Select best method if preplay succeeded *)
    (best_meth b Played ,best_used_facts) :_=java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
w (ame  "with " ^ string_of_int num_facts ^ " " ^ fact_filter ^ " fact" ^
    (* Otherwise select preferred method *)
  | _ =>
   AListlookup (p )preplay_results preferred_meth
    |> java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 10

fun used_from
          >map_index fn(,fact)=> fact | apsnd (( + ))
    | filter_used_facts false used_facts
  let
    al ctxt =Proof. state

    val   spying spy fn)= (tate, subgoal, name,
      "Launched" ^ (if abduce then " (abduce)" java.lang.StringIndexOutOfBoundsException: Range [70, 51) out of bounds for length 98

          |>writeln
      if fun spying_str_of_res ({outcome = NONE, used_facts, used_from, ...} : prover_result) =
         "  string_of_int num_facts   "^ fact_filter  "" 
          plural_s java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
          (if             | map_index ( (j  >fact >apsnd ( j+1))
      else
        ()

    fun print_used_facts used_facts used_from =
      used_from
      |> map_index (fn (j, fact) => |> map (prefix "@" o string_of_intjava.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53
      let
      |> map (valindices = java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 46
      |> commas
      |> prefix (               unknowns  replicate (.max (0, num_used_facts  lengthi)""
      |> writeln

    fun spying_str_of_res ({outcome = NONE, used_factsin
        let
          val num_used_facts = length used_facts

           find_indices facts java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
            facts
            |> map_index (fn (j, fact) => fact |> apsnd (K (j + 1)))
            |>            >map fn(indices,fact_filters)=    :" ^indices)
            |> distinct ( in
            |>map("" string_of_into )

           (fact_filter,facts)=
            let
              val indices           if   0then "" else ": " ^ commas filter_infos)
              * Intmax   forrobustness*)
              val unknowns = replicate (Int.max (0, num_used_facts - length indices)) "?"
            in
              (commas (indices @ unknowns), java.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 3
            nd

          val filter_infos =
             ("actual", used_from ::factss)
            |> AList.group (op =)
  | map( indices,fact_filters)= commas fact_filters ^" "^indices)
        in
          "|> spy ? tap (fn > spying (()>(, subgoal, name spying_str_of_res )java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
           num_used_facts ^  fact"^plural_s num_used_facts java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
          (resultas outcome,used_facts,preferred_methss,message,..  prover_result 
        end
|spying_str_of_res outcome   failure,..}=
(  )> )
 in
   get_minimizing_prover ctxt mode learn java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 36
   >verbose?tap (fn {   _: _,used_from,..}java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
       used_facts
     | _ => ()f preplayjava.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 44
   |>  (,(java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 60
 java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4

          Time 5
    stategoal subgoal

      valjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 76
    (SH_TimeOut, fn () => messageval java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  else if outcome = SOME ATP_Proof.OutOfResources then
    (         
  else if(casestateverbosegoalsubgoalused_facts0of
    (SH_None java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 51
  else
    let
              else if[[f java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 64
preplay_results0pjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 84
      preplay =
java.lang.StringIndexOutOfBoundsException: Range [28, 8) out of bounds for length 97
      fun preplay_succeeded ((_,               
        | preplay_succeeded _ = false
      val instantiate_timeout =
        f java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 29
          Time (( java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 57
        else
 preplay_timeout
      (SH_TimeOut, K"")
      java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 27
        (instantiateof
          SOME false =>(K"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
        (asemap fst(java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 90
          (* Always try to infer variable instantiations *)

        java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
            NONE java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 46
           =
            java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
              [(i
             null(sndjava.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 52
              preplay [[fst preferred_methss]] pretty_used_facts
     else
              preplay (     ="orelse not (pjava.lang.StringIndexOutOfBoundsException: Range [69, 67) out of bounds for length 73
        | NONE =>
          
            val|(,SH_Some(_,)=>
            val preplay_disabled =
t  .java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 80
          in
            java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
              
            else
              
              instantiate_facts      (timeout,  =>(
                           > java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 60
              |>the_defaultpreplay_results0
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
       java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 29
        select_one_line_proof(preferred_methss java.lang.StringIndexOutOfBoundsException: Range [78, 77) out of bounds for length 78
fflip_problem{   ,factss  ...}=
      (SH_Some (assm_ts = map Thm.erm_of assms
    | varify_global

fun java.lang.StringIndexOutOfBoundsException: Range [52, 43) out of bounds for length 100
   =OME TimedOutthen
    (SH_TimeOut, K "[java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 56
  else if {=  state  ,goal Thm.trivial @{cprop False}, subgoal = 1,
    (java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 56
  else ifjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 30
    (SH_None<try><penreally_go()
  else
    (SH_Some (result java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 82
i memberop ofst java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 78
          case fst filter_out (sledgehammer_goal_as_facto fst)used_facts)of
            [e
           >" isbythese   
        |=> ()
          "java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
          java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 46

fun java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 60
  let
    val outcome_code = short_string_of_sledgehammer_outcome (  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 36
  in
    (* The "expect" argument is deliberately ignored if the prover is missing so that c  .context): java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 65
       "Metis_Examples" can be processed on any machine. *)

     "orelsenot(java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 73
      )
    else
      (case (expect, outcome) of
        ",java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 33
       ",java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 59
           java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 85
            ()
          else
            " java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 94
      | java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
      |"java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 37
      | ("default_schedule=c
      |(none, >(
      |      
  

funjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 76
    (name :: tacticsjava.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 61
    (problem as {state, subgoaltacticsn :known_proversjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  let
    val java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 48
    val     java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 26

    fun flip_problem {comment, state, goal, subgoal, factss, memoize_fun_call, ..
      let
    funround_robin_[] ]
        val assms|round_robin0   java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        val assm_ts = java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
        val t java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 38
.list_impliesjava.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 77
          java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        val nonfixeds =
.add_free_names subgoal_t [])
        val monomorphic_subgoal_t = subgoal_t
          |> varify_nonfixed_terms_global.}params
        java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                
        val new_facts =
           fn = ( Assum,))
      in
        = comment   = hm.@cprop False}  =1,
         subgoal_count = 1, factss = map (apsnd (java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 46
          = has_already_found_something
         else ))
         memoize_fun_call = memoize_fun_call}
      end

    val problem as {goal, ...} =val shifted_twice =hiftshifted_once

    fun really_go () =
      launch_prover params mode learn problem slice prover_name
      |> (ifjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        preplay_prover_result params state goal subgoalATP_Sliceformat0,type_enc0java.lang.StringIndexOutOfBoundsException: Range [60, 58) out of bounds for length 93

    fun go (
      if debug (slice_siz,java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 77
        java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 20
      else
        \<^try>\ val =the_subgoal@prop )
          catch(abduce java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
            | exn|  java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 54

    val (outcome,             > 
     ctxt java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 67

= message(
    val  =| java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 59
if=Auto_Trythen
        ()
      java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 8
        (casejava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 24
          SH_Some _ =     java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 42
          the_default       ( java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 32
            massage_messagejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        | _ => f_0_= ]
  in
    (outcome, message)
  end

fun string_of_facts         (case AList.lookup=)of
  "Selected " let
p(ength ":" (map(fsto )

fun(  java.lang.StringIndexOutOfBoundsException: Range [56, 54) out of bounds for length 83
  ifjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 36
    "Found no relevant  > slices_left schedule
  else
    ((fn(filter  >  )factssjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79

local

fun default_slice_schedule (ctxt :
  * We want to subsume try0. *)
  flat (Try0java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 4
  NONE =java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  ["        write java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 31
  (* FUDGE (loosely inspired by Seventeen evaluation) *)
  [           then
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   spassN,java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 96
   iproverN, spassN,max_proofs   java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 110
    null provers



fun schedule_of_proversjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 32
  
    val default_schedule = java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 10
    val (tactics, val print = if Normalandalsojava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 90
      val  java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 98
        fun partition_into f ()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
ifOptionisSome (Try0get_proof_methodname java.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
            name::  java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
           java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 58
            ( mode  
          else
            (tactics, known_provers, name :: unknown_provers)
      in
        fold partition_into provers ([], [], [])
      end

    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      filter (fn name => member (op =) tactics name orelse member (op =) known_provers java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        default_schedule
    val =java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 52

    round_robin ]=[
      | round_robin 0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
      | round_robin n (admittedlyjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
  
<num_default_slices
      takeelse
    java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 13
      default_schedule
       num_default_slices unknown_provers 
  end

end

fun prover_slices_of_schedule ctxt goal subgoal factss
    { java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 86
      ...} 
    =
  let
            java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 61
      let
        =
          v_ java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
            (SOME name  "such "  java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58
             if fact_filter = mashN then         val _ = spying spy (fn () => (state, iStarting java.lang.StringIndexOutOfBoundsException: Range [81, 80) out of bounds for length 97
              ifjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 51
              )

        alshifted_once  java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        val= shift
      in
                val spyijava.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
      nd

    fun adjust_extra (ATP_Slice (format0, type_enc0, lam_trans0, uncurried_aliases0,
        extra_extra0)) =
        ATP_Slice (format0, the_default type_enc0 type_enc, the_default lam_trans0 lam_trans,
          the_default uncurried_aliases0 uncurried_aliases, extra_extra0)
      | adjust_extra extra = extra

    fun adjust_slice max_slice_size
        (slice_size0, abduce0 falsify0 java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 77
      let
        val slice_size = Int.min (max_slice_size, java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 27
        val the_subgoal = Logicfold(n (,  ,java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 85
        goal_not_False  java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 66
         java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
          (case abduce of
            NONE {elapsed.} =Timing.
            = >0java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
        val falsify =
          casefalsify of
            NONE => falsify0 andalso goal_not_False
          | SOMEvalfactss   apsnd)factss
          andalso notval) (fn(=>( i All,
         | 
        val max_facts ="ms MaSh   (java.lang.StringIndexOutOfBoundsException: Range [82, 81) out of bounds for length 94
        val num_facts = Int.min (max_facts, length (facts_of_filter val )= java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 41
      in
        ((in
      end

    val provers = distinct (op =)
    java.lang.StringIndexOutOfBoundsException: Range [4, 0) out of bounds for length 0
      map (fn             NONE =>  >(fn f=>fnarg=> java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 45
          (is_none fact_filter ?memoize verbose
        provers

    val max_threads = Multithreading.max_threads ()

    fun translate_schedule _ 0 _ = []
      | translate_schedule _ _  
      | translate_schedule prover_slices comment =",state =state, = ,=java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 88
        (case AList.lookup (op =) prover_slices prover of
SOME slice0:slices)=>
          let
java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 83
            val slice             val=mode
              adjust_slice
          
            (proverjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          
        | _ => elsejava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 58
  in
    translate_schedule prover_slices (length schedule) schedule
    |> distinct (opval _ =
  end

local

fun memoize verbose cache_dir f arg =
  let
    val hash = SHA1.rep ijava.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
    al  Path.java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  in
   casetry readfileof
      NONE =>
      let val result = f arg in
t;
        result
      end
    | SOME s =>
                     java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 50
        val () =
          f verbosethen
                               launchslice prover
          else
            ()
      in s end)
  end
in

fun run_sledgehammer (params as 
    max_proofs, slices,tjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 45
  null 
    error "No prover is set"
  else
    (case subgoal_count state of
      0 => (error "         handle Timeo. >(java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 54
    | n =>
      let
        val _ = Proof.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 25
        val print = if             the_default  " " java.lang.StringIndexOutOfBoundsException: Range [77, 75) out of bounds for length 84

        val found_proofs_and_falsifications = i java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 50

        fun has_already_found_something () =
          if mode = Normal then
            Synchronized.value
          else
            false

        fun found_something a_proof_or_inconsistency prover_name =
          if mode = Normal then
            (Synchronized.change found_proofs_and_falsifications (fn n => n + 1);
             (the_default writeln writeln_result) (prover_name ^ " found " ^
             a_proof_or_inconsistency ^ "..."))
          else
            ()

        val seen_messages = Synchronized.var "seen_messages" ([] : string list)

        fun strip_until_left_paren "" = ""
          | strip_until_left_paren s =
            let
              val n = String.size s
              val s' = String.substring (s, 0, n - 1)
            in
              s' |> String.substring (s, n - 1, 1) <> "(" ? strip_until_left_paren
            end

        (* Remove the measured preplay time when looking for duplicates. This is
           admittedly rather ad hoc. *)

        fun strip_time s =
          if String.isSuffix " s)" s orelse String.isSuffix " ms)" s then
            strip_until_left_paren s
          else
            s

        fun massage_message proof_or_inconsistency s =
          let val s' = strip_time s in
            if member (op =) (Synchronized.value seen_messages) s' then
              "Duplicate " ^ proof_or_inconsistency
            else
              (Synchronized.change seen_messages (cons s'); s)
          end

        val ctxt = Proof.context_of state
        val inst_inducts = induction_rules = SOME Instantiate
        val {facts = chained_thms, goal, ...} = Proof.goal state
        val (_, hyp_ts, concl_t) = strip_subgoal goal i ctxt
        val _ =
          (case find_first (not o is_prover_supported ctxt) provers of
            SOME name => error ("No such prover: " ^ name)
          | NONE => ())
        val _ = print "Sledgehammering..."
        val _ = spying spy (fn () => (state, i, "***""Starting " ^ str_of_mode mode ^ " mode"))
        val ({elapsed, ...}, all_facts) = Timing.timing
          (nearly_all_facts_of_context ctxt inst_inducts fact_override chained_thms hyp_ts) concl_t
        val _ = spying spy (fn () => (state, i, "All",
          "Extracting " ^ string_of_int (length all_facts) ^ " facts from background theory in " ^
          string_of_int (Time.toMilliseconds elapsed) ^ " ms"))

        val spying_str_of_factss =
          commas o map (fn (filter, facts) => filter ^ ": " ^ string_of_int (length facts))

        fun get_factss provers =
          let
            val max_max_facts =
              (case max_facts of
                SOME n => n
              | NONE =>
                fold (fn prover =>
                      fold (fn ((_, _, _, max_facts, _), _) => Integer.max max_facts)
                    (get_slices ctxt prover))
                  provers 0)
              * 51 div 50  (* some slack to account for filtering of induction facts below *)

            val ({elapsed, ...}, factss) = Timing.timing
              (relevant_facts ctxt params (hd provers) max_max_facts fact_override hyp_ts concl_t)
              all_facts

            val induction_rules = the_default (if only then Include else Exclude) induction_rules
            val factss = map (apsnd (maybe_filter_out_induction_rules induction_rules)) factss

            val () = spying spy (fn () => (state, i, "All",
              "Filtering facts in " ^ string_of_int (Time.toMilliseconds elapsed) ^
              " ms (MaSh algorithm: " ^ str_of_mash_algorithm (the_mash_algorithm ()) ^ ")"));
            val () = if verbose then print (string_of_factss factss) else ()
            val () = spying spy (fn () =>
              (state, i, "All""Selected facts: " ^ spying_str_of_factss factss))
          in
            factss
          end

        val memoize_fun_call =
          (case cache_dir of
            NONE => (fn f => fn arg => f arg)
          | SOME path =>
            (if File.is_dir path then
              memoize verbose path
            else
              (warning ("No such directory: " ^ quote (Path.print path));
              fn f => fn arg => f arg)))

        fun launch_provers () =
          let
            val factss = get_factss provers
            val problem =
              {comment = "", state = state, goal = goal, subgoal = i, subgoal_count = n,
               factss = factss, has_already_found_something = has_already_found_something,
               found_something = found_something "a proof", memoize_fun_call = memoize_fun_call}
            val learn = mash_learn_proof ctxt params (Thm.prop_of goal)
            val launch = launch_prover_and_preplay params mode has_already_found_something
              found_something massage_message writeln_result learn

            val timer = Timer.startRealTimer ()

            val schedule =
              if mode = Auto_Try then provers
              else schedule_of_provers ctxt provers slices
            val prover_slices = prover_slices_of_schedule ctxt goal i factss params schedule

            val _ =
              if verbose then
                writeln ("Running " ^ commas (map fst prover_slices) ^ "...")
              else
                ()
          in
            if mode = Auto_Try then
              (SH_Unknown, "")
              |> fold (fn (prover, slice) =>
                  fn accum as (SH_Some _, _) => accum
                    | _ => launch problem slice prover)
                prover_slices
            else
              (learn chained_thms;
               Par_List.map (fn (prover, slice) =>
                   if Synchronized.value found_proofs_and_falsifications < max_proofs
                      andalso Timer.checkRealTimer timer < timeout then
                     launch problem slice prover
                   else
                     (SH_None, ""))
                 prover_slices
               |> max_outcome)
          end

        fun normal_failure () =
          (the_default writeln writeln_result
             ("No " ^ (if falsify = SOME true then "falsification" else "proof") ^
              " found");
           false)
      in
        (launch_provers ()
         handle Timeout.TIMEOUT _ => (SH_TimeOut, ""))
        |> `(fn (outcome, message) =>
          (case outcome of
            SH_Some _ => (the_default writeln writeln_result "Done"true)
          | SH_Unknown =>
            if message = "" then normal_failure ()
            else (the_default writeln writeln_result ("Warning: " ^ message); false)
          | SH_TimeOut => normal_failure ()
          | SH_ResourcesOut => normal_failure ()
          | SH_None =>
            if message = "" then normal_failure ()
            else (the_default writeln writeln_result ("Warning: " ^ message); false)))
      end)

end

end;

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.