src/Pure/ROOT.ML
author wenzelm
Mon Feb 25 10:18:33 2013 +0100 (2013-02-25)
changeset 51265 6a3191767ecb
parent 50911 ee7fe4230642
child 51551 88d1d19fb74f
permissions -rw-r--r--
tuned order of modules;
wenzelm@31432
     1
(** Pure Isabelle **)
clasohm@0
     2
wenzelm@26109
     3
structure Distribution =     (*filled-in by makedist*)
wenzelm@26109
     4
struct
wenzelm@32361
     5
  val version = "unidentified repository version";
wenzelm@27642
     6
  val is_official = false;
wenzelm@26109
     7
end;
wenzelm@11835
     8
wenzelm@23825
     9
(*if true then some tools will OMIT some proofs*)
wenzelm@32738
    10
val quick_and_dirty = Unsynchronized.ref false;
wenzelm@23825
    11
wenzelm@12248
    12
print_depth 10;
clasohm@0
    13
wenzelm@31432
    14
wenzelm@31432
    15
(* library of general tools *)
wenzelm@31432
    16
wenzelm@21396
    17
use "General/basics.ML";
clasohm@0
    18
use "library.ML";
wenzelm@31432
    19
use "General/print_mode.ML";
wenzelm@31432
    20
use "General/alist.ML";
wenzelm@31432
    21
use "General/table.ML";
wenzelm@43684
    22
wenzelm@43684
    23
use "Concurrent/simple_thread.ML";
wenzelm@43684
    24
wenzelm@43684
    25
use "Concurrent/synchronized.ML";
wenzelm@43684
    26
if Multithreading.available then ()
wenzelm@43684
    27
else use "Concurrent/synchronized_sequential.ML";
wenzelm@43684
    28
wenzelm@43746
    29
use "General/properties.ML";
wenzelm@31432
    30
use "General/output.ML";
wenzelm@42012
    31
use "General/timing.ML";
wenzelm@45670
    32
use "PIDE/markup.ML";
wenzelm@50201
    33
fun legacy_feature s = warning (Markup.markup Markup.legacy ("Legacy feature! " ^ s));
wenzelm@31432
    34
use "General/scan.ML";
wenzelm@31432
    35
use "General/source.ML";
wenzelm@31432
    36
use "General/symbol.ML";
wenzelm@31432
    37
use "General/seq.ML";
wenzelm@31432
    38
use "General/position.ML";
wenzelm@31432
    39
use "General/symbol_pos.ML";
wenzelm@31432
    40
use "General/antiquote.ML";
wenzelm@31432
    41
use "ML/ml_lex.ML";
wenzelm@31432
    42
use "ML/ml_parse.ML";
wenzelm@31432
    43
use "General/secure.ML";
wenzelm@32015
    44
(*^^^^^ end of basic ML bootstrap ^^^^^*)
wenzelm@31432
    45
use "General/integer.ML";
wenzelm@31432
    46
use "General/stack.ML";
wenzelm@31432
    47
use "General/queue.ML";
wenzelm@31432
    48
use "General/heap.ML";
wenzelm@32015
    49
use "General/same.ML";
wenzelm@31432
    50
use "General/ord_list.ML";
wenzelm@31432
    51
use "General/balanced_tree.ML";
wenzelm@38448
    52
use "General/linear_set.ML";
wenzelm@43593
    53
use "General/buffer.ML";
wenzelm@43791
    54
use "General/pretty.ML";
wenzelm@31432
    55
use "General/path.ML";
wenzelm@31432
    56
use "General/url.ML";
wenzelm@31432
    57
use "General/file.ML";
wenzelm@43547
    58
use "General/long_name.ML";
wenzelm@43547
    59
use "General/binding.ML";
wenzelm@50800
    60
use "General/socket_io.ML";
wenzelm@22592
    61
wenzelm@35628
    62
use "General/sha1.ML";
wenzelm@43948
    63
if ML_System.is_polyml then use "General/sha1_polyml.ML" else ();
wenzelm@35628
    64
wenzelm@44698
    65
use "PIDE/xml.ML";
wenzelm@44698
    66
use "PIDE/yxml.ML";
wenzelm@44698
    67
