src/Pure/ROOT.ML
author wenzelm
Thu Feb 18 23:10:28 2016 +0100 (2016-02-18)
changeset 62359 6709e51d5c11
parent 62356 e307a410f46c
child 62459 7a5d88dd8cc9
permissions -rw-r--r--
unconditional Multithreading;
clarified files;
wenzelm@56288
     1
(*** Isabelle/Pure bootstrap from "RAW" environment ***)
wenzelm@56288
     2
wenzelm@56288
     3
(** bootstrap phase 0: towards secure ML barrier *)
clasohm@0
     4
wenzelm@26109
     5
structure Distribution =     (*filled-in by makedist*)
wenzelm@26109
     6
struct
wenzelm@32361
     7
  val version = "unidentified repository version";
wenzelm@57649
     8
  val is_identified = false;
wenzelm@27642
     9
  val is_official = false;
wenzelm@26109
    10
end;
wenzelm@11835
    11
wenzelm@31432
    12
wenzelm@31432
    13
(* library of general tools *)
wenzelm@31432
    14
wenzelm@21396
    15
use "General/basics.ML";
clasohm@0
    16
use "library.ML";
wenzelm@31432
    17
use "General/print_mode.ML";
wenzelm@31432
    18
use "General/alist.ML";
wenzelm@31432
    19
use "General/table.ML";
wenzelm@43684
    20
wenzelm@43684
    21
use "Concurrent/synchronized.ML";
wenzelm@52537
    22
use "Concurrent/counter.ML";
wenzelm@59172
    23
use "Concurrent/random.ML";
wenzelm@43684
    24
wenzelm@43746
    25
use "General/properties.ML";
wenzelm@31432
    26
use "General/output.ML";
wenzelm@45670
    27
use "PIDE/markup.ML";
wenzelm@31432
    28
use "General/scan.ML";
wenzelm@31432
    29
use "General/source.ML";
wenzelm@31432
    30
use "General/symbol.ML";
wenzelm@31432
    31
use "General/position.ML";
wenzelm@31432
    32
use "General/symbol_pos.ML";
wenzelm@59064
    33
use "General/input.ML";
wenzelm@31432
    34
use "General/antiquote.ML";
wenzelm@31432
    35
use "ML/ml_lex.ML";
wenzelm@31432
    36
use "ML/ml_parse.ML";
wenzelm@31432
    37
use "General/secure.ML";
wenzelm@56288
    38
wenzelm@56434
    39
val use_text = Secure.use_text;
wenzelm@56434
    40
val use_file = Secure.use_file;
wenzelm@56434
    41
wenzelm@60959
    42
fun use file =
wenzelm@60959
    43
  Position.setmp_thread_data (Position.file_only file)
wenzelm@60959
    44
    (fn () =>
wenzelm@60959
    45
      Secure.use_file ML_Parse.global_context {verbose = true, debug = false} file
wenzelm@60959
    46
        handle ERROR msg => (writeln msg; error "ML error")) ();
wenzelm@56434
    47
wenzelm@56288
    48
wenzelm@59054
    49
wenzelm@56288
    50
(** bootstrap phase 1: towards ML within Isar context *)
wenzelm@56288
    51
wenzelm@56288
    52
(* library of general tools *)
wenzelm@56288
    53
wenzelm@31432
    54
use "General/integer.ML";
wenzelm@31432
    55
use "General/stack.ML";
wenzelm@31432
    56
use "General/queue.ML";
wenzelm@31432
    57
use "General/heap.ML";
wenzelm@32015
    58
use "General/same.ML";
wenzelm@31432
    59
use "General/ord_list.ML";
wenzelm@31432
    60
use "General/balanced_tree.ML";
wenzelm@38448
    61
use "General/linear_set.ML";
wenzelm@43593
    62
use "General/buffer.ML";
wenzelm@43791
    63
use "General/pretty.ML";
wenzelm@59363
    64
use "PIDE/xml.ML";
wenzelm@31432
    65
use "General/path.ML";
wenzelm@31432
    66
