src/Pure/pure_setup.ML
author wenzelm
Thu Oct 01 23:27:05 2009 +0200 (2009-10-01)
changeset 32843 c8f5a7c8353f
parent 31646 ef30cd0e41e5
child 33032 a707a1f37d29
permissions -rw-r--r--
moved cache_conv to src/Pure/conv.ML, use Thm.cterm_cache;
     1 (*  Title:      Pure/pure_setup.ML
     2     Author:     Makarius
     3 
     4 Pure theory and ML toplevel setup.
     5 *)
     6 
     7 (* the Pure theories *)
     8 
     9 val theory = ThyInfo.get_theory;
    10 
    11 Context.>> (Context.map_theory
    12  (OuterSyntax.process_file (Path.explode "Pure.thy") #>
    13   Theory.end_theory));
    14 structure Pure = struct val thy = ML_Context.the_global_context () end;
    15 Context.set_thread_data NONE;
    16 ThyInfo.register_theory Pure.thy;
    17 
    18 
    19 (* ML toplevel pretty printing *)
    20 
    21 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
    22 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
    23 toplevel_pp ["Position", "T"] "Pretty.position";
    24 toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of";
    25 toplevel_pp ["Thm", "thm"] "ProofDisplay.pp_thm";
    26 toplevel_pp ["Thm", "cterm"] "ProofDisplay.pp_cterm";
    27 toplevel_pp ["Thm", "ctyp"] "ProofDisplay.pp_ctyp";
    28 toplevel_pp ["typ"] "ProofDisplay.pp_typ Pure.thy";
    29 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
    30 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
    31 toplevel_pp ["Context", "proof"] "ProofDisplay.pp_context";
    32 toplevel_pp ["Syntax", "ast"] "Syntax.pretty_ast";
    33 toplevel_pp ["Path", "T"] "Pretty.str o quote o Path.implode";
    34 toplevel_pp ["File", "ident"] "Pretty.str o quote o File.rep_ident";
    35 
    36 if ml_system = "polyml-experimental"
    37 then use "ML-Systems/install_pp_polyml-5.3.ML"
    38 else if String.isPrefix "polyml" ml_system
    39 then use "ML-Systems/install_pp_polyml.ML"
    40 else ();
    41 
    42 
    43 (* ML toplevel use commands *)
    44 
    45 fun use name          = Toplevel.program (fn () => ThyInfo.use name);
    46 fun use_thys name     = Toplevel.program (fn () => ThyInfo.use_thys name);
    47 fun use_thy name      = Toplevel.program (fn () => ThyInfo.use_thy name);
    48 fun time_use name     = Toplevel.program (fn () => ThyInfo.time_use name);
    49 fun time_use_thy name = Toplevel.program (fn () => ThyInfo.time_use_thy name);
    50 
    51 
    52 (* misc *)
    53 
    54 val cd = File.cd o Path.explode;
    55 
    56 Proofterm.proofs := 0;