wenzelm@49560
    68
use "General/graph.ML";
wenzelm@49560
    69
wenzelm@31432
    70
wenzelm@31432
    71
(* concurrency within the ML runtime *)
wenzelm@28120
    72
wenzelm@50911
    73
if ML_System.is_polyml
wenzelm@50911
    74
then use "ML/exn_properties_polyml.ML"
wenzelm@50911
    75
else use "ML/exn_properties_dummy.ML";
wenzelm@50911
    76
wenzelm@50255
    77
if ML_System.name = "polyml-5.5.0"
wenzelm@50255
    78
then use "ML/ml_statistics_polyml-5.5.0.ML"
wenzelm@50255
    79
else use "ML/ml_statistics_dummy.ML";
wenzelm@50255
    80
wenzelm@35014
    81
use "Concurrent/single_assignment.ML";
wenzelm@35014
    82
if Multithreading.available then ()
wenzelm@35014
    83
else use "Concurrent/single_assignment_sequential.ML";
wenzelm@35014
    84
wenzelm@47980
    85
if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
wenzelm@41710
    86
wenzelm@40748
    87
if Multithreading.available
wenzelm@40748
    88
then use "Concurrent/bash.ML"
wenzelm@40748
    89
else use "Concurrent/bash_sequential.ML";
wenzelm@40748
    90
wenzelm@44247
    91
use "Concurrent/par_exn.ML";
wenzelm@31432
    92
use "Concurrent/task_queue.ML";
wenzelm@31432
    93
use "Concurrent/future.ML";
wenzelm@32840
    94
wenzelm@32815
    95
use "Concurrent/lazy.ML";
wenzelm@32815
    96
if Multithreading.available then ()
wenzelm@32815
    97
else use "Concurrent/lazy_sequential.ML";
wenzelm@32840
    98
wenzelm@31432
    99
use "Concurrent/par_list.ML";
wenzelm@32815
   100
if Multithreading.available then ()
wenzelm@32816
   101
else use "Concurrent/par_list_sequential.ML";
wenzelm@31432
   102
wenzelm@44247
   103
use "Concurrent/mailbox.ML";
wenzelm@32840
   104
use "Concurrent/cache.ML";
wenzelm@32840
   105
wenzelm@50500
   106
use "PIDE/active.ML";
wenzelm@50500
   107
wenzelm@31432
   108
wenzelm@31432
   109
(* fundamental structures *)
wenzelm@31432
   110
wenzelm@20075
   111
use "name.ML";
clasohm@0
   112
use "term.ML";
wenzelm@28404
   113
use "context.ML";
wenzelm@47813
   114
use "context_position.ML";
wenzelm@39508
   115
use "config.ML";
wenzelm@48456
   116
use "System/options.ML";
wenzelm@19
   117
wenzelm@31432
   118
wenzelm@31432
   119
(* inner syntax *)
wenzelm@31432
   120
wenzelm@42264
   121
use "Syntax/term_position.ML";
wenzelm@42264
   122
use "Syntax/lexicon.ML";
wenzelm@22679
   123
use "Syntax/ast.ML";
wenzelm@42288
   124
use "Syntax/syntax_ext.ML";
wenzelm@22679
   125
use "Syntax/parser.ML";
wenzelm@42284
   126
use "Syntax/syntax_trans.ML";
wenzelm@22679
   127
use "Syntax/mixfix.ML";
wenzelm@22679
   128
use "Syntax/printer.ML";
wenzelm@22679
   129
use "Syntax/syntax.ML";
wenzelm@22679
   130
wenzelm@31432
   131
wenzelm@31432
   132
(* core of tactical proof system *)
wenzelm@31432
   133
wenzelm@42382
   134
use "term_ord.ML";
wenzelm@42382
   135
use "term_subst.ML";
wenzelm@43729
   136
use "term_xml.ML";
wenzelm@42382
   137
use "General/name_space.ML";
wenzelm@42382
   138
use "sorts.ML";
wenzelm@42382
   139
use "type.ML";
wenzelm@42382
   140
use "logic.ML";
wenzelm@42382
   141
use "Syntax/simple_syntax.ML";
wenzelm@30559
   142