use "General/url.ML";
wenzelm@31432
    67
use "General/file.ML";
wenzelm@43547
    68
use "General/long_name.ML";
wenzelm@43547
    69
use "General/binding.ML";
wenzelm@50800
    70
use "General/socket_io.ML";
wenzelm@56287
    71
use "General/seq.ML";
wenzelm@56287
    72
use "General/timing.ML";
wenzelm@22592
    73
wenzelm@35628
    74
use "General/sha1.ML";
wenzelm@62354
    75
use "General/sha1_polyml.ML";
wenzelm@53212
    76
use "General/sha1_samples.ML";
wenzelm@35628
    77
wenzelm@44698
    78
use "PIDE/yxml.ML";
wenzelm@56303
    79
use "PIDE/document_id.ML";
wenzelm@44698
    80
wenzelm@56053
    81
use "General/change_table.ML";
wenzelm@49560
    82
use "General/graph.ML";
wenzelm@49560
    83
wenzelm@60911
    84
wenzelm@60911
    85
(* fundamental structures *)
wenzelm@60911
    86
wenzelm@60911
    87
use "name.ML";
wenzelm@60911
    88
use "term.ML";
wenzelm@60911
    89
use "context.ML";
wenzelm@60911
    90
use "context_position.ML";
wenzelm@51947
    91
use "System/options.ML";
wenzelm@60911
    92
use "config.ML";
wenzelm@51947
    93
wenzelm@31432
    94
wenzelm@31432
    95
(* concurrency within the ML runtime *)
wenzelm@28120
    96
wenzelm@62355
    97
use "ML/exn_properties.ML";
wenzelm@50911
    98
wenzelm@54717
    99
if ML_System.name = "polyml-5.5.0"
wenzelm@54717
   100
  orelse ML_System.name = "polyml-5.5.1"
wenzelm@54717
   101
  orelse ML_System.name = "polyml-5.5.2"
wenzelm@61715
   102
  orelse ML_System.name = "polyml-5.6"
wenzelm@50255
   103
then use "ML/ml_statistics_polyml-5.5.0.ML"
wenzelm@50255
   104
else use "ML/ml_statistics_dummy.ML";
wenzelm@50255
   105
wenzelm@61556
   106
use "Concurrent/standard_thread.ML";
wenzelm@62359
   107
use "Concurrent/single_assignment.ML";
wenzelm@59054
   108
wenzelm@62359
   109
if ML_System.platform_is_windows
wenzelm@62359
   110
then use "Concurrent/bash_windows.ML"
wenzelm@60962
   111
else use "Concurrent/bash.ML";
wenzelm@40748
   112
wenzelm@44247
   113
use "Concurrent/par_exn.ML";
wenzelm@31432
   114
use "Concurrent/task_queue.ML";
wenzelm@31432
   115
use "Concurrent/future.ML";
wenzelm@52798
   116
use "Concurrent/event_timer.ML";
wenzelm@62354
   117
use "Concurrent/time_limit.ML";
wenzelm@32815
   118
use "Concurrent/lazy.ML";
wenzelm@31432
   119
use "Concurrent/par_list.ML";
wenzelm@31432
   120
wenzelm@44247
   121
use "Concurrent/mailbox.ML";
wenzelm@32840
   122
use "Concurrent/cache.ML";
wenzelm@32840
   123
wenzelm@50500
   124
use "PIDE/active.ML";
wenzelm@50500
   125
wenzelm@31432
   126
wenzelm@31432
   127
(* inner syntax *)
wenzelm@31432
   128
wenzelm@52211
   129
use "Syntax/type_annotation.ML";
wenzelm@42264
   130
use "Syntax/term_position.ML";
wenzelm@42264
   131
use "Syntax/lexicon.ML";
wenzelm@22679
   132
use "Syntax/ast.ML";
wenzelm@42288
   133
use "Syntax/syntax_ext.ML";
wenzelm@22679
   134
use "Syntax/parser.ML";
wenzelm@42284
   135
