src/Pure/ROOT.ML
author wenzelm
Wed Dec 11 18:02:22 2013 +0100 (2013-12-11)
changeset 54717 42c209a6c225
parent 54449 f3cfe882f9af
child 54740 91f54d386680
permissions -rw-r--r--
support for polml-5.5.2;
support Thread.numPhysicalProcessors of polyml-5.5.2 (according to SVN 1890);
clarified max_threads: store plain value internally, reproduce result only on startup, and thus avoid potential system overhead;
     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 print_depth 10;
    10 
    11 
    12 (* library of general tools *)
    13 
    14 use "General/basics.ML";
    15 use "library.ML";
    16 use "General/print_mode.ML";
    17 use "General/alist.ML";
    18 use "General/table.ML";
    19 
    20 use "Concurrent/simple_thread.ML";
    21 
    22 use "Concurrent/synchronized.ML";
    23 if Multithreading.available then ()
    24 else use "Concurrent/synchronized_sequential.ML";
    25 use "Concurrent/counter.ML";
    26 
    27 use "General/properties.ML";
    28 use "General/output.ML";
    29 use "PIDE/markup.ML";
    30 fun legacy_feature s = warning (Markup.markup Markup.legacy ("Legacy feature! " ^ s));
    31 use "General/timing.ML";
    32 use "General/scan.ML";
    33 use "General/source.ML";
    34 use "General/symbol.ML";
    35 use "General/seq.ML";
    36 use "General/position.ML";
    37 use "General/symbol_pos.ML";
    38 use "General/antiquote.ML";
    39 use "ML/ml_lex.ML";
    40 use "ML/ml_parse.ML";
    41 use "General/secure.ML";
    42 (*^^^^^ end of basic ML bootstrap ^^^^^*)
    43 use "General/integer.ML";
    44 use "General/stack.ML";
    45 use "General/queue.ML";
    46 use "General/heap.ML";
    47 use "General/same.ML";
    48 use "General/ord_list.ML";
    49 use "General/balanced_tree.ML";
    50 use "General/linear_set.ML";
    51 use "General/buffer.ML";
    52 use "General/pretty.ML";
    53 use "General/path.ML";
    54 use "General/url.ML";
    55 use "General/file.ML";
    56 use "General/long_name.ML";
    57 use "General/binding.ML";
    58 use "General/socket_io.ML";
    59 
    60 use "General/sha1.ML";
    61 if ML_System.is_polyml then use "General/sha1_polyml.ML" else ();
    62 use "General/sha1_samples.ML";
    63 
    64 use "PIDE/xml.ML";
    65 use "PIDE/yxml.ML";
    66 
    67 use "General/graph.ML";
    68 
    69 use "System/options.ML";
    70 
    71 
    72 (* concurrency within the ML runtime *)
    73 
    74 if ML_System.is_polyml
    75 then use "ML/exn_properties_polyml.ML"
    76 else use "ML/exn_properties_dummy.ML";
    77 
    78 if ML_System.name = "polyml-5.5.1"
    79   orelse ML_System.name = "polyml-5.5.2"
    80 then use "ML/exn_trace_polyml-5.5.1.ML"
    81 else ();
    82 
    83 if ML_System.name = "polyml-5.5.0"
    84   orelse ML_System.name = "polyml-5.5.1"
    85   orelse ML_System.name = "polyml-5.5.2"
    86 then use "ML/ml_statistics_polyml-5.5.0.ML"
    87 else use "ML/ml_statistics_dummy.ML";
    88 
    89 use "Concurrent/single_assignment.ML";
    90 if Multithreading.available then ()
    91 else use "Concurrent/single_assignment_sequential.ML";
    92 
    93 if Multithreading.available
    94 then use "Concurrent/bash.ML"
    95 else use "Concurrent/bash_sequential.ML";
    96 
    97 use "Concurrent/par_exn.ML";
    98 use "Concurrent/task_queue.ML";
    99 use "Concurrent/future.ML";
   100 use "Concurrent/event_timer.ML";
   101 
   102 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
   103 
   104 use "Concurrent/lazy.ML";
   105 if Multithreading.available then ()
   106 else use "Concurrent/lazy_sequential.ML";
   107 
   108 use "Concurrent/par_list.ML";
   109 if Multithreading.available then ()
   110 else use "Concurrent/par_list_sequential.ML";
   111 
   112 use "Concurrent/mailbox.ML";
   113 use "Concurrent/cache.ML";
   114 
   115 use "PIDE/active.ML";
   116 
   117 
   118 (* fundamental structures *)
   119 
   120 use "name.ML";
   121 use "term.ML";
   122 use "context.ML";
   123 use "context_position.ML";
   124 use "config.ML";
   125 
   126 val quick_and_dirty_raw = Config.declare_option "quick_and_dirty";
   127 val quick_and_dirty = Config.bool quick_and_dirty_raw;
   128 
   129 
   130 (* inner syntax *)
   131 
   132 use "Syntax/type_annotation.ML";
   133 use "Syntax/term_position.ML";
   134 use "Syntax/lexicon.ML";
   135 use "Syntax/ast.ML";
   136 use "Syntax/syntax_ext.ML";
   137 use "Syntax/parser.ML";
   138 use "Syntax/syntax_trans.ML";
   139 use "Syntax/mixfix.ML";
   140 use "Syntax/printer.ML";
   141 use "Syntax/syntax.ML";
   142 
   143 
   144 (* core of tactical proof system *)
   145 
   146 use "term_ord.ML";
   147 use "term_subst.ML";
   148 use "term_xml.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 (*proof term operations*)
   213 use "Proof/reconstruct.ML";
   214 use "Proof/proof_syntax.ML";
   215 use "Proof/proof_rewrite_rules.ML";
   216 use "Proof/proof_checker.ML";
   217 
   218 (*outer syntax*)
   219 use "Isar/token.ML";
   220 use "Isar/keyword.ML";
   221 use "Isar/parse.ML";
   222 use "Isar/args.ML";
   223 use "ML/ml_context.ML";
   224 
   225 (*theory sources*)
   226 use "Thy/thy_header.ML";
   227 use "Thy/thy_syntax.ML";
   228 use "Thy/html.ML";
   229 use "Thy/latex.ML";
   230 
   231 (*basic proof engine*)
   232 use "Isar/proof_display.ML";
   233 use "Isar/attrib.ML";
   234 use "ML/ml_antiquote.ML";
   235 use "Isar/context_rules.ML";
   236 use "Isar/method.ML";
   237 use "Isar/proof.ML";
   238 use "Isar/element.ML";
   239 
   240 (*derived theory and proof elements*)
   241 use "Isar/calculation.ML";
   242 use "Isar/obtain.ML";
   243 
   244 (*local theories and targets*)
   245 use "Isar/locale.ML";
   246 use "Isar/local_theory.ML";
   247 use "Isar/generic_target.ML";
   248 use "Isar/overloading.ML";
   249 use "axclass.ML";
   250 use "Isar/class.ML";
   251 use "Isar/named_target.ML";
   252 use "Isar/expression.ML";
   253 use "Isar/class_declaration.ML";
   254 use "Isar/bundle.ML";
   255 
   256 use "simplifier.ML";
   257 
   258 (*executable theory content*)
   259 use "Isar/code.ML";
   260 
   261 (*specifications*)
   262 use "Isar/parse_spec.ML";
   263 use "Isar/spec_rules.ML";
   264 use "Isar/specification.ML";
   265 use "Isar/typedecl.ML";
   266 use "ML/ml_thms.ML";
   267 
   268 (*toplevel transactions*)
   269 use "Isar/proof_node.ML";
   270 use "Isar/toplevel.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 "Thy/thy_load.ML";
   282 use "Thy/thy_info.ML";
   283 use "PIDE/document.ML";
   284 use "Thy/rail.ML";
   285 
   286 (*theory and proof operations*)
   287 use "Thy/thm_deps.ML";
   288 use "Isar/isar_cmd.ML";
   289 
   290 use "subgoal.ML";
   291 
   292 use "Proof/extraction.ML";
   293 
   294 
   295 (* Isabelle/Isar system *)
   296 
   297 use "System/session.ML";
   298 use "System/command_line.ML";
   299 use "System/system_channel.ML";
   300 use "System/message_channel.ML";
   301 use "System/isabelle_process.ML";
   302 use "System/invoke_scala.ML";
   303 use "PIDE/protocol.ML";
   304 use "System/isar.ML";
   305 
   306 
   307 (* miscellaneous tools and packages for Pure Isabelle *)
   308 
   309 use "Tools/build.ML";
   310 use "Tools/named_thms.ML";
   311 use "Tools/proof_general.ML";
   312 
   313 
   314 (* ML toplevel pretty printing *)
   315 
   316 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
   317 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
   318 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
   319 toplevel_pp ["Position", "T"] "Pretty.position";
   320 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
   321 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
   322 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
   323 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
   324 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
   325 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
   326 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
   327 toplevel_pp ["Path", "T"] "Path.pretty";
   328 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
   329 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
   330 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
   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