generate max suggestions in MaSh export driver
authorblanchet
Wed, 21 Aug 2013 09:25:40 +0200
changeset 53120 43d5f3d6d04e
parent 53119 ac18480cbf9d
child 53121 5f727525b1ac
generate max suggestions in MaSh export driver
src/HOL/TPTP/MaSh_Export.thy
src/HOL/TPTP/mash_export.ML
--- a/src/HOL/TPTP/MaSh_Export.thy	Wed Aug 21 09:25:40 2013 +0200
+++ b/src/HOL/TPTP/MaSh_Export.thy	Wed Aug 21 09:25:40 2013 +0200
@@ -71,16 +71,16 @@
 
 ML {*
 if do_it then
-  generate_isar_commands @{context} prover (range, step) thys
-      linearize (prefix ^ "mash_commands")
+  generate_isar_commands @{context} prover (range, step) thys linearize
+      max_suggestions (prefix ^ "mash_commands")
 else
   ()
 *}
 
 ML {*
 if do_it then
-  generate_mepo_suggestions @{context} params (range, step) thys
-      linearize max_suggestions (prefix ^ "mepo_suggestions")
+  generate_mepo_suggestions @{context} params (range, step) thys linearize
+      max_suggestions (prefix ^ "mepo_suggestions")
 else
   ()
 *}
@@ -103,8 +103,8 @@
 
 ML {*
 if do_it then
-  generate_prover_commands @{context} params (range, step) thys
-      linearize (prefix ^ "mash_prover_commands")
+  generate_prover_commands @{context} params (range, step) thys linearize
+      max_suggestions (prefix ^ "mash_prover_commands")
 else
   ()
 *}
--- a/src/HOL/TPTP/mash_export.ML	Wed Aug 21 09:25:40 2013 +0200
+++ b/src/HOL/TPTP/mash_export.ML	Wed Aug 21 09:25:40 2013 +0200
@@ -20,10 +20,10 @@
     -> unit
   val generate_isar_commands :
     Proof.context -> string -> (int * int option) * int -> theory list -> bool
-    -> string -> unit
+    -> int -> string -> unit
   val generate_prover_commands :
     Proof.context -> params -> (int * int option) * int -> theory list -> bool
-    -> string -> unit
+    -> int -> string -> unit
   val generate_mepo_suggestions :
     Proof.context -> params -> (int * int option) * int -> theory list -> bool
     -> int -> string -> unit
@@ -146,7 +146,7 @@
   is_blacklisted_or_something ctxt ho_atp (Thm.get_name_hint th)
 
 fun generate_isar_or_prover_commands ctxt prover params_opt (range, step) thys
-                                     linearize file_name =
+                                     linearize max_suggs file_name =
   let
     val ho_atp = Sledgehammer_Provers.is_ho_atp ctxt prover
     val path = file_name |> Path.explode
@@ -172,7 +172,7 @@
             encode_features (sort_wrt fst feats)
           val query =
             if is_bad_query ctxt ho_atp step j th isar_deps then ""
-            else "? " ^ core ^ "\n"
+            else "? " ^ string_of_int max_suggs ^ " # " ^ core ^ "\n"
           val update =
             "! " ^ core ^ "; " ^ marker ^ " " ^ encode_strs deps ^ "\n"
         in query ^ update end