use "Syntax/syntax_trans.ML";
wenzelm@22679
   136
use "Syntax/mixfix.ML";
wenzelm@22679
   137
use "Syntax/printer.ML";
wenzelm@22679
   138
use "Syntax/syntax.ML";
wenzelm@22679
   139
wenzelm@31432
   140
wenzelm@31432
   141
(* core of tactical proof system *)
wenzelm@31432
   142
wenzelm@42382
   143
use "term_ord.ML";
wenzelm@42382
   144
use "term_subst.ML";
wenzelm@43729
   145
use "term_xml.ML";
wenzelm@55672
   146
use "General/completion.ML";
wenzelm@42382
   147
use "General/name_space.ML";
wenzelm@42382
   148
use "sorts.ML";
wenzelm@42382
   149
use "type.ML";
wenzelm@42382
   150
use "logic.ML";
wenzelm@42382
   151
use "Syntax/simple_syntax.ML";
wenzelm@30559
   152
use "net.ML";
wenzelm@30559
   153
use "item_net.ML";
wenzelm@18934
   154
use "envir.ML";
wenzelm@18059
   155
use "consts.ML";
wenzelm@24257
   156
use "primitive_defs.ML";
wenzelm@61261
   157
use "sign.ML";
haftmann@27546
   158
use "defs.ML";
wenzelm@43795
   159
use "term_sharing.ML";
clasohm@0
   160
use "pattern.ML";
clasohm@0
   161
use "unify.ML";
paulson@1528
   162
use "theory.ML";
berghofe@11511
   163
use "proofterm.ML";
clasohm@0
   164
use "thm.ML";
wenzelm@59026
   165
use "more_pattern.ML";
wenzelm@59026
   166
use "more_unify.ML";
wenzelm@22361
   167
use "more_thm.ML";
wenzelm@26279
   168
use "facts.ML";
wenzelm@39557
   169
use "global_theory.ML";
wenzelm@3986
   170
use "pure_thy.ML";
clasohm@0
   171
use "drule.ML";
wenzelm@22233
   172
use "morphism.ML";
wenzelm@19898
   173
use "variable.ML";
wenzelm@24833
   174
use "conv.ML";
wenzelm@32187
   175
use "goal_display.ML";
wenzelm@32169
   176
use "tactical.ML";
paulson@1582
   177
use "search.ML";
wenzelm@21708
   178
use "tactic.ML";
wenzelm@41228
   179
use "raw_simplifier.ML";
wenzelm@19417
   180
use "conjunction.ML";
wenzelm@20225
   181
use "assumption.ML";
clasohm@0
   182
wenzelm@31432
   183
wenzelm@31432
   184
(* Isar -- Intelligible Semi-Automated Reasoning *)
wenzelm@31432
   185
wenzelm@56303
   186
(*ML support and global execution*)
wenzelm@49041
   187
use "ML/ml_syntax.ML";
wenzelm@49041
   188
use "ML/ml_env.ML";
wenzelm@56303
   189
use "ML/ml_options.ML";
wenzelm@62355
   190
use "ML/exn_output.ML";
wenzelm@56303
   191
use "ML/ml_options.ML";
wenzelm@49041
   192
use "Isar/runtime.ML";
wenzelm@56303
   193
use "PIDE/execution.ML";
wenzelm@62355
   194
use "ML/ml_compiler.ML";
wenzelm@49041
   195
wenzelm@51551
   196
use "skip_proof.ML";
wenzelm@49041
   197
use "goal.ML";
wenzelm@49041
   198
wenzelm@31432
   199
(*proof context*)
wenzelm@31432
   200
use "Isar/object_logic.ML";
wenzelm@31432
   201
use "Isar/rule_cases.ML";
wenzelm@31432
   202
use "Isar/auto_bind.ML";
wenzelm@42241
   203
use "type_infer.ML";
wenzelm@42240
   204
use "Syntax/local_syntax.ML";
wenzelm@31432
   205
use "Isar/proof_context.ML";
wenzelm@42405
   206