use "net.ML";
wenzelm@30559
   143
use "item_net.ML";
wenzelm@18934
   144
use "envir.ML";
wenzelm@18059
   145
use "consts.ML";
wenzelm@24257
   146
use "primitive_defs.ML";
haftmann@27546
   147
use "defs.ML";
clasohm@0
   148
use "sign.ML";
wenzelm@43795
   149
use "term_sharing.ML";
clasohm@0
   150
use "pattern.ML";
clasohm@0
   151
use "unify.ML";
paulson@1528
   152
use "theory.ML";
wenzelm@24664
   153
use "interpretation.ML";
berghofe@11511
   154
use "proofterm.ML";
clasohm@0
   155
use "thm.ML";
wenzelm@22361
   156
use "more_thm.ML";
wenzelm@26279
   157
use "facts.ML";
wenzelm@39557
   158
use "global_theory.ML";
wenzelm@3986
   159
use "pure_thy.ML";
clasohm@0
   160
use "drule.ML";
wenzelm@22233
   161
use "morphism.ML";
wenzelm@19898
   162
use "variable.ML";
wenzelm@24833
   163
use "conv.ML";
wenzelm@32187
   164
use "goal_display.ML";
wenzelm@32169
   165
use "tactical.ML";
paulson@1582
   166
use "search.ML";
wenzelm@21708
   167
use "tactic.ML";
wenzelm@41228
   168
use "raw_simplifier.ML";
wenzelm@19417
   169
use "conjunction.ML";
wenzelm@20225
   170
use "assumption.ML";
wenzelm@32089
   171
use "display.ML";
clasohm@0
   172
wenzelm@31432
   173
wenzelm@31432
   174
(* Isar -- Intelligible Semi-Automated Reasoning *)
wenzelm@31432
   175
wenzelm@49041
   176
(*ML support*)
wenzelm@49041
   177
use "ML/ml_syntax.ML";
wenzelm@49041
   178
use "ML/ml_env.ML";
wenzelm@49041
   179
use "Isar/runtime.ML";
wenzelm@49041
   180
use "ML/ml_compiler.ML";
wenzelm@49041
   181
if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
wenzelm@49041
   182
wenzelm@49041
   183
use "goal.ML";
wenzelm@49041
   184
wenzelm@31432
   185
(*proof context*)
wenzelm@31432
   186
use "Isar/object_logic.ML";
wenzelm@31432
   187
use "Isar/rule_cases.ML";
wenzelm@31432
   188
use "Isar/auto_bind.ML";
wenzelm@42241
   189
use "type_infer.ML";
wenzelm@42240
   190
use "Syntax/local_syntax.ML";
wenzelm@31432
   191
use "Isar/proof_context.ML";
wenzelm@42405
   192
use "type_infer_context.ML";
wenzelm@42243
   193
use "Syntax/syntax_phases.ML";
wenzelm@31432
   194
use "Isar/local_defs.ML";
wenzelm@31432
   195
wenzelm@31432
   196
(*proof term operations*)
wenzelm@31432
   197
use "Proof/reconstruct.ML";
wenzelm@31432
   198
use "Proof/proof_syntax.ML";
wenzelm@31432
   199
use "Proof/proof_rewrite_rules.ML";
wenzelm@44062
   200
use "Proof/proof_checker.ML";
wenzelm@31432
   201
wenzelm@31432
   202
(*outer syntax*)
wenzelm@36959
   203
use "Isar/token.ML";
wenzelm@36949
   204
use "Isar/keyword.ML";
wenzelm@36949
   205
use "Isar/parse.ML";
wenzelm@31432
   206
use "Isar/args.ML";
wenzelm@31432
   207
use "ML/ml_context.ML";
wenzelm@31432
   208
wenzelm@31432
   209
(*theory sources*)
wenzelm@31432
   210
use "Thy/thy_header.ML";
wenzelm@51265
   211
use "Thy/thy_syntax.ML";
wenzelm@31432
   212
use "Thy/html.ML";
wenzelm@31432
   213
use "Thy/latex.ML";
wenzelm@31432
   214
wenzelm@31432
   215
