src/Pure/ROOT.ML
author wenzelm
Sun May 12 18:22:44 2013 +0200 (2013-05-12)
changeset 51947 3301612c4893
parent 51933 a60c6c90a447
child 51967 43fbd02eb9d0
permissions -rw-r--r--
support for system options as context-sensitive config options;
     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 use "System/options.ML";
    71 
    72 
    73 (* concurrency within the ML runtime *)
    74 
    75 if ML_System.is_polyml
    76 then use "ML/exn_properties_polyml.ML"
    77 else use "ML/exn_properties_dummy.ML";
    78 
    79 if ML_System.name = "polyml-5.5.0"
    80 then use "ML/ml_statistics_polyml-5.5.0.ML"
    81 else use "ML/ml_statistics_dummy.ML";
    82 
    83 use "Concurrent/single_assignment.ML";
    84 if Multithreading.available then ()
    85 else use "Concurrent/single_assignment_sequential.ML";
    86 
    87 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
    88 
    89 if Multithreading.available
    90 then use "Concurrent/bash.ML"
    91 else use "Concurrent/bash_sequential.ML";
    92 
    93 use "Concurrent/par_exn.ML";
    94 use "Concurrent/task_queue.ML";
    95 use "Concurrent/future.ML";
    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 
   120 (* inner syntax *)
   121 
   122 use "Syntax/term_position.ML";
   123 use "Syntax/lexicon.ML";
   124 use "Syntax/ast.ML";
   125 use "Syntax/syntax_ext.ML";
   126 use "Syntax/parser.ML";
   127 use "Syntax/syntax_trans.ML";
   128 use "Syntax/mixfix.ML";
   129 use "Syntax/printer.ML";
   130 use "Syntax/syntax.ML";
   131 
   132 
   133 (* core of tactical proof system *)
   134 
   135 use "term_ord.ML";
   136 use "term_subst.ML";
   137 use "term_xml.ML";
   138 use "General/name_space.ML";
   139 use "sorts.ML";
   140 use "type.ML";
   141 use "logic.ML";
   142 use "Syntax/simple_syntax.ML";
   143 use "net.ML";
   144 use "item_net.ML";
   145 use "envir.ML";
   146 use "consts.ML";
   147 use "primitive_defs.ML";
   148 use "defs.ML";
   149 use "sign.ML";
   150 use "term_sharing.ML";
   151 use "pattern.ML";
   152 use "unify.ML";
   153 use "theory.ML";
   154 use "interpretation.ML";
   155 use "proofterm.ML";
   156 use "thm.ML";
   157 use "more_thm.ML";
   158 use "facts.ML";
   159 use "global_theory.ML";
   160 use "pure_thy.ML";
   161 use "drule.ML";
   162 use "morphism.ML";
   163 use "variable.ML";
   164 use "conv.ML";
   165 use "goal_display.ML";
   166 use "tactical.ML";
   167 use "search.ML";
   168 use "tactic.ML";
   169 use "raw_simplifier.ML";
   170 use "conjunction.ML";
   171 use "assumption.ML";
   172 use "display.ML";
   173 
   174 
   175 (* Isar -- Intelligible Semi-Automated Reasoning *)
   176 
   177 (*ML support*)
   178 use "ML/ml_syntax.ML";
   179 use "ML/ml_env.ML";
   180 use "Isar/runtime.ML";
   181 use "ML/ml_compiler.ML";
   182 if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
   183 
   184 use "skip_proof.ML";
   185 use "goal.ML";
   186 
   187 (*proof context*)
   188 use "Isar/object_logic.ML";
   189 use "Isar/rule_cases.ML";
   190 use "Isar/auto_bind.ML";
   191 use "type_infer.ML";
   192 use "Syntax/local_syntax.ML";
   193 use "Isar/proof_context.ML";
   194 use "type_infer_context.ML";
   195 use "Syntax/syntax_phases.ML";
   196 use "Isar/local_defs.ML";
   197 
   198 (*proof term operations*)
   199 use "Proof/reconstruct.ML";
   200 use "Proof/proof_syntax.ML";
   201 use "Proof/proof_rewrite_rules.ML";
   202 use "Proof/proof_checker.ML";
   203 
   204 (*outer syntax*)
   205 use "Isar/token.ML";
   206 use "Isar/keyword.ML";
   207 use "Isar/parse.ML";
   208 use "Isar/args.ML";
   209 use "ML/ml_context.ML";
   210 
   211 (*theory sources*)
   212 use "Thy/thy_header.ML";
   213 use "Thy/thy_syntax.ML";
   214 use "Thy/html.ML";
   215 use "Thy/latex.ML";
   216 
   217 (*basic proof engine*)
   218 use "Isar/proof_display.ML";
   219 use "Isar/attrib.ML";
   220 use "ML/ml_antiquote.ML";
   221 use "Isar/context_rules.ML";
   222 use "Isar/method.ML";
   223 use "Isar/proof.ML";
   224 use "Isar/element.ML";
   225 
   226 (*derived theory and proof elements*)
   227 use "Isar/calculation.ML";
   228 use "Isar/obtain.ML";
   229 
   230 (*local theories and targets*)
   231 use "Isar/local_theory.ML";
   232 use "Isar/locale.ML";
   233 use "Isar/generic_target.ML";
   234 use "Isar/overloading.ML";
   235 use "axclass.ML";
   236 use "Isar/class.ML";
   237 use "Isar/named_target.ML";
   238 use "Isar/expression.ML";
   239 use "Isar/class_declaration.ML";
   240 use "Isar/bundle.ML";
   241 
   242 use "simplifier.ML";
   243 
   244 (*executable theory content*)
   245 use "Isar/code.ML";
   246 
   247 (*specifications*)
   248 use "Isar/parse_spec.ML";
   249 use "Isar/spec_rules.ML";
   250 use "Isar/specification.ML";
   251 use "Isar/typedecl.ML";
   252 use "ML/ml_thms.ML";
   253 
   254 (*toplevel transactions*)
   255 use "Isar/proof_node.ML";
   256 use "Isar/toplevel.ML";
   257 
   258 (*theory documents*)
   259 use "System/isabelle_system.ML";
   260 use "Thy/term_style.ML";
   261 use "Thy/thy_output.ML";
   262 use "PIDE/command.ML";
   263 use "Isar/outer_syntax.ML";
   264 use "General/graph_display.ML";
   265 use "Thy/present.ML";
   266 use "Thy/thy_load.ML";
   267 use "Thy/thy_info.ML";
   268 use "PIDE/document.ML";
   269 use "Thy/rail.ML";
   270 
   271 (*theory and proof operations*)
   272 use "Isar/rule_insts.ML";
   273 use "Thy/thm_deps.ML";
   274 use "Isar/isar_cmd.ML";
   275 
   276 use "subgoal.ML";
   277 
   278 use "Proof/extraction.ML";
   279 
   280 
   281 (* Isabelle/Isar system *)
   282 
   283 use "System/session.ML";
   284 use "System/command_line.ML";
   285 use "System/system_channel.ML";
   286 use "System/isabelle_process.ML";
   287 use "System/invoke_scala.ML";
   288 use "PIDE/protocol.ML";
   289 use "System/isar.ML";
   290 
   291 
   292 (* miscellaneous tools and packages for Pure Isabelle *)
   293 
   294 use "Tools/build.ML";
   295 use "Tools/named_thms.ML";
   296 use "Tools/legacy_xml_syntax.ML";
   297 
   298 
   299 (* configuration for Proof General *)
   300 
   301 use "ProofGeneral/pgip_types.ML";
   302 use "ProofGeneral/pgml.ML";
   303 use "ProofGeneral/pgip_markup.ML";
   304 use "ProofGeneral/pgip_input.ML";
   305 use "ProofGeneral/pgip_output.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 
   352 (* ML toplevel commands *)
   353 
   354 fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
   355 
   356 fun use_thys args = Toplevel.program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
   357 val use_thy = use_thys o single;
   358 
   359 val cd = File.cd o Path.explode;
   360 
   361 Proofterm.proofs := 0;
   362 Multithreading.max_threads := 0;
   363