src/Pure/ROOT.ML
author wenzelm
Mon Dec 10 13:52:33 2012 +0100 (2012-12-10)
changeset 50450 358b6020f8b6
parent 50255 d0ec1f0d1d7d
child 50498 6647ba2775c1
permissions -rw-r--r--
generalized notion of active area, where sendback is just one application;
some support for graphview via active area;
     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 "General/timing.ML";
    32 use "PIDE/markup.ML";
    33 fun legacy_feature s = warning (Markup.markup Markup.legacy ("Legacy feature! " ^ s));
    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 
    61 use "General/sha1.ML";
    62 if ML_System.is_polyml then use "General/sha1_polyml.ML" else ();
    63 
    64 use "PIDE/xml.ML";
    65 use "PIDE/yxml.ML";
    66 use "PIDE/active.ML";
    67 
    68 use "General/graph.ML";
    69 
    70 
    71 (* concurrency within the ML runtime *)
    72 
    73 if ML_System.name = "polyml-5.5.0"
    74 then use "ML/ml_statistics_polyml-5.5.0.ML"
    75 else use "ML/ml_statistics_dummy.ML";
    76 
    77 use "Concurrent/single_assignment.ML";
    78 if Multithreading.available then ()
    79 else use "Concurrent/single_assignment_sequential.ML";
    80 
    81 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
    82 
    83 if Multithreading.available
    84 then use "Concurrent/bash.ML"
    85 else use "Concurrent/bash_sequential.ML";
    86 
    87 use "Concurrent/par_exn.ML";
    88 use "Concurrent/task_queue.ML";
    89 use "Concurrent/future.ML";
    90 
    91 use "Concurrent/lazy.ML";
    92 if Multithreading.available then ()
    93 else use "Concurrent/lazy_sequential.ML";
    94 
    95 use "Concurrent/par_list.ML";
    96 if Multithreading.available then ()
    97 else use "Concurrent/par_list_sequential.ML";
    98 
    99 use "Concurrent/mailbox.ML";
   100 use "Concurrent/cache.ML";
   101 
   102 
   103 (* fundamental structures *)
   104 
   105 use "name.ML";
   106 use "term.ML";
   107 use "context.ML";
   108 use "context_position.ML";
   109 use "config.ML";
   110 use "System/options.ML";
   111 
   112 
   113 (* inner syntax *)
   114 
   115 use "Syntax/term_position.ML";
   116 use "Syntax/lexicon.ML";
   117 use "Syntax/ast.ML";
   118 use "Syntax/syntax_ext.ML";
   119 use "Syntax/parser.ML";
   120 use "Syntax/syntax_trans.ML";
   121 use "Syntax/mixfix.ML";
   122 use "Syntax/printer.ML";
   123 use "Syntax/syntax.ML";
   124 
   125 
   126 (* core of tactical proof system *)
   127 
   128 use "term_ord.ML";
   129 use "term_subst.ML";
   130 use "term_xml.ML";
   131 use "General/name_space.ML";
   132 use "sorts.ML";
   133 use "type.ML";
   134 use "logic.ML";
   135 use "Syntax/simple_syntax.ML";
   136 use "net.ML";
   137 use "item_net.ML";
   138 use "envir.ML";
   139 use "consts.ML";
   140 use "primitive_defs.ML";
   141 use "defs.ML";
   142 use "sign.ML";
   143 use "term_sharing.ML";
   144 use "pattern.ML";
   145 use "unify.ML";
   146 use "theory.ML";
   147 use "interpretation.ML";
   148 use "proofterm.ML";
   149 use "thm.ML";
   150 use "more_thm.ML";
   151 use "facts.ML";
   152 use "global_theory.ML";
   153 use "pure_thy.ML";
   154 use "drule.ML";
   155 use "morphism.ML";
   156 use "variable.ML";
   157 use "conv.ML";
   158 use "goal_display.ML";
   159 use "tactical.ML";
   160 use "search.ML";
   161 use "tactic.ML";
   162 use "raw_simplifier.ML";
   163 use "conjunction.ML";
   164 use "assumption.ML";
   165 use "display.ML";
   166 
   167 
   168 (* Isar -- Intelligible Semi-Automated Reasoning *)
   169 
   170 (*ML support*)
   171 use "ML/ml_syntax.ML";
   172 use "ML/ml_env.ML";
   173 use "Isar/runtime.ML";
   174 use "ML/ml_compiler.ML";
   175 if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
   176 
   177 use "goal.ML";
   178 
   179 (*proof context*)
   180 use "Isar/object_logic.ML";
   181 use "Isar/rule_cases.ML";
   182 use "Isar/auto_bind.ML";
   183 use "type_infer.ML";
   184 use "Syntax/local_syntax.ML";
   185 use "Isar/proof_context.ML";
   186 use "type_infer_context.ML";
   187 use "Syntax/syntax_phases.ML";
   188 use "Isar/local_defs.ML";
   189 
   190 (*proof term operations*)
   191 use "Proof/reconstruct.ML";
   192 use "Proof/proof_syntax.ML";
   193 use "Proof/proof_rewrite_rules.ML";
   194 use "Proof/proof_checker.ML";
   195 
   196 (*outer syntax*)
   197 use "Isar/token.ML";
   198 use "Isar/keyword.ML";
   199 use "Isar/parse.ML";
   200 use "Isar/args.ML";
   201 use "ML/ml_context.ML";
   202 
   203 (*theory sources*)
   204 use "Thy/thy_header.ML";
   205 use "Thy/html.ML";
   206 use "Thy/latex.ML";
   207 
   208 (*basic proof engine*)
   209 use "Isar/proof_display.ML";
   210 use "Isar/attrib.ML";
   211 use "ML/ml_antiquote.ML";
   212 use "Isar/context_rules.ML";
   213 use "Isar/skip_proof.ML";
   214 use "Isar/method.ML";
   215 use "Isar/proof.ML";
   216 use "Isar/element.ML";
   217 
   218 (*derived theory and proof elements*)
   219 use "Isar/calculation.ML";
   220 use "Isar/obtain.ML";
   221 
   222 (*local theories and targets*)
   223 use "Isar/local_theory.ML";
   224 use "Isar/locale.ML";
   225 use "Isar/generic_target.ML";
   226 use "Isar/overloading.ML";
   227 use "axclass.ML";
   228 use "Isar/class.ML";
   229 use "Isar/named_target.ML";
   230 use "Isar/expression.ML";
   231 use "Isar/class_declaration.ML";
   232 use "Isar/bundle.ML";
   233 
   234 use "simplifier.ML";
   235 
   236 (*executable theory content*)
   237 use "Isar/code.ML";
   238 
   239 (*specifications*)
   240 use "Isar/parse_spec.ML";
   241 use "Isar/spec_rules.ML";
   242 use "Isar/specification.ML";
   243 use "Isar/typedecl.ML";
   244 use "ML/ml_thms.ML";
   245 
   246 (*toplevel transactions*)
   247 use "Isar/proof_node.ML";
   248 use "Isar/toplevel.ML";
   249 
   250 (*theory documents*)
   251 use "System/isabelle_system.ML";
   252 use "Thy/term_style.ML";
   253 use "Thy/thy_output.ML";
   254 use "Thy/thy_syntax.ML";
   255 use "PIDE/command.ML";
   256 use "Isar/outer_syntax.ML";
   257 use "General/graph_display.ML";
   258 use "Thy/present.ML";
   259 use "Thy/thy_load.ML";
   260 use "Thy/thy_info.ML";
   261 use "PIDE/document.ML";
   262 use "Thy/rail.ML";
   263 
   264 (*theory and proof operations*)
   265 use "Isar/rule_insts.ML";
   266 use "Thy/thm_deps.ML";
   267 use "Isar/isar_cmd.ML";
   268 
   269 use "subgoal.ML";
   270 
   271 use "Proof/extraction.ML";
   272 
   273 
   274 (* Isabelle/Isar system *)
   275 
   276 use "System/session.ML";
   277 use "System/command_line.ML";
   278 use "System/build.ML";
   279 use "System/system_channel.ML";
   280 use "System/isabelle_process.ML";
   281 use "System/invoke_scala.ML";
   282 use "PIDE/protocol.ML";
   283 use "System/isar.ML";
   284 
   285 
   286 (* miscellaneous tools and packages for Pure Isabelle *)
   287 
   288 use "Tools/named_thms.ML";
   289 
   290 use "Tools/legacy_xml_syntax.ML";
   291 
   292 
   293 (* configuration for Proof General *)
   294 
   295 use "ProofGeneral/pgip_types.ML";
   296 use "ProofGeneral/pgml.ML";
   297 use "ProofGeneral/pgip_markup.ML";
   298 use "ProofGeneral/pgip_input.ML";
   299 use "ProofGeneral/pgip_output.ML";
   300 use "ProofGeneral/pgip.ML";
   301 
   302 use "ProofGeneral/pgip_isabelle.ML";
   303 
   304 use "ProofGeneral/preferences.ML";
   305 
   306 use "ProofGeneral/pgip_parser.ML";
   307 
   308 use "ProofGeneral/proof_general_pgip.ML";
   309 use "ProofGeneral/proof_general_emacs.ML";
   310 
   311 
   312 (* ML toplevel pretty printing *)
   313 
   314 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
   315 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
   316 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
   317 toplevel_pp ["Position", "T"] "Pretty.position";
   318 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
   319 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
   320 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
   321 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
   322 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
   323 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
   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 
   331 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
   332 
   333 
   334 (* the Pure theory *)
   335 
   336 use "pure_syn.ML";
   337 Toplevel.program (fn () => Thy_Info.use_thy ("Pure", Position.none));
   338 Context.set_thread_data NONE;
   339 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
   340 
   341 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
   342 
   343 use "ProofGeneral/pgip_tests.ML";
   344 
   345 
   346 (* ML toplevel commands *)
   347 
   348 fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
   349 
   350 fun use_thys args = Toplevel.program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
   351 val use_thy = use_thys o single;
   352 
   353 val cd = File.cd o Path.explode;
   354 
   355 Proofterm.proofs := 0;
   356 Multithreading.max_threads := 0;
   357