src/Pure/ROOT.ML
author wenzelm
Wed Sep 18 11:08:28 2013 +0200 (2013-09-18)
changeset 53707 d1c6bff9ff58
parent 53212 387b9f7cb0ac
child 53709 84522727f9d3
permissions -rw-r--r--
moved module into plain Isabelle/ML user space;
     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.0"
    79 then use "ML/ml_statistics_polyml-5.5.0.ML"
    80 else use "ML/ml_statistics_dummy.ML";
    81 
    82 use "Concurrent/single_assignment.ML";
    83 if Multithreading.available then ()
    84 else use "Concurrent/single_assignment_sequential.ML";
    85 
    86 if Multithreading.available
    87 then use "Concurrent/bash.ML"
    88 else use "Concurrent/bash_sequential.ML";
    89 
    90 use "Concurrent/par_exn.ML";
    91 use "Concurrent/task_queue.ML";
    92 use "Concurrent/future.ML";
    93 use "Concurrent/event_timer.ML";
    94 
    95 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
    96 
    97 use "Concurrent/lazy.ML";
    98 if Multithreading.available then ()
    99 else use "Concurrent/lazy_sequential.ML";
   100 
   101 use "Concurrent/par_list.ML";
   102 if Multithreading.available then ()
   103 else use "Concurrent/par_list_sequential.ML";
   104 
   105 use "Concurrent/mailbox.ML";
   106 use "Concurrent/cache.ML";
   107 
   108 use "PIDE/active.ML";
   109 
   110 
   111 (* fundamental structures *)
   112 
   113 use "name.ML";
   114 use "term.ML";
   115 use "context.ML";
   116 use "context_position.ML";
   117 use "config.ML";
   118 
   119 val quick_and_dirty_raw = Config.declare_option "quick_and_dirty";
   120 val quick_and_dirty = Config.bool quick_and_dirty_raw;
   121 
   122 
   123 (* inner syntax *)
   124 
   125 use "Syntax/type_annotation.ML";
   126 use "Syntax/term_position.ML";
   127 use "Syntax/lexicon.ML";
   128 use "Syntax/ast.ML";
   129 use "Syntax/syntax_ext.ML";
   130 use "Syntax/parser.ML";
   131 use "Syntax/syntax_trans.ML";
   132 use "Syntax/mixfix.ML";
   133 use "Syntax/printer.ML";
   134 use "Syntax/syntax.ML";
   135 
   136 
   137 (* core of tactical proof system *)
   138 
   139 use "term_ord.ML";
   140 use "term_subst.ML";
   141 use "term_xml.ML";
   142 use "General/name_space.ML";
   143 use "sorts.ML";
   144 use "type.ML";
   145 use "logic.ML";
   146 use "Syntax/simple_syntax.ML";
   147 use "net.ML";
   148 use "item_net.ML";
   149 use "envir.ML";
   150 use "consts.ML";
   151 use "primitive_defs.ML";
   152 use "defs.ML";
   153 use "sign.ML";
   154 use "term_sharing.ML";
   155 use "pattern.ML";
   156 use "unify.ML";
   157 use "theory.ML";
   158 use "interpretation.ML";
   159 use "proofterm.ML";
   160 use "thm.ML";
   161 use "more_thm.ML";
   162 use "facts.ML";
   163 use "global_theory.ML";
   164 use "pure_thy.ML";
   165 use "drule.ML";
   166 use "morphism.ML";
   167 use "variable.ML";
   168 use "conv.ML";
   169 use "goal_display.ML";
   170 use "tactical.ML";
   171 use "search.ML";
   172 use "tactic.ML";
   173 use "raw_simplifier.ML";
   174 use "conjunction.ML";
   175 use "assumption.ML";
   176 use "display.ML";
   177 
   178 
   179 (* Isar -- Intelligible Semi-Automated Reasoning *)
   180 
   181 (*ML support*)
   182 use "ML/ml_syntax.ML";
   183 use "ML/ml_env.ML";
   184 use "Isar/runtime.ML";
   185 use "ML/ml_compiler.ML";
   186 if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
   187 if ML_System.name = "polyml-5.5.1" then use "ML/exn_trace_polyml-5.5.1.ML" else ();
   188 
   189 (*global execution*)
   190 use "PIDE/document_id.ML";
   191 use "PIDE/execution.ML";
   192 use "skip_proof.ML";
   193 use "goal.ML";
   194 
   195 (*proof context*)
   196 use "Isar/object_logic.ML";
   197 use "Isar/rule_cases.ML";
   198 use "Isar/auto_bind.ML";
   199 use "type_infer.ML";
   200 use "Syntax/local_syntax.ML";
   201 use "Isar/proof_context.ML";
   202 use "type_infer_context.ML";
   203 use "Syntax/syntax_phases.ML";
   204 use "Isar/local_defs.ML";
   205 
   206 (*proof term operations*)
   207 use "Proof/reconstruct.ML";
   208 use "Proof/proof_syntax.ML";
   209 use "Proof/proof_rewrite_rules.ML";
   210 use "Proof/proof_checker.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 use "ML/ml_context.ML";
   218 
   219 (*theory sources*)
   220 use "Thy/thy_header.ML";
   221 use "Thy/thy_syntax.ML";
   222 use "Thy/html.ML";
   223 use "Thy/latex.ML";
   224 
   225 (*basic proof engine*)
   226 use "Isar/proof_display.ML";
   227 use "Isar/attrib.ML";
   228 use "ML/ml_antiquote.ML";
   229 use "Isar/context_rules.ML";
   230 use "Isar/method.ML";
   231 use "Isar/proof.ML";
   232 use "Isar/element.ML";
   233 
   234 (*derived theory and proof elements*)
   235 use "Isar/calculation.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 use "ML/ml_thms.ML";
   261 
   262 (*toplevel transactions*)
   263 use "Isar/proof_node.ML";
   264 use "Isar/toplevel.ML";
   265 
   266 (*theory documents*)
   267 use "System/isabelle_system.ML";
   268 use "Thy/term_style.ML";
   269 use "Thy/thy_output.ML";
   270 use "Isar/outer_syntax.ML";
   271 use "General/graph_display.ML";
   272 use "Thy/present.ML";
   273 use "PIDE/command.ML";
   274 use "PIDE/query_operation.ML";
   275 use "Thy/thy_load.ML";
   276 use "Thy/thy_info.ML";
   277 use "PIDE/document.ML";
   278 use "Thy/rail.ML";
   279 
   280 (*theory and proof operations*)
   281 use "Thy/thm_deps.ML";
   282 use "Isar/isar_cmd.ML";
   283 
   284 use "subgoal.ML";
   285 
   286 use "Proof/extraction.ML";
   287 
   288 
   289 (* Isabelle/Isar system *)
   290 
   291 use "System/session.ML";
   292 use "System/command_line.ML";
   293 use "System/system_channel.ML";
   294 use "System/message_channel.ML";
   295 use "System/isabelle_process.ML";
   296 use "System/invoke_scala.ML";
   297 use "PIDE/protocol.ML";
   298 use "System/isar.ML";
   299 
   300 
   301 (* miscellaneous tools and packages for Pure Isabelle *)
   302 
   303 use "Tools/build.ML";
   304 use "Tools/named_thms.ML";
   305 use "Tools/proof_general.ML";
   306 
   307 
   308 (* ML toplevel pretty printing *)
   309 
   310 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
   311 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
   312 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
   313 toplevel_pp ["Position", "T"] "Pretty.position";
   314 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
   315 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
   316 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
   317 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
   318 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
   319 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
   320 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
   321 toplevel_pp ["Path", "T"] "Path.pretty";
   322 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
   323 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
   324 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
   325 
   326 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
   327 
   328 
   329 (* the Pure theory *)
   330 
   331 use "pure_syn.ML";
   332 Toplevel.program (fn () => Thy_Info.use_thy ("Pure", Position.none));
   333 Context.set_thread_data NONE;
   334 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
   335 
   336 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
   337 
   338 
   339 (* ML toplevel commands *)
   340 
   341 fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
   342 
   343 fun use_thys args = Toplevel.program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
   344 val use_thy = use_thys o single;
   345 
   346 val cd = File.cd o Path.explode;
   347 
   348 Proofterm.proofs := 0;
   349 Multithreading.max_threads := 0;
   350