src/Pure/ROOT.ML
author wenzelm
Thu Mar 03 11:12:02 2016 +0100 (2016-03-03)
changeset 62501 98fa1f9a292f
parent 62498 5dfcc9697f29
child 62508 d0b68218ea55
permissions -rw-r--r--
discontinued polyml-5.3.0;
wenzelm@56288
     1
(*** Isabelle/Pure bootstrap from "RAW" environment ***)
wenzelm@56288
     2
wenzelm@62493
     3
(** bootstrap phase 0: towards ML within position context *)
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@56288
    36
wenzelm@62493
    37
val {use, use_debug, use_no_debug} =
wenzelm@62493
    38
  let
wenzelm@62494
    39
    val context: ML_Compiler0.context =
wenzelm@62493
    40
     {name_space = ML_Name_Space.global,
wenzelm@62493
    41
      here = Position.here oo Position.line_file,
wenzelm@62493
    42
      print = writeln,
wenzelm@62494
    43
      error = error};
wenzelm@62493
    44
  in
wenzelm@62494
    45
    ML_Compiler0.use_operations (fn opt_debug => fn file =>
wenzelm@62493
    46
      Position.setmp_thread_data (Position.file_only file)
wenzelm@62493
    47
        (fn () =>
wenzelm@62494
    48
          ML_Compiler0.use_file context
wenzelm@62494
    49
            {verbose = true, debug = ML_Compiler0.debug_option opt_debug} file
wenzelm@62494
    50
          handle ERROR msg => (writeln msg; error "ML error")) ())
wenzelm@62493
    51
  end;
wenzelm@56434
    52
wenzelm@56288
    53
wenzelm@59054
    54
wenzelm@56288
    55
(** bootstrap phase 1: towards ML within Isar context *)
wenzelm@56288
    56
wenzelm@56288
    57
(* library of general tools *)
wenzelm@56288
    58
wenzelm@31432
    59
use "General/integer.ML";
wenzelm@31432
    60
use "General/stack.ML";
wenzelm@31432
    61
use "General/queue.ML";
wenzelm@31432
    62
use "General/heap.ML";
wenzelm@32015
    63
use "General/same.ML";
wenzelm@31432
    64
use "General/ord_list.ML";
wenzelm@31432
    65
use "General/balanced_tree.ML";
wenzelm@38448
    66
use "General/linear_set.ML";
wenzelm@43593
    67
use "General/buffer.ML";
wenzelm@43791
    68
use "General/pretty.ML";
wenzelm@59363
    69
use "PIDE/xml.ML";
wenzelm@31432
    70
use "General/path.ML";
wenzelm@31432
    71
use "General/url.ML";
wenzelm@31432
    72
use "General/file.ML";
wenzelm@43547
    73
use "General/long_name.ML";
wenzelm@43547
    74
use "General/binding.ML";
wenzelm@50800
    75
use "General/socket_io.ML";
wenzelm@56287
    76
use "General/seq.ML";
wenzelm@56287
    77
use "General/timing.ML";
wenzelm@22592
    78
wenzelm@35628
    79
use "General/sha1.ML";
wenzelm@62354
    80
use "General/sha1_polyml.ML";
wenzelm@53212
    81
use "General/sha1_samples.ML";
wenzelm@35628
    82
wenzelm@44698
    83
use "PIDE/yxml.ML";
wenzelm@56303
    84
use "PIDE/document_id.ML";
wenzelm@44698
    85
wenzelm@56053
    86
use "General/change_table.ML";
wenzelm@49560
    87
use "General/graph.ML";
wenzelm@49560
    88
wenzelm@60911
    89
wenzelm@60911
    90
(* fundamental structures *)
wenzelm@60911
    91
wenzelm@60911
    92
use "name.ML";
wenzelm@60911
    93
use "term.ML";
wenzelm@60911
    94
use "context.ML";
wenzelm@60911
    95
use "context_position.ML";
wenzelm@51947
    96
use "System/options.ML";
wenzelm@60911
    97
use "config.ML";
wenzelm@51947
    98
wenzelm@31432
    99
wenzelm@31432
   100
(* concurrency within the ML runtime *)
wenzelm@28120
   101
wenzelm@62355
   102
use "ML/exn_properties.ML";
wenzelm@50911
   103
wenzelm@62501
   104
use "ML/ml_statistics.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@62498
   191
use_no_debug "ML/exn_debugger.ML";
wenzelm@56303
   192
use "ML/ml_options.ML";
wenzelm@62498
   193
