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