src/Pure/pure_setup.ML
author wenzelm
Thu, 24 Jun 2010 23:20:47 +0200
changeset 37552 75de61a479e3
parent 37530 a23e8aa853eb
child 38126 e1ef6b441fe7
permissions -rw-r--r--
ML pretty printing of type string according to (quasi-abstract) YXML markup and symbols (including UTF8);
     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 ["String", "string"] "ML_Syntax.pretty_string";
    22 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
    23 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
    24 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
    25 toplevel_pp ["Position", "T"] "Pretty.position";
    26 toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of";
    27 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
    28 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
    29 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
    30 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
    31 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
    32 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
    33 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
    34 toplevel_pp ["Syntax", "ast"] "Syntax.pretty_ast";
    35 toplevel_pp ["Path", "T"] "Pretty.str o quote o Path.implode";
    36 toplevel_pp ["File", "ident"] "Pretty.str o quote o File.rep_ident";
    37 
    38 if ml_system = "polyml-5.3.0"
    39 then use "ML-Systems/install_pp_polyml-5.3.ML"
    40 else if String.isPrefix "polyml" ml_system
    41 then use "ML-Systems/install_pp_polyml.ML"
    42 else ();
    43 
    44 if ml_system = "polyml-5.0" orelse ml_system = "polyml-5.1" then
    45   Secure.use_text ML_Parse.global_context (0, "") false
    46     "PolyML.Compiler.maxInlineSize := 20"
    47 else ();
    48 
    49 
    50 (* ML toplevel use commands *)
    51 
    52 fun use name = Toplevel.program (fn () => Thy_Info.use name);
    53 fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
    54 fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
    55 fun time_use name = Toplevel.program (fn () => Thy_Info.time_use name);
    56 fun time_use_thy name = Toplevel.program (fn () => Thy_Info.time_use_thy name);
    57 
    58 
    59 (* misc *)
    60 
    61 val cd = File.cd o Path.explode;
    62 
    63 Proofterm.proofs := 0;