use_no_debug "Isar/runtime.ML";
wenzelm@56303
   194
use "PIDE/execution.ML";
wenzelm@62355
   195
use "ML/ml_compiler.ML";
wenzelm@49041
   196
wenzelm@51551
   197
use "skip_proof.ML";
wenzelm@49041
   198
use "goal.ML";
wenzelm@49041
   199
wenzelm@31432
   200
(*proof context*)
wenzelm@31432
   201
use "Isar/object_logic.ML";
wenzelm@31432
   202
use "Isar/rule_cases.ML";
wenzelm@31432
   203
use "Isar/auto_bind.ML";
wenzelm@42241
   204
use "type_infer.ML";
wenzelm@42240
   205
use "Syntax/local_syntax.ML";
wenzelm@31432
   206
use "Isar/proof_context.ML";
wenzelm@42405
   207
use "type_infer_context.ML";
wenzelm@42243
   208
use "Syntax/syntax_phases.ML";
wenzelm@31432
   209
use "Isar/local_defs.ML";
wenzelm@31432
   210
wenzelm@31432
   211
(*outer syntax*)
wenzelm@58903
   212
use "Isar/keyword.ML";
wenzelm@36959
   213
use "Isar/token.ML";
wenzelm@36949
   214
use "Isar/parse.ML";
wenzelm@31432
   215
use "Isar/args.ML";
wenzelm@31432
   216
wenzelm@57926
   217
(*theory specifications*)
wenzelm@57926
   218
use "Isar/local_theory.ML";
wenzelm@31432
   219
use "Thy/thy_header.ML";
wenzelm@57905
   220
use "PIDE/command_span.ML";
wenzelm@51265
   221
use "Thy/thy_syntax.ML";
wenzelm@61454
   222
use "Thy/markdown.ML";
wenzelm@31432
   223
use "Thy/html.ML";
wenzelm@31432
   224
use "Thy/latex.ML";
wenzelm@31432
   225
wenzelm@56203
   226
(*ML with context and antiquotations*)
wenzelm@56203
   227
use "ML/ml_context.ML";
wenzelm@56205
   228
use "ML/ml_antiquotation.ML";
wenzelm@56288
   229
wenzelm@62493
   230
val {use, use_debug, use_no_debug} =
wenzelm@62494
   231
  ML_Compiler0.use_operations (fn opt_debug => fn file =>
wenzelm@62493
   232
    let val flags = ML_Compiler.verbose true (ML_Compiler.debug_flags opt_debug) in
wenzelm@62490
   233
      ML_Context.eval_file flags (Path.explode file)
wenzelm@62490
   234
        handle ERROR msg => (writeln msg; error "ML error")
wenzelm@62493
   235
    end);
wenzelm@56434
   236
wenzelm@56288
   237
wenzelm@56288
   238
wenzelm@56288
   239
(** bootstrap phase 2: towards Pure.thy and final ML toplevel setup *)
wenzelm@56203
   240
wenzelm@31432
   241
(*basic proof engine*)
wenzelm@58009
   242
use "par_tactical.ML";
wenzelm@31432
   243
use "Isar/proof_display.ML";
wenzelm@31432
   244
use "Isar/attrib.ML";
wenzelm@31432
   245
use "Isar/context_rules.ML";
wenzelm@31432
   246
use "Isar/method.ML";
wenzelm@31432
   247
use "Isar/proof.ML";
wenzelm@31432
   248
use "Isar/element.ML";
wenzelm@31432
   249
use "Isar/obtain.ML";
wenzelm@60630
   250
use "Isar/subgoal.ML";
wenzelm@31432
   251
wenzelm@31432
   252
(*local theories and targets*)
haftmann@52140
   253
use "Isar/locale.ML";
haftmann@38307
   254
use "Isar/generic_target.ML";
wenzelm@31432
   255
use "Isar/overloading.ML";
wenzelm@35669
   256
use "axclass.ML";
haftmann@38379
   257
use "Isar/class.ML";
haftmann@38350
   258
use "Isar/named_target.ML";
wenzelm@31432
   259
use "Isar/expression.ML";
haftmann@61669
   260
use "Isar/interpretation.ML";
haftmann@38379
   261
use "Isar/class_declaration.ML";
wenzelm@47057
   262
use "Isar/bundle.ML";
wenzelm@59901
   263
use "Isar/experiment.ML";
wenzelm@31432
   264
wenzelm@31432
   265
use "simplifier.ML";
wenzelm@58660
   266
use "Tools/plugin.ML";
wenzelm@31432
   267
wenzelm@31432
   268
