src/HOL/Tools/Sledgehammer/sledgehammer_mepo.ML
changeset 50985 23bb011a5832
parent 50608 5977de2993ac
child 51004 5f2788c38127
equal deleted inserted replaced
50984:7c07ade3c8e0 50985:23bb011a5832
    16   val pseudo_abs_name : string
    16   val pseudo_abs_name : string
    17   val pseudo_skolem_prefix : string
    17   val pseudo_skolem_prefix : string
    18   val const_names_in_fact :
    18   val const_names_in_fact :
    19     theory -> (string * typ -> term list -> bool * term list) -> term
    19     theory -> (string * typ -> term list -> bool * term list) -> term
    20     -> string list
    20     -> string list
    21   val weight_mepo_facts : 'a list -> ('a * real) list
       
    22   val mepo_suggested_facts :
    21   val mepo_suggested_facts :
    23     Proof.context -> params -> string -> int -> relevance_fudge option
    22     Proof.context -> params -> string -> int -> relevance_fudge option
    24     -> term list -> term -> fact list -> fact list
    23     -> term list -> term -> fact list -> fact list
    25 end;
    24 end;
    26 
    25 
   508           |> insert_special_facts
   507           |> insert_special_facts
   509           |> tap (fn accepts => trace_msg ctxt (fn () =>
   508           |> tap (fn accepts => trace_msg ctxt (fn () =>
   510                       "Total relevant: " ^ string_of_int (length accepts)))
   509                       "Total relevant: " ^ string_of_int (length accepts)))
   511   end
   510   end
   512 
   511 
   513 (* FUDGE *)
       
   514 fun weight_of_mepo_fact rank =
       
   515   Math.pow (0.62, log2 (Real.fromInt (rank + 1)))
       
   516 
       
   517 fun weight_mepo_facts facts =
       
   518   facts ~~ map weight_of_mepo_fact (0 upto length facts - 1)
       
   519 
       
   520 fun mepo_suggested_facts ctxt
   512 fun mepo_suggested_facts ctxt
   521         ({fact_thresholds = (thres0, thres1), ...} : params) prover
   513         ({fact_thresholds = (thres0, thres1), ...} : params) prover
   522         max_facts fudge hyp_ts concl_t facts =
   514         max_facts fudge hyp_ts concl_t facts =
   523   let
   515   let
   524     val thy = Proof_Context.theory_of ctxt
   516     val thy = Proof_Context.theory_of ctxt