use "type_infer_context.ML";
wenzelm@42243
   207
use "Syntax/syntax_phases.ML";
wenzelm@31432
   208
use "Isar/local_defs.ML";
wenzelm@31432
   209
wenzelm@31432
   210
(*outer syntax*)
wenzelm@58903
   211
use "Isar/keyword.ML";
wenzelm@36959
   212
use "Isar/token.ML";
wenzelm@36949
   213
use "Isar/parse.ML";
wenzelm@31432
   214
use "Isar/args.ML";
wenzelm@31432
   215
wenzelm@57926
   216
(*theory specifications*)
wenzelm@57926
   217
use "Isar/local_theory.ML";
wenzelm@31432
   218
use "Thy/thy_header.ML";
wenzelm@57905
   219
use "PIDE/command_span.ML";
wenzelm@51265
   220
use "Thy/thy_syntax.ML";
wenzelm@61454
   221
use "Thy/markdown.ML";
wenzelm@31432
   222
use "Thy/html.ML";
wenzelm@31432
   223
use "Thy/latex.ML";
wenzelm@31432
   224
wenzelm@56203
   225
(*ML with context and antiquotations*)
wenzelm@56203
   226
use "ML/ml_context.ML";
wenzelm@56205
   227
use "ML/ml_antiquotation.ML";
wenzelm@56288
   228
wenzelm@60959
   229
fun use s =
wenzelm@60959
   230
  ML_Context.eval_file (ML_Compiler.verbose true ML_Compiler.flags) (Path.explode s)
wenzelm@60959
   231
    handle ERROR msg => (writeln msg; error "ML error");
wenzelm@56434
   232
wenzelm@56288
   233
wenzelm@56288
   234
wenzelm@56288
   235
(** bootstrap phase 2: towards Pure.thy and final ML toplevel setup *)
wenzelm@56203
   236
wenzelm@31432
   237
(*basic proof engine*)
wenzelm@58009
   238
use "par_tactical.ML";
wenzelm@31432
   239
use "Isar/proof_display.ML";
wenzelm@31432
   240
use "Isar/attrib.ML";
wenzelm@31432
   241
use "Isar/context_rules.ML";
wenzelm@31432
   242
use "Isar/method.ML";
wenzelm@31432
   243
use "Isar/proof.ML";
wenzelm@31432
   244
use "Isar/element.ML";
wenzelm@31432
   245
use "Isar/obtain.ML";
wenzelm@60630
   246
use "Isar/subgoal.ML";
wenzelm@31432
   247
wenzelm@31432
   248
(*local theories and targets*)
haftmann@52140
   249
use "Isar/locale.ML";
haftmann@38307
   250
use "Isar/generic_target.ML";
wenzelm@31432
   251
use "Isar/overloading.ML";
wenzelm@35669
   252
use "axclass.ML";
haftmann@38379
   253
use "Isar/class.ML";
haftmann@38350
   254
use "Isar/named_target.ML";
wenzelm@31432
   255
use "Isar/expression.ML";
haftmann@61669
   256
use "Isar/interpretation.ML";
haftmann@38379
   257
use "Isar/class_declaration.ML";
wenzelm@47057
   258
use "Isar/bundle.ML";
wenzelm@59901
   259
use "Isar/experiment.ML";
wenzelm@31432
   260
wenzelm@31432
   261
use "simplifier.ML";
wenzelm@58660
   262
use "Tools/plugin.ML";
wenzelm@31432
   263
wenzelm@31432
   264
(*executable theory content*)
wenzelm@31432
   265
use "Isar/code.ML";
wenzelm@31432
   266
wenzelm@31432
   267
(*specifications*)
wenzelm@36952
   268
use "Isar/parse_spec.ML";
wenzelm@33374
   269
use "Isar/spec_rules.ML";
wenzelm@31432
   270
use "Isar/specification.ML";
wenzelm@35626
   271
use "Isar/typedecl.ML";
wenzelm@31432
   272
wenzelm@31432
   273