(*basic proof engine*)
wenzelm@31432
   216
use "Isar/proof_display.ML";
wenzelm@31432
   217
use "Isar/attrib.ML";
wenzelm@31432
   218
use "ML/ml_antiquote.ML";
wenzelm@31432
   219
use "Isar/context_rules.ML";
wenzelm@31432
   220
use "Isar/skip_proof.ML";
wenzelm@31432
   221
use "Isar/method.ML";
wenzelm@31432
   222
use "Isar/proof.ML";
wenzelm@31432
   223
use "Isar/element.ML";
wenzelm@31432
   224
wenzelm@31432
   225
(*derived theory and proof elements*)
wenzelm@31432
   226
use "Isar/calculation.ML";
wenzelm@31432
   227
use "Isar/obtain.ML";
wenzelm@31432
   228
wenzelm@31432
   229
(*local theories and targets*)
wenzelm@31432
   230
use "Isar/local_theory.ML";
haftmann@38341
   231
use "Isar/locale.ML";
haftmann@38307
   232
use "Isar/generic_target.ML";
wenzelm@31432
   233
use "Isar/overloading.ML";
wenzelm@35669
   234
use "axclass.ML";
haftmann@38379
   235
use "Isar/class.ML";
haftmann@38350
   236
use "Isar/named_target.ML";
wenzelm@31432
   237
use "Isar/expression.ML";
haftmann@38379
   238
use "Isar/class_declaration.ML";
wenzelm@47057
   239
use "Isar/bundle.ML";
wenzelm@31432
   240
wenzelm@31432
   241
use "simplifier.ML";
wenzelm@31432
   242
wenzelm@31432
   243
(*executable theory content*)
wenzelm@31432
   244
use "Isar/code.ML";
wenzelm@31432
   245
wenzelm@31432
   246
(*specifications*)
wenzelm@36952
   247
use "Isar/parse_spec.ML";
wenzelm@33374
   248
use "Isar/spec_rules.ML";
wenzelm@31432
   249
use "Isar/specification.ML";
wenzelm@35626
   250
use "Isar/typedecl.ML";
wenzelm@45592
   251
use "ML/ml_thms.ML";
wenzelm@31432
   252
wenzelm@31432
   253
(*toplevel transactions*)
wenzelm@31432
   254
use "Isar/proof_node.ML";
wenzelm@31432
   255
use "Isar/toplevel.ML";
wenzelm@31432
   256
wenzelm@38271
   257
(*theory documents*)
wenzelm@40743
   258
use "System/isabelle_system.ML";
wenzelm@31432
   259
use "Thy/term_style.ML";
wenzelm@31432
   260
use "Thy/thy_output.ML";
wenzelm@48771
   261
use "PIDE/command.ML";
wenzelm@31432
   262
use "Isar/outer_syntax.ML";
wenzelm@49561
   263
use "General/graph_display.ML";
wenzelm@43712
   264
use "Thy/present.ML";
wenzelm@43712
   265
use "Thy/thy_load.ML";
wenzelm@31432
   266
use "Thy/thy_info.ML";
wenzelm@44185
   267
use "PIDE/document.ML";
wenzelm@42504
   268
use "Thy/rail.ML";
wenzelm@31432
   269
wenzelm@31432
   270
(*theory and proof operations*)
wenzelm@31432
   271
use "Isar/rule_insts.ML";
wenzelm@31432
   272
use "Thy/thm_deps.ML";
wenzelm@31432
   273
use "Isar/isar_cmd.ML";
wenzelm@31432
   274
wenzelm@20207
   275
use "subgoal.ML";
wenzelm@5834
   276
berghofe@13402
   277
use "Proof/extraction.ML";
berghofe@11511
   278
wenzelm@31432
   279
wenzelm@31432
   280
(* Isabelle/Isar system *)
wenzelm@31432
   281
wenzelm@30173
   282
use "System/session.ML";
wenzelm@48681
   283
use "System/command_line.ML";
wenzelm@45029
   284
use "System/system_channel.ML";
wenzelm@38412
   285
use "System/isabelle_process.ML";
wenzelm@43748
   286
use "System/invoke_scala.ML";
wenzelm@45709
   287
