src/HOL/TPTP/MaSh_Export.thy
author blanchet
Fri, 30 May 2014 12:27:51 +0200
changeset 58462 f8112c4b9cb8
parent 56554 5832470d956e
child 58463 426ab5fabcae
permissions -rw-r--r--
extend exporter with new versions of MaSh
     1 (*  Title:      HOL/TPTP/MaSh_Export.thy
     2     Author:     Jasmin Blanchette, TU Muenchen
     3 *)
     4 
     5 header {* MaSh Exporter *}
     6 
     7 theory MaSh_Export
     8 imports Main
     9 begin
    10 
    11 ML_file "~~/src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML" (*###*)
    12 ML_file "mash_export.ML"
    13 
    14 sledgehammer_params
    15   [provers = spass, max_facts = 32, strict, dont_slice, type_enc = mono_native,
    16    lam_trans = lifting, timeout = 2, dont_preplay, minimize]
    17 
    18 declare [[sledgehammer_instantiate_inducts = false]]
    19 
    20 hide_fact (open) HOL.ext
    21 
    22 ML {*
    23 Multithreading.max_threads_value ()
    24 *}
    25 
    26 ML {*
    27 open MaSh_Export
    28 *}
    29 
    30 ML {*
    31 val do_it = true (*###*) (* switch to "true" to generate the files *)
    32 val thys = [@{theory List}]
    33 val params as {provers, ...} = Sledgehammer_Commands.default_params @{theory} []
    34 val prover = hd provers
    35 val range = (1, (* ### NONE *) SOME 100)
    36 val step = 1
    37 val linearize = false
    38 val max_suggestions = 1024
    39 val dir = "List"
    40 val prefix = "/tmp/" ^ dir ^ "/"
    41 *}
    42 
    43 ML {*
    44 if do_it then
    45   Isabelle_System.mkdir (Path.explode prefix)
    46 else
    47   ()
    48 *}
    49 
    50 ML {* Options.put_default @{system_option MaSh} "sml_knn" *}
    51 
    52 ML {*
    53 if do_it then
    54   generate_mash_suggestions @{context} params (range, step) thys linearize max_suggestions
    55     (prefix ^ "mash_sml_knn_suggestions")
    56 else
    57   ()
    58 *}
    59 
    60 ML {* Options.put_default @{system_option MaSh} "sml_nb" *}
    61 
    62 ML {*
    63 if do_it then
    64   generate_mepo_suggestions @{context} params (range, step) thys linearize max_suggestions
    65     (prefix ^ "mash_sml_nb_suggestions")
    66 else
    67   ()
    68 *}
    69 
    70 ML {* Options.put_default @{system_option MaSh} "py" *}
    71 
    72 ML {*
    73 if do_it then
    74   generate_mepo_suggestions @{context} params (range, step) thys linearize max_suggestions
    75     (prefix ^ "mepo_suggestions")
    76 else
    77   ()
    78 *}
    79 
    80 ML {*
    81 if do_it then
    82   generate_accessibility @{context} thys linearize (prefix ^ "mash_accessibility")
    83 else
    84   ()
    85 *}
    86 
    87 ML {*
    88 if do_it then
    89   generate_features @{context} thys (prefix ^ "mash_features")
    90 else
    91   ()
    92 *}
    93 
    94 ML {*
    95 if do_it then
    96   generate_isar_dependencies @{context} range thys linearize (prefix ^ "mash_dependencies")
    97 else
    98   ()
    99 *}
   100 
   101 ML {*
   102 if do_it then
   103   generate_isar_commands @{context} prover (range, step) thys linearize max_suggestions
   104     (prefix ^ "mash_commands")
   105 else
   106   ()
   107 *}
   108 
   109 ML {*
   110 if do_it then
   111   generate_mepo_suggestions @{context} params (range, step) thys linearize max_suggestions
   112     (prefix ^ "mepo_suggestions")
   113 else
   114   ()
   115 *}
   116 
   117 ML {*
   118 if do_it then
   119   generate_mesh_suggestions max_suggestions (prefix ^ "mash_suggestions")
   120     (prefix ^ "mepo_suggestions") (prefix ^ "mesh_suggestions")
   121 else
   122   ()
   123 *}
   124 
   125 ML {*
   126 if do_it then
   127   generate_prover_dependencies @{context} params range thys linearize
   128     (prefix ^ "mash_prover_dependencies")
   129 else
   130   ()
   131 *}
   132 
   133 ML {*
   134 if do_it then
   135   generate_prover_commands @{context} params (range, step) thys linearize max_suggestions
   136     (prefix ^ "mash_prover_commands")
   137 else
   138   ()
   139 *}
   140 
   141 ML {*
   142 if do_it then
   143   generate_mesh_suggestions max_suggestions (prefix ^ "mash_prover_suggestions")
   144     (prefix ^ "mepo_suggestions") (prefix ^ "mesh_prover_suggestions")
   145 else
   146   ()
   147 *}
   148 
   149 end