src/HOL/Tools/Sledgehammer/sledgehammer_filter.ML
changeset 40418 8b73059e97a1
parent 40408 0d0acdf068b8
child 41066 3890ef4e02f9
equal deleted inserted replaced
40417:a29b2fee592b 40418:8b73059e97a1
   367   | locality_bonus {simp_bonus, ...} Simp = simp_bonus
   367   | locality_bonus {simp_bonus, ...} Simp = simp_bonus
   368   | locality_bonus {local_bonus, ...} Local = local_bonus
   368   | locality_bonus {local_bonus, ...} Local = local_bonus
   369   | locality_bonus {assum_bonus, ...} Assum = assum_bonus
   369   | locality_bonus {assum_bonus, ...} Assum = assum_bonus
   370   | locality_bonus {chained_bonus, ...} Chained = chained_bonus
   370   | locality_bonus {chained_bonus, ...} Chained = chained_bonus
   371 
   371 
       
   372 fun is_odd_const_name s =
       
   373   s = abs_name orelse String.isPrefix skolem_prefix s orelse
       
   374   String.isSuffix theory_const_suffix s
       
   375 
   372 fun fact_weight fudge loc const_tab relevant_consts fact_consts =
   376 fun fact_weight fudge loc const_tab relevant_consts fact_consts =
   373   case fact_consts |> List.partition (pconst_hyper_mem I relevant_consts)
   377   case fact_consts |> List.partition (pconst_hyper_mem I relevant_consts)
   374                    ||> filter_out (pconst_hyper_mem swap relevant_consts) of
   378                    ||> filter_out (pconst_hyper_mem swap relevant_consts) of
   375     ([], _) => 0.0
   379     ([], _) => 0.0
   376   | (rel, irrel) =>
   380   | (rel, irrel) =>
   377     if forall (forall (String.isSuffix theory_const_suffix o fst))
   381     if forall (forall (is_odd_const_name o fst)) [rel, irrel] then
   378               [rel, irrel] then
       
   379       0.0
   382       0.0
   380     else
   383     else
   381       let
   384       let
   382         val irrel = irrel |> filter_out (pconst_mem swap rel)
   385         val irrel = irrel |> filter_out (pconst_mem swap rel)
   383         val rel_weight =
   386         val rel_weight =