(*toplevel transactions*)
wenzelm@31432
   274
use "Isar/proof_node.ML";
wenzelm@31432
   275
use "Isar/toplevel.ML";
wenzelm@31432
   276
wenzelm@56206
   277
(*proof term operations*)
wenzelm@56206
   278
use "Proof/reconstruct.ML";
wenzelm@56206
   279
use "Proof/proof_syntax.ML";
wenzelm@56206
   280
use "Proof/proof_rewrite_rules.ML";
wenzelm@56206
   281
use "Proof/proof_checker.ML";
wenzelm@56206
   282
use "Proof/extraction.ML";
wenzelm@56206
   283
wenzelm@38271
   284
(*theory documents*)
wenzelm@40743
   285
use "System/isabelle_system.ML";
wenzelm@31432
   286
use "Thy/term_style.ML";
wenzelm@58928
   287
use "Isar/outer_syntax.ML";
wenzelm@31432
   288
use "Thy/thy_output.ML";
wenzelm@61619
   289
use "Thy/document_antiquotations.ML";
wenzelm@49561
   290
use "General/graph_display.ML";
wenzelm@43712
   291
use "Thy/present.ML";
wenzelm@58928
   292
use "pure_syn.ML";
wenzelm@52510
   293
use "PIDE/command.ML";
wenzelm@52865
   294
use "PIDE/query_operation.ML";
wenzelm@56208
   295
use "PIDE/resources.ML";
wenzelm@31432
   296
use "Thy/thy_info.ML";
wenzelm@59086
   297
use "PIDE/session.ML";
wenzelm@59714
   298
use "PIDE/protocol_message.ML";
wenzelm@44185
   299
use "PIDE/document.ML";
wenzelm@31432
   300
wenzelm@31432
   301
(*theory and proof operations*)
wenzelm@31432
   302
use "Isar/isar_cmd.ML";
wenzelm@31432
   303
wenzelm@31432
   304
wenzelm@31432
   305
(* Isabelle/Isar system *)
wenzelm@31432
   306
wenzelm@48681
   307
use "System/command_line.ML";
wenzelm@45029
   308
use "System/system_channel.ML";
wenzelm@52584
   309
use "System/message_channel.ML";
wenzelm@38412
   310
use "System/isabelle_process.ML";
wenzelm@43748
   311
use "System/invoke_scala.ML";
wenzelm@45709
   312
use "PIDE/protocol.ML";
wenzelm@30173
   313
wenzelm@31432
   314
wenzelm@31432
   315
(* miscellaneous tools and packages for Pure Isabelle *)
wenzelm@31432
   316
wenzelm@50686
   317
use "Tools/build.ML";
wenzelm@31432
   318
use "Tools/named_thms.ML";
wenzelm@31432
   319
wenzelm@55387
   320
structure Output: OUTPUT = Output;  (*seal system channels!*)
wenzelm@55387
   321
wenzelm@31432
   322
wenzelm@62354
   323
use "ML/install_pp_polyml.ML";
wenzelm@48732
   324
wenzelm@48732
   325
wenzelm@49862
   326
(* the Pure theory *)
wenzelm@49862
   327
wenzelm@58928
   328
use "ML/ml_file.ML";
wenzelm@56303
   329
Runtime.toplevel_program (fn () => Thy_Info.use_thy ("Pure", Position.none));
wenzelm@49862
   330
Context.set_thread_data NONE;
wenzelm@60937
   331
structure Pure = struct val thy = Thy_Info.pure_theory () end;
wenzelm@49862
   332
wenzelm@49862
   333
wenzelm@48879
   334
(* ML toplevel commands *)
wenzelm@48879
   335
wenzelm@56303
   336
fun use_thys args =
wenzelm@56303
   337
  Runtime.toplevel_program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
wenzelm@48927
   338
val use_thy = use_thys o single;
wenzelm@48732
   339
wenzelm@48732
   340
val cd = File.cd o Path.explode;
wenzelm@48732
   341
wenzelm@52487
   342
Proofterm.proofs := 0;