src/HOL/Tools/SMT/smt_solver.ML
changeset 82091 2c9c06a9f61f
parent 82090 023845c29d48
child 82092 93195437fdee
equal deleted inserted replaced
82090:023845c29d48 82091:2c9c06a9f61f
   135         Pretty.big_list "functions:" (map p_term (Symtab.dest terms))])) ()
   135         Pretty.big_list "functions:" (map p_term (Symtab.dest terms))])) ()
   136   end
   136   end
   137 
   137 
   138 in
   138 in
   139 
   139 
   140 fun invoke memoize_fun_call name command options smt_options ithms ctxt =
   140 fun invoke memoize_fun_call name command cmd_options smt_options ithms ctxt =
   141   let
   141   let
   142     val options = options @ SMT_Config.solver_options_of ctxt
   142     val options = cmd_options @ SMT_Config.solver_options_of ctxt
   143     val comments = [implode_space options]
   143     val comments = [implode_space options]
   144 
   144 
   145     val (str, replay_data as {context = ctxt', ...}) =
   145     val (input, replay_data as {context = ctxt', ...}) =
   146       ithms
   146       ithms
   147       |> tap (trace_assms ctxt)
   147       |> tap (trace_assms ctxt)
   148       |> SMT_Translate.translate ctxt name smt_options comments
   148       |> SMT_Translate.translate ctxt name smt_options comments
   149       ||> tap trace_replay_data
   149       ||> tap trace_replay_data
   150 
   150 
   151     val cmd = Bash.script (Bash.strings (command () @ options))
   151     val cmd = Bash.script (Bash.strings (command () @ options))
   152     val run_cmd = run_solver ctxt' name cmd
   152     val run_cmd = run_solver ctxt' name cmd
   153 
   153 
   154     val output_lines =
   154     val output_lines =
   155       (case memoize_fun_call of
   155       (case memoize_fun_call of
   156         NONE => run_cmd str
   156         NONE => run_cmd input
   157       | SOME memoize => split_lines (memoize (cat_lines o run_cmd) str))
   157       | SOME memoize => split_lines (memoize (cat_lines o run_cmd) input))
   158   in (output_lines, replay_data) end
   158   in (output_lines, replay_data) end
   159 
   159 
   160 end
   160 end
   161 
   161 
   162 
   162