src/Tools/try.ML
changeset 52647 45ce95b8bf69
parent 52645 e8c1c5612677
child 52648 b1ae4306f29f
equal deleted inserted replaced
52646:80590a089984 52647:45ce95b8bf69
   114 
   114 
   115 
   115 
   116 (* asynchronous print function (PIDE) *)
   116 (* asynchronous print function (PIDE) *)
   117 
   117 
   118 fun print_function ((name, (weight, auto, tool)): tool) =
   118 fun print_function ((name, (weight, auto, tool)): tool) =
   119   Command.print_function {name = name, pri = ~ weight, persistent = true}
   119   Command.print_function name
   120     (fn {command_name} =>
   120     (fn {command_name} =>
   121       if Keyword.is_theory_goal command_name andalso Options.default_bool auto then
   121       if Keyword.is_theory_goal command_name andalso Options.default_bool auto then
   122         SOME (fn _ => fn st =>
   122         SOME {pri = ~ weight, persistent = true, print_fn = fn _ => fn st =>
   123           let
   123           let
   124             val auto_time_limit = Options.default_real @{option auto_time_limit}
   124             val auto_time_limit = Options.default_real @{option auto_time_limit}
   125           in
   125           in
   126             if auto_time_limit > 0.0 then
   126             if auto_time_limit > 0.0 then
   127               (case try Toplevel.proof_of st of
   127               (case try Toplevel.proof_of st of
   132                     SOME (true, (_, state')) =>
   132                     SOME (true, (_, state')) =>
   133                       List.app Pretty.writeln (Proof.pretty_goal_messages state')
   133                       List.app Pretty.writeln (Proof.pretty_goal_messages state')
   134                   | _ => ())
   134                   | _ => ())
   135               | NONE => ())
   135               | NONE => ())
   136             else ()
   136             else ()
   137           end)
   137           end}
   138       else NONE);
   138       else NONE);
   139 
   139 
   140 
   140 
   141 (* hybrid tool setup *)
   141 (* hybrid tool setup *)
   142 
   142