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