src/Pure/Tools/build.ML
author wenzelm
Sun, 15 Nov 2020 22:00:45 +0100
changeset 72616 217e6cf61453
parent 72613 d01ea9e3bd2d
child 72620 429afd0d1a79
permissions -rw-r--r--
refer to session structure from resources;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50686
d703e3aafa8c moved files;
wenzelm
parents: 50683
diff changeset
     1
(*  Title:      Pure/Tools/build.ML
48418
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     3
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     4
Build Isabelle sessions.
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     5
*)
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     6
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
     7
structure Build: sig end =
48418
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     8
struct
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
     9
51662
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    10
(* command timings *)
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    11
56615
47c1dbeec36a tuned comments;
wenzelm
parents: 56614
diff changeset
    12
type timings = ((string * Time.time) Inttab.table) Symtab.table;  (*file -> offset -> name, time*)
51662
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    13
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    14
val empty_timings: timings = Symtab.empty;
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    15
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    16
fun update_timings props =
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    17
  (case Markup.parse_command_timing_properties props of
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    18
    SOME ({file, offset, name}, time) =>
51666
b97aeb018900 add command timings (like document command status);
wenzelm
parents: 51662
diff changeset
    19
      Symtab.map_default (file, Inttab.empty)
62826
eb94e570c1a4 prefer infix operations;
wenzelm
parents: 62793
diff changeset
    20
        (Inttab.map_default (offset, (name, time)) (fn (_, t) => (name, t + time)))
51662
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    21
  | NONE => I);
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    22
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    23
fun approximative_id name pos =
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    24
  (case (Position.file_of pos, Position.offset_of pos) of
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    25
    (SOME file, SOME offset) =>
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    26
      if name = "" then NONE else SOME {file = file, offset = offset, name = name}
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    27
  | _ => NONE);
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    28
65058
3e9f382fb67e absent timing information means zero, according to 0070053570c4, f235646b1b73;
wenzelm
parents: 64599
diff changeset
    29
