src/Pure/pure_setup.ML
author wenzelm
Sat May 15 23:23:45 2010 +0200 (2010-05-15)
changeset 36951 985c197f2fe9
parent 33917 186262d7cabf
child 36953 2af1ad9aa1a3
permissions -rw-r--r--
renamed structure ValueParse to Parse_Value;
eliminated old-style structure alias V;
     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"] "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 () => ThyInfo.use name);
    51 fun use_thys name = Toplevel.program (fn () => ThyInfo.use_thys name);
    52 fun use_thy name = Toplevel.program (fn () => ThyInfo.use_thy name);
    53 fun time_use name = Toplevel.program (fn () => ThyInfo.time_use name);
    54 fun time_use_thy name = Toplevel.program (fn () => ThyInfo.time_use_thy name);
    55 
    56 
    57 (* misc *)
    58 
    59 val cd = File.cd o Path.explode;
    60 
    61 Proofterm.proofs := 0;