src/Pure/pure_setup.ML
author wenzelm
Mon, 31 May 2010 21:06:57 +0200
changeset 37216 3165bc303f66
parent 36953 2af1ad9aa1a3
child 37530 a23e8aa853eb
permissions -rw-r--r--
modernized some structure names, keeping a few legacy aliases;
     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 = Thy_Info.get_theory;
    10 
    11 Context.>> (Context.map_theory
    12  (Outer_Syntax.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 Thy_Info.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"] "Proof_Display.pp_thm";
    26 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
    27 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
    28 toplevel_pp ["typ"] "Proof_Display.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", "context"] "Proof_Display.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-5.3.0"
    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 if ml_system = "polyml-5.0" orelse ml_system = "polyml-5.1" then
    43   Secure.use_text ML_Parse.global_context (0, "") false
    44     "PolyML.Compiler.maxInlineSize := 20"
    45 else ();
    46 
    47 
    48 (* ML toplevel use commands *)
    49 
    50 fun use name = Toplevel.program (fn () => Thy_Info.use name);
    51 fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
    52 fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
    53 fun time_use name = Toplevel.program (fn () => Thy_Info.time_use name);
    54 fun time_use_thy name = Toplevel.program (fn () => Thy_Info.time_use_thy name);
    55 
    56 
    57 (* misc *)
    58 
    59 val cd = File.cd o Path.explode;
    60 
    61 Proofterm.proofs := 0;