src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML
changeset 48408 5493e67982ee
parent 48407 47fe0ca12fc2
child 48433 9e9b6e363859
equal deleted inserted replaced
48407:47fe0ca12fc2 48408:5493e67982ee
   611     val parents = maximal_in_graph fact_G facts
   611     val parents = maximal_in_graph fact_G facts
   612     val feats = features_of ctxt prover thy (Local, General) (concl_t :: hyp_ts)
   612     val feats = features_of ctxt prover thy (Local, General) (concl_t :: hyp_ts)
   613     val suggs =
   613     val suggs =
   614       if Graph.is_empty fact_G then []
   614       if Graph.is_empty fact_G then []
   615       else mash_QUERY ctxt overlord (max_suggs_of max_facts) (parents, feats)
   615       else mash_QUERY ctxt overlord (max_suggs_of max_facts) (parents, feats)
   616     val selected = facts |> suggested_facts suggs
   616     val selected =
       
   617       facts |> suggested_facts suggs
       
   618             (* The weights currently returned by "mash.py" are too extreme to
       
   619                make any sense. *)
       
   620             |> map fst |> weight_mepo_facts
   617     val unknown = facts |> filter_out (is_fact_in_graph fact_G)
   621     val unknown = facts |> filter_out (is_fact_in_graph fact_G)
   618   in (selected, unknown) end
   622   in (selected, unknown) end
   619 
   623 
   620 fun add_to_fact_graph ctxt (name, parents, feats, deps) (adds, graph) =
   624 fun add_to_fact_graph ctxt (name, parents, feats, deps) (adds, graph) =
   621   let
   625   let
   651           val thy = Proof_Context.theory_of ctxt
   655           val thy = Proof_Context.theory_of ctxt
   652           val name = freshish_name ()
   656           val name = freshish_name ()
   653           val feats = features_of ctxt prover thy (Local, General) [t]
   657           val feats = features_of ctxt prover thy (Local, General) [t]
   654           val deps = used_ths |> map nickname_of
   658           val deps = used_ths |> map nickname_of
   655           val {fact_G} = mash_get ctxt
   659           val {fact_G} = mash_get ctxt
   656           val parents = timeit (fn () => maximal_in_graph fact_G facts)
   660           val parents = maximal_in_graph fact_G facts
   657         in
   661         in
   658           mash_ADD ctxt overlord [(name, parents, feats, deps)]; (true, "")
   662           mash_ADD ctxt overlord [(name, parents, feats, deps)]; (true, "")
   659         end)
   663         end)
   660 
   664 
   661 fun sendback sub =
   665 fun sendback sub =