48418
|
1 |
(* Title: Pure/System/build.ML
|
|
2 |
Author: Makarius
|
|
3 |
|
|
4 |
Build Isabelle sessions.
|
|
5 |
*)
|
|
6 |
|
|
7 |
signature BUILD =
|
|
8 |
sig
|
|
9 |
val build: string -> unit
|
|
10 |
end;
|
|
11 |
|
|
12 |
structure Build: BUILD =
|
|
13 |
struct
|
|
14 |
|
48457
|
15 |
fun use_theories name options =
|
|
16 |
Thy_Info.use_thys
|
|
17 |
|> Session.with_timing name (Options.bool options "timing")
|
|
18 |
|> Unsynchronized.setmp Proofterm.proofs (Options.int options "proofs")
|
|
19 |
|> Unsynchronized.setmp print_mode
|
|
20 |
(space_explode "," (Options.string options "print_mode") @ print_mode_value ())
|
|
21 |
|> Unsynchronized.setmp Goal.parallel_proofs (Options.int options "parallel_proofs")
|
|
22 |
|> Unsynchronized.setmp Goal.parallel_proofs_threshold
|
|
23 |
(Options.int options "parallel_proofs_threshold")
|
|
24 |
|> Unsynchronized.setmp Multithreading.trace (Options.int options "threads_trace")
|
48458
|
25 |
|> Unsynchronized.setmp Multithreading.max_threads (Options.int options "threads_limit")
|
|
26 |
|> Options.bool options "no_document" ? Present.no_document;
|
48457
|
27 |
|
48418
|
28 |
fun build args_file =
|
|
29 |
let
|
48457
|
30 |
val (save, (options, (verbose, (browser_info, (parent, (name, (base_name, theories))))))) =
|
48418
|
31 |
File.read (Path.explode args_file) |> YXML.parse_body |>
|
48457
|
32 |
let open XML.Decode in
|
|
33 |
pair bool (pair Options.decode (pair bool (pair string (pair string
|
|
34 |
(pair string (pair string ((list (pair Options.decode (list string))))))))))
|
|
35 |
end;
|
48418
|
36 |
|
48457
|
37 |
val _ =
|
|
38 |
Session.init
|
|
39 |
save
|
|
40 |
false (* FIXME reset!? *)
|
|
41 |
(Options.bool options "browser_info") browser_info
|
48458
|
42 |
(Options.string options "document")
|
48457
|
43 |
(Options.bool options "document_graph")
|
|
44 |
(space_explode "," (Options.string options "document_variants"))
|
|
45 |
parent
|
|
46 |
base_name
|
|
47 |
(true (* FIXME copy document/ files on Scala side!? *),
|
|
48 |
Options.string options "document_dump")
|
|
49 |
""
|
|
50 |
verbose;
|
|
51 |
|
|
52 |
val _ = List.app (uncurry (use_theories name)) theories;
|
48418
|
53 |
val _ = Session.finish ();
|
|
54 |
|
48419
|
55 |
val _ = if save then () else quit ();
|
48418
|
56 |
in () end
|
|
57 |
handle exn => (Output.error_msg (ML_Compiler.exn_message exn); exit 1);
|
|
58 |
|
|
59 |
end;
|