use "PIDE/protocol.ML";
wenzelm@30173
   288
use "System/isar.ML";
wenzelm@30173
   289
wenzelm@31432
   290
wenzelm@31432
   291
(* miscellaneous tools and packages for Pure Isabelle *)
wenzelm@31432
   292
wenzelm@50686
   293
use "Tools/build.ML";
wenzelm@31432
   294
use "Tools/named_thms.ML";
wenzelm@50217
   295
use "Tools/legacy_xml_syntax.ML";
wenzelm@31432
   296
wenzelm@31432
   297
wenzelm@31432
   298
(* configuration for Proof General *)
wenzelm@31432
   299
wenzelm@31432
   300
use "ProofGeneral/pgip_types.ML";
wenzelm@31432
   301
use "ProofGeneral/pgml.ML";
wenzelm@31432
   302
use "ProofGeneral/pgip_markup.ML";
wenzelm@31432
   303
use "ProofGeneral/pgip_input.ML";
wenzelm@31432
   304
use "ProofGeneral/pgip_output.ML";
wenzelm@31432
   305
use "ProofGeneral/pgip.ML";
wenzelm@31432
   306
wenzelm@31432
   307
use "ProofGeneral/pgip_isabelle.ML";
wenzelm@31432
   308
wenzelm@50757
   309
(use
wenzelm@50757
   310
  |> Unsynchronized.setmp Proofterm.proofs 0
wenzelm@50757
   311
  |> Unsynchronized.setmp Multithreading.max_threads 0)
wenzelm@50757
   312
  "ProofGeneral/preferences.ML";
wenzelm@31432
   313
wenzelm@31432
   314
use "ProofGeneral/pgip_parser.ML";
wenzelm@31432
   315
wenzelm@31432
   316
use "ProofGeneral/proof_general_pgip.ML";
wenzelm@31432
   317
use "ProofGeneral/proof_general_emacs.ML";
wenzelm@31432
   318
obua@16781
   319
wenzelm@48732
   320
(* ML toplevel pretty printing *)
wenzelm@48732
   321
wenzelm@48732
   322
toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
wenzelm@48732
   323
toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
wenzelm@48732
   324
toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
wenzelm@48732
   325
toplevel_pp ["Position", "T"] "Pretty.position";
wenzelm@48732
   326
toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
wenzelm@48732
   327
toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
wenzelm@48732
   328
toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
wenzelm@48732
   329
toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
wenzelm@48732
   330
toplevel_pp ["Context", "theory"] "Context.pretty_thy";
wenzelm@48732
   331
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
wenzelm@48732
   332
toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
wenzelm@48732
   333
toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
wenzelm@48732
   334
toplevel_pp ["Path", "T"] "Path.pretty";
wenzelm@48732
   335
toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
wenzelm@48732
   336
toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
wenzelm@48732
   337
toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
wenzelm@48732
   338
wenzelm@48732
   339
if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
wenzelm@48732
   340
wenzelm@48732
   341
wenzelm@49862
   342
(* the Pure theory *)
wenzelm@49862
   343
wenzelm@49862
   344
use "pure_syn.ML";
wenzelm@49862
   345
Toplevel.program (fn () => Thy_Info.use_thy ("Pure", Position.none));
wenzelm@49862
   346
Context.set_thread_data NONE;
wenzelm@49862
   347
structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
wenzelm@49862
   348
wenzelm@49862
   349
toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
wenzelm@49862
   350
wenzelm@49862
   351
use "ProofGeneral/pgip_tests.ML";
wenzelm@49862
   352
wenzelm@49862
   353
wenzelm@48879
   354
(* ML toplevel commands *)
wenzelm@48879
   355
wenzelm@48879
   356
fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
wenzelm@48879
   357
wenzelm@48927
   358
fun use_thys args = Toplevel.program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
wenzelm@48927
   359
val use_thy = use_thys o single;
wenzelm@48732
   360
wenzelm@48732
   361
val cd = File.cd o Path.explode;
wenzelm@48732
   362
wenzelm@48732
   363
Proofterm.proofs := 0;
wenzelm@48879
   364
Multithreading.max_threads := 0;
wenzelm@30639
   365