(*executable theory content*)
wenzelm@31432
   269
use "Isar/code.ML";
wenzelm@31432
   270
wenzelm@31432
   271
(*specifications*)
wenzelm@36952
   272
use "Isar/parse_spec.ML";
wenzelm@33374
   273
use "Isar/spec_rules.ML";
wenzelm@31432
   274
use "Isar/specification.ML";
wenzelm@35626
   275
use "Isar/typedecl.ML";
wenzelm@31432
   276
wenzelm@31432
   277
(*toplevel transactions*)
wenzelm@31432
   278
use "Isar/proof_node.ML";
wenzelm@31432
   279
use "Isar/toplevel.ML";
wenzelm@31432
   280
wenzelm@56206
   281
(*proof term operations*)
wenzelm@56206
   282
use "Proof/reconstruct.ML";
wenzelm@56206
   283
use "Proof/proof_syntax.ML";
wenzelm@56206
   284
use "Proof/proof_rewrite_rules.ML";
wenzelm@56206
   285
use "Proof/proof_checker.ML";
wenzelm@56206
   286
use "Proof/extraction.ML";
wenzelm@56206
   287
wenzelm@38271
   288
(*theory documents*)
wenzelm@40743
   289
use "System/isabelle_system.ML";
wenzelm@31432
   290
use "Thy/term_style.ML";
wenzelm@58928
   291
use "Isar/outer_syntax.ML";
wenzelm@31432
   292
use "Thy/thy_output.ML";
wenzelm@61619
   293
use "Thy/document_antiquotations.ML";
wenzelm@49561
   294
use "General/graph_display.ML";
wenzelm@43712
   295
use "Thy/present.ML";
wenzelm@58928
   296
use "pure_syn.ML";
wenzelm@52510
   297
use "PIDE/command.ML";
wenzelm@52865
   298
use "PIDE/query_operation.ML";
wenzelm@56208
   299
use "PIDE/resources.ML";
wenzelm@31432
   300
use "Thy/thy_info.ML";
wenzelm@59086
   301
use "PIDE/session.ML";
wenzelm@59714
   302
use "PIDE/protocol_message.ML";
wenzelm@44185
   303
use "PIDE/document.ML";
wenzelm@31432
   304
wenzelm@31432
   305
(*theory and proof operations*)
wenzelm@31432
   306
use "Isar/isar_cmd.ML";
wenzelm@31432
   307
wenzelm@31432
   308
wenzelm@31432
   309
(* Isabelle/Isar system *)
wenzelm@31432
   310
wenzelm@48681
   311
use "System/command_line.ML";
wenzelm@45029
   312
use "System/system_channel.ML";
wenzelm@52584
   313
use "System/message_channel.ML";
wenzelm@38412
   314
use "System/isabelle_process.ML";
wenzelm@43748
   315
use "System/invoke_scala.ML";
wenzelm@45709
   316
use "PIDE/protocol.ML";
wenzelm@30173
   317
wenzelm@31432
   318
wenzelm@31432
   319
(* miscellaneous tools and packages for Pure Isabelle *)
wenzelm@31432
   320
wenzelm@50686
   321
use "Tools/build.ML";
wenzelm@31432
   322
use "Tools/named_thms.ML";
wenzelm@31432
   323
wenzelm@55387
   324
structure Output: OUTPUT = Output;  (*seal system channels!*)
wenzelm@55387
   325
wenzelm@31432
   326
wenzelm@62354
   327
use "ML/install_pp_polyml.ML";
wenzelm@48732
   328
wenzelm@48732
   329
wenzelm@49862
   330
(* the Pure theory *)
wenzelm@49862
   331
wenzelm@58928
   332
use "ML/ml_file.ML";
wenzelm@56303
   333
Runtime.toplevel_program (fn () => Thy_Info.use_thy ("Pure", Position.none));
wenzelm@49862
   334
Context.set_thread_data NONE;
wenzelm@60937
   335
structure Pure = struct val thy = Thy_Info.pure_theory () end;
wenzelm@49862
   336
wenzelm@49862
   337
wenzelm@48879
   338
(* ML toplevel commands *)
wenzelm@48879
   339
wenzelm@56303
   340
fun use_thys args =
wenzelm@56303
   341
  Runtime.toplevel_program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
wenzelm@48927
   342
val use_thy = use_thys o single;
wenzelm@48732
   343
wenzelm@48732
   344
val cd = File.cd o Path.explode;
wenzelm@48732
   345
wenzelm@52487
   346
Proofterm.proofs := 0;