src/Pure/ROOT.ML
author wenzelm
Sat Apr 02 23:14:08 2016 +0200 (2016-04-02)
changeset 62825 e6e80a8bf624
parent 62818 2733b240bfea
child 62845 31177a9c3025
permissions -rw-r--r--
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
     1 (*** Isabelle/Pure bootstrap ***)
     2 
     3 (** bootstrap phase 0: Poly/ML setup **)
     4 
     5 (* initial ML name space *)
     6 
     7 use "ML/ml_system.ML";
     8 use "ML/ml_name_space.ML";
     9 use "ML/ml_pervasive.ML";
    10 
    11 if List.exists (fn (a, _) => a = "FixedInt") (#allStruct ML_Name_Space.global ()) then ()
    12 else use "ML/fixed_int_dummy.ML";
    13 
    14 structure Distribution =     (*filled-in by makedist*)
    15 struct
    16   val version = "unidentified repository version";
    17   val is_identified = false;
    18   val is_official = false;
    19 end;
    20 
    21 
    22 (* multithreading *)
    23 
    24 use "General/exn.ML";
    25 
    26 use "Concurrent/multithreading.ML";
    27 use "Concurrent/unsynchronized.ML";
    28 
    29 
    30 (* ML system *)
    31 
    32 use "ML/ml_heap.ML";
    33 use "ML/ml_profiling.ML";
    34 use "ML/ml_pretty.ML";
    35 use "ML/ml_compiler0.ML";
    36 use_no_debug "ML/ml_debugger.ML";
    37 
    38 
    39 
    40 (** bootstrap phase 1: towards ML within position context *)
    41 
    42 (* library of general tools *)
    43 
    44 use "General/basics.ML";
    45 use "library.ML";
    46 use "General/print_mode.ML";
    47 use "General/alist.ML";
    48 use "General/table.ML";
    49 
    50 use "Concurrent/synchronized.ML";
    51 use "Concurrent/counter.ML";
    52 
    53 use "General/random.ML";
    54 use "General/properties.ML";
    55 use "General/output.ML";
    56 use "PIDE/markup.ML";
    57 use "General/scan.ML";
    58 use "General/source.ML";
    59 use "General/symbol.ML";
    60 use "General/position.ML";
    61 use "General/symbol_pos.ML";
    62 use "General/input.ML";
    63 use "General/antiquote.ML";
    64 use "ML/ml_lex.ML";
    65 use "ML/ml_compiler1.ML";
    66 
    67 
    68 (** bootstrap phase 2: towards ML within Isar context *)
    69 
    70 (* library of general tools *)
    71 
    72 use "General/integer.ML";
    73 use "General/stack.ML";
    74 use "General/queue.ML";
    75 use "General/heap.ML";
    76 use "General/same.ML";
    77 use "General/ord_list.ML";
    78 use "General/balanced_tree.ML";
    79 use "General/linear_set.ML";
    80 use "General/buffer.ML";
    81 use "General/pretty.ML";
    82 use "PIDE/xml.ML";
    83 use "General/path.ML";
    84 use "General/url.ML";
    85 use "General/file.ML";
    86 use "General/long_name.ML";
    87 use "General/binding.ML";
    88 use "General/socket_io.ML";
    89 use "General/seq.ML";
    90 use "General/timing.ML";
    91 use "General/sha1.ML";
    92 
    93 val _ = List.app ML_Name_Space.forget_structure ML_Name_Space.critical_structures;
    94 
    95 use "PIDE/yxml.ML";
    96 use "PIDE/document_id.ML";
    97 
    98 use "General/change_table.ML";
    99 use "General/graph.ML";
   100 
   101 
   102 (* fundamental structures *)
   103 
   104 use "name.ML";
   105 use "term.ML";
   106 use "context.ML";
   107 use "context_position.ML";
   108 use "System/options.ML";
   109 use "config.ML";
   110 
   111 
   112 (* concurrency within the ML runtime *)
   113 
   114 use "ML/exn_properties.ML";
   115 
   116 use "ML/ml_statistics.ML";
   117 
   118 use "Concurrent/standard_thread.ML";
   119 use "Concurrent/single_assignment.ML";
   120 
   121 use "Concurrent/par_exn.ML";
   122 use "Concurrent/task_queue.ML";
   123 use "Concurrent/future.ML";
   124 use "Concurrent/event_timer.ML";
   125 use "Concurrent/timeout.ML";
   126 use "Concurrent/lazy.ML";
   127 use "Concurrent/par_list.ML";
   128 
   129 use "Concurrent/mailbox.ML";
   130 use "Concurrent/cache.ML";
   131 
   132 use "PIDE/active.ML";
   133 
   134 
   135 (* inner syntax *)
   136 
   137 use "Syntax/type_annotation.ML";
   138 use "Syntax/term_position.ML";
   139 use "Syntax/lexicon.ML";
   140 use "Syntax/ast.ML";
   141 use "Syntax/syntax_ext.ML";
   142 use "Syntax/parser.ML";
   143 use "Syntax/syntax_trans.ML";
   144 use "Syntax/mixfix.ML";
   145 use "Syntax/printer.ML";
   146 use "Syntax/syntax.ML";
   147 
   148 
   149 (* core of tactical proof system *)
   150 
   151 use "term_ord.ML";
   152 use "term_subst.ML";
   153 use "term_xml.ML";
   154 use "General/completion.ML";
   155 use "General/name_space.ML";
   156 use "sorts.ML";
   157 use "type.ML";
   158 use "logic.ML";
   159 use "Syntax/simple_syntax.ML";
   160 use "net.ML";
   161 use "item_net.ML";
   162 use "envir.ML";
   163 use "consts.ML";
   164 use "primitive_defs.ML";
   165 use "sign.ML";
   166 use "defs.ML";
   167 use "term_sharing.ML";
   168 use "pattern.ML";
   169 use "unify.ML";
   170 use "theory.ML";
   171 use "proofterm.ML";
   172 use "thm.ML";
   173 use "more_pattern.ML";
   174 use "more_unify.ML";
   175 use "more_thm.ML";
   176 use "facts.ML";
   177 use "global_theory.ML";
   178 use "pure_thy.ML";
   179 use "drule.ML";
   180 use "morphism.ML";
   181 use "variable.ML";
   182 use "conv.ML";
   183 use "goal_display.ML";
   184 use "tactical.ML";
   185 use "search.ML";
   186 use "tactic.ML";
   187 use "raw_simplifier.ML";
   188 use "conjunction.ML";
   189 use "assumption.ML";
   190 
   191 
   192 (* Isar -- Intelligible Semi-Automated Reasoning *)
   193 
   194 (*ML support and global execution*)
   195 use "ML/ml_syntax.ML";
   196 use "ML/ml_env.ML";
   197 use "ML/ml_options.ML";
   198 use_no_debug "ML/exn_debugger.ML";
   199 use_no_debug "Isar/runtime.ML";
   200 use "PIDE/execution.ML";
   201 use "ML/ml_compiler.ML";
   202 
   203 use "skip_proof.ML";
   204 use "goal.ML";
   205 
   206 (*proof context*)
   207 use "Isar/object_logic.ML";
   208 use "Isar/rule_cases.ML";
   209 use "Isar/auto_bind.ML";
   210 use "type_infer.ML";
   211 use "Syntax/local_syntax.ML";
   212 use "Isar/proof_context.ML";
   213 use "type_infer_context.ML";
   214 use "Syntax/syntax_phases.ML";
   215 use "Isar/local_defs.ML";
   216 
   217 (*outer syntax*)
   218 use "Isar/keyword.ML";
   219 use "Isar/token.ML";
   220 use "Isar/parse.ML";
   221 use "Isar/args.ML";
   222 
   223 (*theory specifications*)
   224 use "Isar/local_theory.ML";
   225 use "Thy/thy_header.ML";
   226 use "PIDE/command_span.ML";
   227 use "Thy/thy_syntax.ML";
   228 use "Thy/markdown.ML";
   229 use "Thy/html.ML";
   230 use "Thy/latex.ML";
   231 
   232 (*ML with context and antiquotations*)
   233 use "ML/ml_context.ML";
   234 use "ML/ml_antiquotation.ML";
   235 use "ML/ml_compiler2.ML";
   236 
   237 
   238 
   239 (** bootstrap phase 3: towards Pure.thy and final ML toplevel setup *)
   240 
   241 (*basic proof engine*)
   242 use "par_tactical.ML";
   243 use "Isar/proof_display.ML";
   244 use "Isar/attrib.ML";
   245 use "Isar/context_rules.ML";
   246 use "Isar/method.ML";
   247 use "Isar/proof.ML";
   248 use "Isar/element.ML";
   249 use "Isar/obtain.ML";
   250 use "Isar/subgoal.ML";
   251 
   252 (*local theories and targets*)
   253 use "Isar/locale.ML";
   254 use "Isar/generic_target.ML";
   255 use "Isar/overloading.ML";
   256 use "axclass.ML";
   257 use "Isar/class.ML";
   258 use "Isar/named_target.ML";
   259 use "Isar/expression.ML";
   260 use "Isar/interpretation.ML";
   261 use "Isar/class_declaration.ML";
   262 use "Isar/bundle.ML";
   263 use "Isar/experiment.ML";
   264 
   265 use "simplifier.ML";
   266 use "Tools/plugin.ML";
   267 
   268 (*executable theory content*)
   269 use "Isar/code.ML";
   270 
   271 (*specifications*)
   272 use "Isar/parse_spec.ML";
   273 use "Isar/spec_rules.ML";
   274 use "Isar/specification.ML";
   275 use "Isar/typedecl.ML";
   276 
   277 (*toplevel transactions*)
   278 use "Isar/proof_node.ML";
   279 use "Isar/toplevel.ML";
   280 
   281 (*proof term operations*)
   282 use "Proof/reconstruct.ML";
   283 use "Proof/proof_syntax.ML";
   284 use "Proof/proof_rewrite_rules.ML";
   285 use "Proof/proof_checker.ML";
   286 use "Proof/extraction.ML";
   287 
   288 (*Isabelle system*)
   289 if ML_System.platform_is_windows
   290 then use "System/bash_windows.ML"
   291 else use "System/bash.ML";
   292 use "System/isabelle_system.ML";
   293 
   294 (*theory documents*)
   295 use "Thy/term_style.ML";
   296 use "Isar/outer_syntax.ML";
   297 use "Thy/thy_output.ML";
   298 use "Thy/document_antiquotations.ML";
   299 use "General/graph_display.ML";
   300 use "Thy/present.ML";
   301 use "pure_syn.ML";
   302 use "PIDE/command.ML";
   303 use "PIDE/query_operation.ML";
   304 use "PIDE/resources.ML";
   305 use "Thy/thy_info.ML";
   306 use "PIDE/session.ML";
   307 use "PIDE/protocol_message.ML";
   308 use "PIDE/document.ML";
   309 
   310 (*theory and proof operations*)
   311 use "Isar/isar_cmd.ML";
   312 
   313 
   314 (* Isabelle/Isar system *)
   315 
   316 use "System/command_line.ML";
   317 use "System/system_channel.ML";
   318 use "System/message_channel.ML";
   319 use "System/isabelle_process.ML";
   320 use "System/invoke_scala.ML";
   321 use "PIDE/protocol.ML";
   322 
   323 
   324 (* miscellaneous tools and packages for Pure Isabelle *)
   325 
   326 use "Tools/build.ML";
   327 use "Tools/named_thms.ML";
   328 
   329 structure Output: OUTPUT = Output;  (*seal system channels!*)
   330 
   331 use "ML/ml_pp.ML";
   332 
   333 
   334 (* the Pure theory *)
   335 
   336 use "ML/ml_file.ML";
   337 Runtime.toplevel_program (fn () => Thy_Info.use_thy ("Pure", Position.none));
   338 Context.set_thread_data NONE;
   339 structure Pure = struct val thy = Thy_Info.pure_theory () end;
   340 
   341 
   342 (* ML toplevel commands *)
   343 
   344 fun use_thys args =
   345   Runtime.toplevel_program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
   346 val use_thy = use_thys o single;
   347 
   348 Proofterm.proofs := 0;
   349 
   350 structure PolyML = struct structure IntInf = PolyML.IntInf end;