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