1 (*** Isabelle/Pure bootstrap from "RAW" environment ***)
3 (** bootstrap phase 0: towards secure ML barrier *)
5 structure Distribution = (*filled-in by makedist*)
7 val version = "Isabelle2014: August 2014 + Isabelle/Isac";
8 val is_identified = false;
9 val is_official = false;
13 (* library of general tools *)
15 use "General/basics.ML";
17 use "General/print_mode.ML";
18 use "General/alist.ML";
19 use "General/table.ML";
21 use "Concurrent/simple_thread.ML";
23 use "Concurrent/synchronized.ML";
24 if Multithreading.available then ()
25 else use "Concurrent/synchronized_sequential.ML";
26 use "Concurrent/counter.ML";
28 use "General/properties.ML";
29 use "General/output.ML";
31 fun legacy_feature s = warning (Markup.markup Markup.legacy ("Legacy feature! " ^ s));
32 use "General/scan.ML";
33 use "General/source.ML";
34 use "General/symbol.ML";
35 use "General/position.ML";
36 use "General/symbol_pos.ML";
37 use "General/antiquote.ML";
40 use "General/secure.ML";
42 val use_text = Secure.use_text;
43 val use_file = Secure.use_file;
46 Position.setmp_thread_data (Position.file_only s)
48 Secure.use_file ML_Parse.global_context true s
49 handle ERROR msg => (writeln msg; error "ML error")) ();
51 val toplevel_pp = Secure.toplevel_pp;
54 (** bootstrap phase 1: towards ML within Isar context *)
56 (* library of general tools *)
58 use "General/integer.ML";
59 use "General/stack.ML";
60 use "General/queue.ML";
61 use "General/heap.ML";
62 use "General/same.ML";
63 use "General/ord_list.ML";
64 use "General/balanced_tree.ML";
65 use "General/linear_set.ML";
66 use "General/buffer.ML";
67 use "General/pretty.ML";
68 use "General/path.ML";
70 use "General/file.ML";
71 use "General/long_name.ML";
72 use "General/binding.ML";
73 use "General/socket_io.ML";
75 use "General/timing.ML";
77 use "General/sha1.ML";
78 if ML_System.is_polyml then use "General/sha1_polyml.ML" else ();
79 use "General/sha1_samples.ML";
83 use "PIDE/document_id.ML";
85 use "General/change_table.ML";
86 use "General/graph.ML";
88 use "System/options.ML";
91 (* concurrency within the ML runtime *)
93 if ML_System.is_polyml
94 then use "ML/exn_properties_polyml.ML"
95 else use "ML/exn_properties_dummy.ML";
97 if ML_System.name = "polyml-5.5.1"
98 orelse ML_System.name = "polyml-5.5.2"
99 then use "ML/exn_trace_polyml-5.5.1.ML"
102 if ML_System.name = "polyml-5.5.0"
103 orelse ML_System.name = "polyml-5.5.1"
104 orelse ML_System.name = "polyml-5.5.2"
105 then use "ML/ml_statistics_polyml-5.5.0.ML"
106 else use "ML/ml_statistics_dummy.ML";
108 use "Concurrent/single_assignment.ML";
109 if Multithreading.available then ()
110 else use "Concurrent/single_assignment_sequential.ML";
112 if Multithreading.available
113 then use "Concurrent/bash.ML"
114 else use "Concurrent/bash_sequential.ML";
116 use "Concurrent/par_exn.ML";
117 use "Concurrent/task_queue.ML";
118 use "Concurrent/future.ML";
119 use "Concurrent/event_timer.ML";
121 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
123 use "Concurrent/lazy.ML";
124 if Multithreading.available then ()
125 else use "Concurrent/lazy_sequential.ML";
127 use "Concurrent/par_list.ML";
128 if Multithreading.available then ()
129 else use "Concurrent/par_list_sequential.ML";
131 use "Concurrent/mailbox.ML";
132 use "Concurrent/cache.ML";
134 use "PIDE/active.ML";
137 (* fundamental structures *)
142 use "context_position.ML";
148 use "Syntax/type_annotation.ML";
149 use "Syntax/term_position.ML";
150 use "Syntax/lexicon.ML";
152 use "Syntax/syntax_ext.ML";
153 use "Syntax/parser.ML";
154 use "Syntax/syntax_trans.ML";
155 use "Syntax/mixfix.ML";
156 use "Syntax/printer.ML";
157 use "Syntax/syntax.ML";
160 (* core of tactical proof system *)
165 use "General/completion.ML";
166 use "General/name_space.ML";
170 use "Syntax/simple_syntax.ML";
175 use "primitive_defs.ML";
178 use "term_sharing.ML";
182 use "interpretation.ML";
187 use "global_theory.ML";
193 use "goal_display.ML";
197 use "raw_simplifier.ML";
198 use "conjunction.ML";
203 (* Isar -- Intelligible Semi-Automated Reasoning *)
205 (*ML support and global execution*)
206 use "ML/ml_syntax.ML";
208 use "ML/ml_options.ML";
209 use "ML/exn_output.ML";
210 if ML_System.is_polyml then use "ML/exn_output_polyml.ML" else ();
211 use "ML/ml_options.ML";
212 use "Isar/runtime.ML";
213 use "PIDE/execution.ML";
214 use "ML/ml_compiler.ML";
215 if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
221 use "Isar/object_logic.ML";
222 use "Isar/rule_cases.ML";
223 use "Isar/auto_bind.ML";
225 use "Syntax/local_syntax.ML";
226 use "Isar/proof_context.ML";
227 use "type_infer_context.ML";
228 use "Syntax/syntax_phases.ML";
229 use "Isar/local_defs.ML";
233 use "Isar/keyword.ML";
238 use "Thy/thy_header.ML";
239 use "Thy/thy_syntax.ML";
243 (*ML with context and antiquotations*)
244 use "ML/ml_context.ML";
245 use "ML/ml_antiquotation.ML";
248 ML_Context.eval_file (ML_Compiler.verbose true ML_Compiler.flags) (Path.explode s)
249 handle ERROR msg => (writeln msg; error "ML error");
253 (** bootstrap phase 2: towards Pure.thy and final ML toplevel setup *)
255 (*basic proof engine*)
256 use "Isar/proof_display.ML";
257 use "Isar/attrib.ML";
258 use "Isar/context_rules.ML";
259 use "Isar/method.ML";
261 use "Isar/element.ML";
262 use "Isar/obtain.ML";
264 (*local theories and targets*)
265 use "Isar/locale.ML";
266 use "Isar/local_theory.ML";
267 use "Isar/generic_target.ML";
268 use "Isar/overloading.ML";
271 use "Isar/named_target.ML";
272 use "Isar/expression.ML";
273 use "Isar/class_declaration.ML";
274 use "Isar/bundle.ML";
278 (*executable theory content*)
282 use "Isar/parse_spec.ML";
283 use "Isar/spec_rules.ML";
284 use "Isar/specification.ML";
285 use "Isar/typedecl.ML";
287 (*toplevel transactions*)
288 use "Isar/proof_node.ML";
289 use "Isar/toplevel.ML";
291 (*proof term operations*)
292 use "Proof/reconstruct.ML";
293 use "Proof/proof_syntax.ML";
294 use "Proof/proof_rewrite_rules.ML";
295 use "Proof/proof_checker.ML";
296 use "Proof/extraction.ML";
299 use "System/isabelle_system.ML";
300 use "Thy/term_style.ML";
301 use "Thy/thy_output.ML";
302 use "Isar/outer_syntax.ML";
303 use "General/graph_display.ML";
304 use "Thy/present.ML";
305 use "PIDE/command.ML";
306 use "PIDE/query_operation.ML";
307 use "PIDE/resources.ML";
308 use "Thy/thy_info.ML";
309 use "PIDE/document.ML";
311 (*theory and proof operations*)
312 use "Thy/thm_deps.ML";
313 use "Isar/isar_cmd.ML";
318 (* Isabelle/Isar system *)
320 use "PIDE/session.ML";
321 use "System/command_line.ML";
322 use "System/system_channel.ML";
323 use "System/message_channel.ML";
324 use "System/isabelle_process.ML";
325 use "System/invoke_scala.ML";
326 use "PIDE/protocol.ML";
327 use "System/isar.ML";
330 (* miscellaneous tools and packages for Pure Isabelle *)
332 use "Tools/build.ML";
333 use "Tools/named_thms.ML";
334 use "Tools/proof_general.ML";
336 structure Output: OUTPUT = Output; (*seal system channels!*)
339 (* ML toplevel pretty printing *)
341 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
342 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
343 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
344 toplevel_pp ["Position", "T"] "Pretty.position";
345 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
346 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
347 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
348 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
349 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
350 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
351 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
352 toplevel_pp ["Path", "T"] "Path.pretty";
353 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
354 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
355 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
356 toplevel_pp ["Morphism", "morphism"] "Morphism.pretty";
358 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
361 (* the Pure theory *)
364 Runtime.toplevel_program (fn () => Thy_Info.use_thy ("Pure", Position.none));
365 Context.set_thread_data NONE;
366 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
368 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
371 (* ML toplevel commands *)
374 Runtime.toplevel_program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
375 val use_thy = use_thys o single;
377 val cd = File.cd o Path.explode;
379 Proofterm.proofs := 0;