src/Pure/ROOT.ML
author wenzelm
Wed Mar 26 09:13:38 2014 +0100 (2014-03-26)
changeset 56287 ca090ae5f258
parent 56281 03c3d1a7c3b8
child 56288 bf1bdf335ea0
permissions -rw-r--r--
tuned load order;
     1 (** Pure Isabelle **)
     2 
     3 structure Distribution =     (*filled-in by makedist*)
     4 struct
     5   val version = "unidentified repository version";
     6   val is_official = false;
     7 end;
     8 
     9 
    10 (* library of general tools *)
    11 
    12 use "General/basics.ML";
    13 use "library.ML";
    14 use "General/print_mode.ML";
    15 use "General/alist.ML";
    16 use "General/table.ML";
    17 
    18 use "Concurrent/simple_thread.ML";
    19 
    20 use "Concurrent/synchronized.ML";
    21 if Multithreading.available then ()
    22 else use "Concurrent/synchronized_sequential.ML";
    23 use "Concurrent/counter.ML";
    24 
    25 use "General/properties.ML";
    26 use "General/output.ML";
    27 use "PIDE/markup.ML";
    28 fun legacy_feature s = warning (Markup.markup Markup.legacy ("Legacy feature! " ^ s));
    29 use "General/scan.ML";
    30 use "General/source.ML";
    31 use "General/symbol.ML";
    32 use "General/position.ML";
    33 use "General/symbol_pos.ML";
    34 use "General/antiquote.ML";
    35 use "ML/ml_lex.ML";
    36 use "ML/ml_parse.ML";
    37 use "General/secure.ML";
    38 (*^^^^^ end of ML bootstrap 0 ^^^^^*)
    39 use "General/integer.ML";
    40 use "General/stack.ML";
    41 use "General/queue.ML";
    42 use "General/heap.ML";
    43 use "General/same.ML";
    44 use "General/ord_list.ML";
    45 use "General/balanced_tree.ML";
    46 use "General/linear_set.ML";
    47 use "General/buffer.ML";
    48 use "General/pretty.ML";
    49 use "General/path.ML";
    50 use "General/url.ML";
    51 use "General/file.ML";
    52 use "General/long_name.ML";
    53 use "General/binding.ML";
    54 use "General/socket_io.ML";
    55 use "General/seq.ML";
    56 use "General/timing.ML";
    57 
    58 use "General/sha1.ML";
    59 if ML_System.is_polyml then use "General/sha1_polyml.ML" else ();
    60 use "General/sha1_samples.ML";
    61 
    62 use "PIDE/xml.ML";
    63 use "PIDE/yxml.ML";
    64 
    65 use "General/change_table.ML";
    66 use "General/graph.ML";
    67 
    68 use "System/options.ML";
    69 
    70 
    71 (* concurrency within the ML runtime *)
    72 
    73 if ML_System.is_polyml
    74 then use "ML/exn_properties_polyml.ML"
    75 else use "ML/exn_properties_dummy.ML";
    76 
    77 if ML_System.name = "polyml-5.5.1"
    78   orelse ML_System.name = "polyml-5.5.2"
    79 then use "ML/exn_trace_polyml-5.5.1.ML"
    80 else ();
    81 
    82 if ML_System.name = "polyml-5.5.0"
    83   orelse ML_System.name = "polyml-5.5.1"
    84   orelse ML_System.name = "polyml-5.5.2"
    85 then use "ML/ml_statistics_polyml-5.5.0.ML"
    86 else use "ML/ml_statistics_dummy.ML";
    87 
    88 use "Concurrent/single_assignment.ML";
    89 if Multithreading.available then ()
    90 else use "Concurrent/single_assignment_sequential.ML";
    91 
    92 if Multithreading.available
    93 then use "Concurrent/bash.ML"
    94 else use "Concurrent/bash_sequential.ML";
    95 
    96 use "Concurrent/par_exn.ML";
    97 use "Concurrent/task_queue.ML";
    98 use "Concurrent/future.ML";
    99 use "Concurrent/event_timer.ML";
   100 
   101 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
   102 
   103 use "Concurrent/lazy.ML";
   104 if Multithreading.available then ()
   105 else use "Concurrent/lazy_sequential.ML";
   106 
   107 use "Concurrent/par_list.ML";
   108 if Multithreading.available then ()
   109 else use "Concurrent/par_list_sequential.ML";
   110 
   111 use "Concurrent/mailbox.ML";
   112 use "Concurrent/cache.ML";
   113 
   114 use "PIDE/active.ML";
   115 
   116 
   117 (* fundamental structures *)
   118 
   119 use "name.ML";
   120 use "term.ML";
   121 use "context.ML";
   122 use "context_position.ML";
   123 use "config.ML";
   124 
   125 val quick_and_dirty_raw = Config.declare_option "quick_and_dirty";
   126 val quick_and_dirty = Config.bool quick_and_dirty_raw;
   127 
   128 
   129 (* inner syntax *)
   130 
   131 use "Syntax/type_annotation.ML";
   132 use "Syntax/term_position.ML";
   133 use "Syntax/lexicon.ML";
   134 use "Syntax/ast.ML";
   135 use "Syntax/syntax_ext.ML";
   136 use "Syntax/parser.ML";
   137 use "Syntax/syntax_trans.ML";
   138 use "Syntax/mixfix.ML";
   139 use "Syntax/printer.ML";
   140 use "Syntax/syntax.ML";
   141 
   142 
   143 (* core of tactical proof system *)
   144 
   145 use "term_ord.ML";
   146 use "term_subst.ML";
   147 use "term_xml.ML";
   148 use "General/completion.ML";
   149 use "General/name_space.ML";
   150 use "sorts.ML";
   151 use "type.ML";
   152 use "logic.ML";
   153 use "Syntax/simple_syntax.ML";
   154 use "net.ML";
   155 use "item_net.ML";
   156 use "envir.ML";
   157 use "consts.ML";
   158 use "primitive_defs.ML";
   159 use "defs.ML";
   160 use "sign.ML";
   161 use "term_sharing.ML";
   162 use "pattern.ML";
   163 use "unify.ML";
   164 use "theory.ML";
   165 use "interpretation.ML";
   166 use "proofterm.ML";
   167 use "thm.ML";
   168 use "more_thm.ML";
   169 use "facts.ML";
   170 use "global_theory.ML";
   171 use "pure_thy.ML";
   172 use "drule.ML";
   173 use "morphism.ML";
   174 use "variable.ML";
   175 use "conv.ML";
   176 use "goal_display.ML";
   177 use "tactical.ML";
   178 use "search.ML";
   179 use "tactic.ML";
   180 use "raw_simplifier.ML";
   181 use "conjunction.ML";
   182 use "assumption.ML";
   183 use "display.ML";
   184 
   185 
   186 (* Isar -- Intelligible Semi-Automated Reasoning *)
   187 
   188 (*ML support*)
   189 use "ML/ml_syntax.ML";
   190 use "ML/ml_env.ML";
   191 use "Isar/runtime.ML";
   192 use "ML/ml_compiler.ML";
   193 if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
   194 
   195 (*global execution*)
   196 use "PIDE/document_id.ML";
   197 use "PIDE/execution.ML";
   198 use "skip_proof.ML";
   199 use "goal.ML";
   200 
   201 (*proof context*)
   202 use "Isar/object_logic.ML";
   203 use "Isar/rule_cases.ML";
   204 use "Isar/auto_bind.ML";
   205 use "type_infer.ML";
   206 use "Syntax/local_syntax.ML";
   207 use "Isar/proof_context.ML";
   208 use "type_infer_context.ML";
   209 use "Syntax/syntax_phases.ML";
   210 use "Isar/local_defs.ML";
   211 
   212 (*outer syntax*)
   213 use "Isar/token.ML";
   214 use "Isar/keyword.ML";
   215 use "Isar/parse.ML";
   216 use "Isar/args.ML";
   217 
   218 (*theory sources*)
   219 use "Thy/thy_header.ML";
   220 use "Thy/thy_syntax.ML";
   221 use "Thy/html.ML";
   222 use "Thy/latex.ML";
   223 
   224 (*ML with context and antiquotations*)
   225 use "ML/ml_context.ML";
   226 use "ML/ml_antiquotation.ML";
   227 (*^^^^^ end of ML bootstrap 1 ^^^^^*)
   228 
   229 (*basic proof engine*)
   230 use "Isar/proof_display.ML";
   231 use "Isar/attrib.ML";
   232 use "Isar/context_rules.ML";
   233 use "Isar/method.ML";
   234 use "Isar/proof.ML";
   235 use "Isar/element.ML";
   236 use "Isar/obtain.ML";
   237 
   238 (*local theories and targets*)
   239 use "Isar/locale.ML";
   240 use "Isar/local_theory.ML";
   241 use "Isar/generic_target.ML";
   242 use "Isar/overloading.ML";
   243 use "axclass.ML";
   244 use "Isar/class.ML";
   245 use "Isar/named_target.ML";
   246 use "Isar/expression.ML";
   247 use "Isar/class_declaration.ML";
   248 use "Isar/bundle.ML";
   249 
   250 use "simplifier.ML";
   251 
   252 (*executable theory content*)
   253 use "Isar/code.ML";
   254 
   255 (*specifications*)
   256 use "Isar/parse_spec.ML";
   257 use "Isar/spec_rules.ML";
   258 use "Isar/specification.ML";
   259 use "Isar/typedecl.ML";
   260 
   261 (*toplevel transactions*)
   262 use "Isar/proof_node.ML";
   263 use "Isar/toplevel.ML";
   264 
   265 (*proof term operations*)
   266 use "Proof/reconstruct.ML";
   267 use "Proof/proof_syntax.ML";
   268 use "Proof/proof_rewrite_rules.ML";
   269 use "Proof/proof_checker.ML";
   270 use "Proof/extraction.ML";
   271 
   272 (*theory documents*)
   273 use "System/isabelle_system.ML";
   274 use "Thy/term_style.ML";
   275 use "Thy/thy_output.ML";
   276 use "Isar/outer_syntax.ML";
   277 use "General/graph_display.ML";
   278 use "Thy/present.ML";
   279 use "PIDE/command.ML";
   280 use "PIDE/query_operation.ML";
   281 use "PIDE/resources.ML";
   282 use "Thy/thy_info.ML";
   283 use "PIDE/document.ML";
   284 
   285 (*theory and proof operations*)
   286 use "Thy/thm_deps.ML";
   287 use "Isar/isar_cmd.ML";
   288 
   289 use "subgoal.ML";
   290 
   291 
   292 (* Isabelle/Isar system *)
   293 
   294 use "PIDE/session.ML";
   295 use "System/command_line.ML";
   296 use "System/system_channel.ML";
   297 use "System/message_channel.ML";
   298 use "System/isabelle_process.ML";
   299 use "System/invoke_scala.ML";
   300 use "PIDE/protocol.ML";
   301 use "System/isar.ML";
   302 
   303 
   304 (* miscellaneous tools and packages for Pure Isabelle *)
   305 
   306 use "Tools/build.ML";
   307 use "Tools/named_thms.ML";
   308 use "Tools/proof_general.ML";
   309 
   310 structure Output: OUTPUT = Output;  (*seal system channels!*)
   311 
   312 
   313 (* ML toplevel pretty printing *)
   314 
   315 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
   316 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
   317 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
   318 toplevel_pp ["Position", "T"] "Pretty.position";
   319 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
   320 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
   321 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
   322 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
   323 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
   324 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
   325 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
   326 toplevel_pp ["Path", "T"] "Path.pretty";
   327 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
   328 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
   329 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
   330 toplevel_pp ["Morphism", "morphism"] "Morphism.pretty";
   331 
   332 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
   333 
   334 
   335 (* the Pure theory *)
   336 
   337 use "pure_syn.ML";
   338 Toplevel.program (fn () => Thy_Info.use_thy ("Pure", Position.none));
   339 Context.set_thread_data NONE;
   340 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
   341 
   342 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
   343 
   344 
   345 (* ML toplevel commands *)
   346 
   347 fun use_thys args = Toplevel.program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
   348 val use_thy = use_thys o single;
   349 
   350 val cd = File.cd o Path.explode;
   351 
   352 Proofterm.proofs := 0;
   353