fun get_timings timings tr =
51662
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    30
  (case approximative_id (Toplevel.name_of tr) (Toplevel.pos_of tr) of
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    31
    SOME {file, offset, name} =>
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    32
      (case Symtab.lookup timings file of
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    33
        SOME offsets =>
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    34
          (case Inttab.lookup offsets offset of
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    35
            SOME (name', time) => if name = name' then SOME time else NONE
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    36
          | NONE => NONE)
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    37
      | NONE => NONE)
65058
3e9f382fb67e absent timing information means zero, according to 0070053570c4, f235646b1b73;
wenzelm
parents: 64599
diff changeset
    38
  | NONE => NONE)
3e9f382fb67e absent timing information means zero, according to 0070053570c4, f235646b1b73;
wenzelm
parents: 64599
diff changeset
    39
  |> the_default Time.zeroTime;
51662
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    40
3391a493f39a just one timing protocol function, with 3 implementations: TTY/PG, PIDE/document, build;
wenzelm
parents: 51661
diff changeset
    41
52052
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    42
(* session timing *)
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    43
72019
940195fbb282 clarified messages;
wenzelm
parents: 72012
diff changeset
    44
fun session_timing f x =
52052
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    45
  let
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    46
    val start = Timing.start ();
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    47
    val y = f x;
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    48
    val timing = Timing.result start;
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    49
62925
f1bdf10f95d8 tuned signature;
wenzelm
parents: 62884
diff changeset
    50
    val threads = string_of_int (Multithreading.max_threads ());
72019
940195fbb282 clarified messages;
wenzelm
parents: 72012
diff changeset
    51
    val props = [("threads", threads)] @ Markup.timing_properties timing;
940195fbb282 clarified messages;
wenzelm
parents: 72012
diff changeset
    52
    val _ = Output.protocol_message (Markup.session_timing :: props) [];
52052
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    53
  in y end;
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    54
892061142ba6 discontinued obsolete isabelle usedir, mkdir, make;
wenzelm
parents: 52041
diff changeset
    55
65307
c1ba192b4f96 more explicit build_session args;
wenzelm
parents: 65306
diff changeset
    56
(* build theories *)
50683
34b109c5324c inline ML statistics into build log;
wenzelm
parents: 50280
diff changeset
    57
72613
d01ea9e3bd2d clarified bibtex_entries: refer to overall session structure;
wenzelm
parents: 72574
diff changeset
    58
fun build_theories symbols last_timing qualifier master_dir (options, thys) =
59366
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    59
  let
68179
da70c9e91135 clarified signature: more explicit type "context" with full options;
wenzelm
parents: 68148
diff changeset
    60
    val context =
72613
d01ea9e3bd2d clarified bibtex_entries: refer to overall session structure;
wenzelm
parents: 72574
diff changeset
    61
      {options = options, symbols = symbols, last_timing = last_timing};
59366
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    62
    val condition = space_explode "," (Options.string options "condition");
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    63
    val conds = filter_out (can getenv_strict) condition;
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    64
  in
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    65
    if null conds then
69755
2fc85ce1f557 discontinued obsolete option "checkpoint";
wenzelm
parents: 68511
diff changeset
    66
      (Options.set_default options;
62714
63888e5f668b clarified use of options;
wenzelm
parents: 62713
diff changeset
    67
        Isabelle_Process.init_options ();
64599
80ef54198f44 dummy fork to produce ML_statistics even in sequential mode (e.g. for heap size);
wenzelm
parents: 64308
diff changeset
    68
        Future.fork I;
68179
da70c9e91135 clarified signature: more explicit type "context" with full options;
wenzelm
parents: 68148
diff changeset
    69
        (Thy_Info.use_theories context qualifier master_dir
64308
b00508facb4f added system option "profiling";
wenzelm
parents: 63827
diff changeset
    70
        |>
b00508facb4f added system option "profiling";
wenzelm
parents: 63827
diff changeset
    71
          (case Options.string options "profiling" of
b00508facb4f added system option "profiling";
wenzelm
parents: 63827
diff changeset
    72
            "" => I
b00508facb4f added system option "profiling";
wenzelm
parents: 63827
diff changeset
    73
          | "time" => profile_time
b00508facb4f added system option "profiling";
wenzelm
parents: 63827
diff changeset
    74
          | "allocations" => profile_allocations
b00508facb4f added system option "profiling";
wenzelm
parents: 63827
diff changeset
    75
          | bad => error ("Bad profiling option: " ^ quote bad))
59366
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    76
        |> Unsynchronized.setmp print_mode
62714
63888e5f668b clarified use of options;
wenzelm
parents: 62713
diff changeset
    77
            (space_explode "," (Options.string options "print_mode") @ print_mode_value ())) thys)
59366
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    78
    else
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    79
      Output.physical_stderr ("Skipping theories " ^ commas_quote (map #1 thys) ^
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    80
        " (undefined " ^ commas conds ^ ")\n")
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    81
  end;
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
    82
65307
c1ba192b4f96 more explicit build_session args;
wenzelm
parents: 65306
diff changeset
    83
c1ba192b4f96 more explicit build_session args;
wenzelm
parents: 65306
diff changeset
    84
(* build session *)
c1ba192b4f96 more explicit build_session args;
wenzelm
parents: 65306
diff changeset
    85
c1ba192b4f96 more explicit build_session args;
wenzelm
parents: 65306
diff changeset
    86
val _ =
c1ba192b4f96 more explicit build_session args;
wenzelm
parents: 65306
diff changeset
    87
  Isabelle_Process.protocol_command "build_session"
65313
347ed6219dab more realistic PIDE build session;
wenzelm
parents: 65307
diff changeset
    88
    (fn [args_yxml] =>
70991
f9f7c34b7dd4 more scalable protocol_message: use XML.body directly (Output.output hook is not required);
wenzelm
parents: 70907
diff changeset
    89
        let
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    90
          val (symbol_codes, (command_timings, (verbose, (browser_info,
72574
d892f6d66402 build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents: 72103
diff changeset
    91
            (documents, (parent_name, (chapter, (session_name, (master_dir,
72616
217e6cf61453 refer to session structure from resources;
wenzelm
parents: 72613
diff changeset
    92
            (theories, (session_positions, (session_directories, (session_chapters,
217e6cf61453 refer to session structure from resources;
wenzelm
parents: 72613
diff changeset
    93
            (doc_names, (global_theories, (loaded_theories, bibtex_entries)))))))))))))))) =
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    94
            YXML.parse_body args_yxml |>
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    95
              let
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    96
                open XML.Decode;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    97
                val position = Position.of_properties o properties;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    98
                val path = Path.explode o string;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
    99
              in
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   100
                pair (list (pair string int)) (pair (list properties) (pair bool (pair path
72574
d892f6d66402 build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents: 72103
diff changeset
   101
                  (pair (list string) (pair string (pair string (pair string
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   102
                    (pair path
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   103
                      (pair (((list (pair Options.decode (list (pair string position))))))
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   104
                        (pair (list (pair string properties))
72616
217e6cf61453 refer to session structure from resources;
wenzelm
parents: 72613
diff changeset
   105
                          (pair (list (pair string string))
72613
d01ea9e3bd2d clarified bibtex_entries: refer to overall session structure;
wenzelm
parents: 72574
diff changeset
   106
                            (pair (list (pair string string)) (pair (list string)
72616
217e6cf61453 refer to session structure from resources;
wenzelm
parents: 72613
diff changeset
   107
                              (pair (list (pair string string)) (pair (list string)
217e6cf61453 refer to session structure from resources;
wenzelm
parents: 72613
diff changeset
   108
                                (list (pair string (list string))))))))))))))))))
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   109
              end;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   110
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   111
          val symbols = HTML.make_symbols symbol_codes;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   112
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   113
          fun build () =
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   114
            let
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   115
              val _ =
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   116
                Resources.init_session
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   117
                  {session_positions = session_positions,
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   118
                   session_directories = session_directories,
72616
217e6cf61453 refer to session structure from resources;
wenzelm
parents: 72613
diff changeset
   119
                   session_chapters = session_chapters,
72613
d01ea9e3bd2d clarified bibtex_entries: refer to overall session structure;
wenzelm
parents: 72574
diff changeset
   120
                   bibtex_entries = bibtex_entries,
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   121
                   docs = doc_names,
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   122
                   global_theories = global_theories,
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   123
                   loaded_theories = loaded_theories};
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   124
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   125
              val _ =
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   126
                Session.init
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   127
                  symbols
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   128
                  (Options.default_bool "browser_info")
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   129
                  browser_info
72574
d892f6d66402 build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents: 72103
diff changeset
   130
                  documents
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   131
                  parent_name
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   132
                  (chapter, session_name)
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   133
                  verbose;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   134
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   135
              val last_timing = get_timings (fold update_timings command_timings empty_timings);
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   136
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   137
              val res1 =
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   138
                theories |>
72613
d01ea9e3bd2d clarified bibtex_entries: refer to overall session structure;
wenzelm
parents: 72574
diff changeset
   139
                  (List.app (build_theories symbols last_timing session_name master_dir)
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   140
                    |> session_timing
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   141
                    |> Exn.capture);
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   142
              val res2 = Exn.capture Session.finish ();
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   143
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   144
              val _ = Resources.finish_session_base ();
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   145
              val _ = Par_Exn.release_all [res1, res2];
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   146
              val _ =
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   147
                if session_name = Context.PureN
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   148
                then Theory.install_pure (Thy_Info.get_theory Context.PureN) else ();
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   149
            in () end;
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   150
71880
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   151
          fun exec e =
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   152
            if can Theory.get_pure () then
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   153
              Isabelle_Thread.fork
71884
2bf0283fc975 proper stack_limit;
wenzelm
parents: 71880
diff changeset
   154
                {name = "build_session", stack_limit = Isabelle_Thread.stack_limit (),
2bf0283fc975 proper stack_limit;
wenzelm
parents: 71880
diff changeset
   155
                  interrupts = false} e
71880
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   156
              |> ignore
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   157
            else e ();
71667
4d2de35214c5 proper treatment of protocol exceptions and prover termination: avoid session.stop while saving image;
wenzelm
parents: 71656
diff changeset
   158
        in
71880
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   159
          exec (fn () =>
72103
7b318273a4aa discontinued old batch-build functionality;
wenzelm
parents: 72019
diff changeset
   160
            (Future.interruptible_task (fn () => (build (); (0, []))) () handle exn =>
71880
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   161
              ((1, Runtime.exn_message_list exn) handle _ (*sic!*) => (2, ["CRASHED"])))
71879
fe7ee970c425 clarified build_session protocol;
wenzelm
parents: 71878
diff changeset
   162
          |> let open XML.Encode in pair int (list string) end
71880
0ca353521753 asynchronous build_session: notably for Scala.fulfill protocol commands during run;
wenzelm
parents: 71879
diff changeset
   163
          |> Output.protocol_message Markup.build_session_finished)
71667
4d2de35214c5 proper treatment of protocol exceptions and prover termination: avoid session.stop while saving image;
wenzelm
parents: 71656
diff changeset
   164
        end
70991
f9f7c34b7dd4 more scalable protocol_message: use XML.body directly (Output.output hook is not required);
wenzelm
parents: 70907
diff changeset
   165
      | _ => raise Match);
59366
e94df7f6b608 clarified build_theories: proper protocol handler;
wenzelm
parents: 59364
diff changeset
   166
48418
1a634f9614fb some actual build function on ML side;
wenzelm
parents:
diff changeset
   167
end;