src/Pure/ROOT.ML
author wenzelm
Thu Mar 20 19:24:51 2014 +0100 (2014-03-20)
changeset 56229 f61eaab6bec3
parent 56210 c7c85cdb725d
child 56281 03c3d1a7c3b8
permissions -rw-r--r--
tuned error, according to "use" in General/secure.ML;
     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 ML bootstrap 0 ^^^^^*)
    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/change_table.ML";
    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.1"
    80   orelse ML_System.name = "polyml-5.5.2"
    81 then use "ML/exn_trace_polyml-5.5.1.ML"
    82 else ();
    83 
    84 if ML_System.name = "polyml-5.5.0"
    85   orelse ML_System.name = "polyml-5.5.1"
    86   orelse ML_System.name = "polyml-5.5.2"
    87 then use "ML/ml_statistics_polyml-5.5.0.ML"
    88 else use "ML/ml_statistics_dummy.ML";
    89 
    90 use "Concurrent/single_assignment.ML";
    91 if Multithreading.available then ()
    92 else use "Concurrent/single_assignment_sequential.ML";
    93 
    94 if Multithreading.available
    95 then use "Concurrent/bash.ML"
    96 else use "Concurrent/bash_sequential.ML";
    97 
    98 use "Concurrent/par_exn.ML";
    99 use "Concurrent/task_queue.ML";
   100 use "Concurrent/future.ML";
   101 use "Concurrent/event_timer.ML";
   102 
   103 if ML_System.is_polyml then use "Concurrent/time_limit.ML" else ();
   104 
   105 use "Concurrent/lazy.ML";
   106 if Multithreading.available then ()
   107 else use "Concurrent/lazy_sequential.ML";
   108 
   109 use "Concurrent/par_list.ML";
   110 if Multithreading.available then ()
   111 else use "Concurrent/par_list_sequential.ML";
   112 
   113 use "Concurrent/mailbox.ML";
   114 use "Concurrent/cache.ML";
   115 
   116 use "PIDE/active.ML";
   117 
   118 
   119 (* fundamental structures *)
   120 
   121 use "name.ML";
   122 use "term.ML";
   123 use "context.ML";
   124 use "context_position.ML";
   125 use "config.ML";
   126 
   127 val quick_and_dirty_raw = Config.declare_option "quick_and_dirty";
   128 val quick_and_dirty = Config.bool quick_and_dirty_raw;
   129 
   130 
   131 (* inner syntax *)
   132 
   133 use "Syntax/type_annotation.ML";
   134 use "Syntax/term_position.ML";
   135 use "Syntax/lexicon.ML";
   136 use "Syntax/ast.ML";
   137 use "Syntax/syntax_ext.ML";
   138 use "Syntax/parser.ML";
   139 use "Syntax/syntax_trans.ML";
   140 use "Syntax/mixfix.ML";
   141 use "Syntax/printer.ML";
   142 use "Syntax/syntax.ML";
   143 
   144 
   145 (* core of tactical proof system *)
   146 
   147 use "term_ord.ML";
   148 use "term_subst.ML";
   149 use "term_xml.ML";
   150 use "General/completion.ML";
   151 use "General/name_space.ML";
   152 use "sorts.ML";
   153 use "type.ML";
   154 use "logic.ML";
   155 use "Syntax/simple_syntax.ML";
   156 use "net.ML";
   157 use "item_net.ML";
   158 use "envir.ML";
   159 use "consts.ML";
   160 use "primitive_defs.ML";
   161 use "defs.ML";
   162 use "sign.ML";
   163 use "term_sharing.ML";
   164 use "pattern.ML";
   165 use "unify.ML";
   166 use "theory.ML";
   167 use "interpretation.ML";
   168 use "proofterm.ML";
   169 use "thm.ML";
   170 use "more_thm.ML";
   171 use "facts.ML";
   172 use "global_theory.ML";
   173 use "pure_thy.ML";
   174 use "drule.ML";
   175 use "morphism.ML";
   176 use "variable.ML";
   177 use "conv.ML";
   178 use "goal_display.ML";
   179 use "tactical.ML";
   180 use "search.ML";
   181 use "tactic.ML";
   182 use "raw_simplifier.ML";
   183 use "conjunction.ML";
   184 use "assumption.ML";
   185 use "display.ML";
   186 
   187 
   188 (* Isar -- Intelligible Semi-Automated Reasoning *)
   189 
   190 (*ML support*)
   191 use "ML/ml_syntax.ML";
   192 use "ML/ml_env.ML";
   193 use "Isar/runtime.ML";
   194 use "ML/ml_compiler.ML";
   195 if ML_System.is_polyml then use "ML/ml_compiler_polyml.ML" else ();
   196 
   197 (*global execution*)
   198 use "PIDE/document_id.ML";
   199 use "PIDE/execution.ML";
   200 use "skip_proof.ML";
   201 use "goal.ML";
   202 
   203 (*proof context*)
   204 use "Isar/object_logic.ML";
   205 use "Isar/rule_cases.ML";
   206 use "Isar/auto_bind.ML";
   207 use "type_infer.ML";
   208 use "Syntax/local_syntax.ML";
   209 use "Isar/proof_context.ML";
   210 use "type_infer_context.ML";
   211 use "Syntax/syntax_phases.ML";
   212 use "Isar/local_defs.ML";
   213 
   214 (*outer syntax*)
   215 use "Isar/token.ML";
   216 use "Isar/keyword.ML";
   217 use "Isar/parse.ML";
   218 use "Isar/args.ML";
   219 
   220 (*theory sources*)
   221 use "Thy/thy_header.ML";
   222 use "Thy/thy_syntax.ML";
   223 use "Thy/html.ML";
   224 use "Thy/latex.ML";
   225 
   226 (*ML with context and antiquotations*)
   227 use "ML/ml_context.ML";
   228 use "ML/ml_antiquotation.ML";
   229 (*^^^^^ end of ML bootstrap 1 ^^^^^*)
   230 
   231 (*basic proof engine*)
   232 use "Isar/proof_display.ML";
   233 use "Isar/attrib.ML";
   234 use "Isar/context_rules.ML";
   235 use "Isar/method.ML";
   236 use "Isar/proof.ML";
   237 use "Isar/element.ML";
   238 use "Isar/obtain.ML";
   239 
   240 (*local theories and targets*)
   241 use "Isar/locale.ML";
   242 use "Isar/local_theory.ML";
   243 use "Isar/generic_target.ML";
   244 use "Isar/overloading.ML";
   245 use "axclass.ML";
   246 use "Isar/class.ML";
   247 use "Isar/named_target.ML";
   248 use "Isar/expression.ML";
   249 use "Isar/class_declaration.ML";
   250 use "Isar/bundle.ML";
   251 
   252 use "simplifier.ML";
   253 
   254 (*executable theory content*)
   255 use "Isar/code.ML";
   256 
   257 (*specifications*)
   258 use "Isar/parse_spec.ML";
   259 use "Isar/spec_rules.ML";
   260 use "Isar/specification.ML";
   261 use "Isar/typedecl.ML";
   262 
   263 (*toplevel transactions*)
   264 use "Isar/proof_node.ML";
   265 use "Isar/toplevel.ML";
   266 
   267 (*proof term operations*)
   268 use "Proof/reconstruct.ML";
   269 use "Proof/proof_syntax.ML";
   270 use "Proof/proof_rewrite_rules.ML";
   271 use "Proof/proof_checker.ML";
   272 use "Proof/extraction.ML";
   273 
   274 (*theory documents*)
   275 use "System/isabelle_system.ML";
   276 use "Thy/term_style.ML";
   277 use "Thy/thy_output.ML";
   278 use "Isar/outer_syntax.ML";
   279 use "General/graph_display.ML";
   280 use "Thy/present.ML";
   281 use "PIDE/command.ML";
   282 use "PIDE/query_operation.ML";
   283 use "PIDE/resources.ML";
   284 use "Thy/thy_info.ML";
   285 use "PIDE/document.ML";
   286 
   287 (*theory and proof operations*)
   288 use "Thy/thm_deps.ML";
   289 use "Isar/isar_cmd.ML";
   290 
   291 use "subgoal.ML";
   292 
   293 
   294 (* Isabelle/Isar system *)
   295 
   296 use "PIDE/session.ML";
   297 use "System/command_line.ML";
   298 use "System/system_channel.ML";
   299 use "System/message_channel.ML";
   300 use "System/isabelle_process.ML";
   301 use "System/invoke_scala.ML";
   302 use "PIDE/protocol.ML";
   303 use "System/isar.ML";
   304 
   305 
   306 (* miscellaneous tools and packages for Pure Isabelle *)
   307 
   308 use "Tools/build.ML";
   309 use "Tools/named_thms.ML";
   310 use "Tools/proof_general.ML";
   311 
   312 structure Output: OUTPUT = Output;  (*seal system channels!*)
   313 
   314 
   315 (* ML toplevel pretty printing *)
   316 
   317 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
   318 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
   319 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
   320 toplevel_pp ["Position", "T"] "Pretty.position";
   321 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
   322 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
   323 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
   324 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
   325 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
   326 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
   327 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
   328 toplevel_pp ["Path", "T"] "Path.pretty";
   329 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
   330 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
   331 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
   332 toplevel_pp ["Morphism", "morphism"] "Morphism.pretty";
   333 
   334 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
   335 
   336 
   337 (* the Pure theory *)
   338 
   339 use "pure_syn.ML";
   340 Toplevel.program (fn () => Thy_Info.use_thy ("Pure", Position.none));
   341 Context.set_thread_data NONE;
   342 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
   343 
   344 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
   345 
   346 
   347 (* ML toplevel commands *)
   348 
   349 fun use_thys args = Toplevel.program (fn () => Thy_Info.use_thys (map (rpair Position.none) args));
   350 val use_thy = use_thys o single;
   351 
   352 val cd = File.cd o Path.explode;
   353 
   354 Proofterm.proofs := 0;
   355