src/Pure/pure_setup.ML
author wenzelm
Wed Jul 13 10:57:09 2011 +0200 (2011-07-13)
changeset 43791 5e9a1d71f94d
parent 43784 c3b6374278fa
child 43948 8f5add916a99
permissions -rw-r--r--
XML.pretty with depth limit;
     1 (*  Title:      Pure/pure_setup.ML
     2     Author:     Makarius
     3 
     4 Pure theory and ML toplevel setup.
     5 *)
     6 
     7 (* the Pure theory *)
     8 
     9 Context.>> (Context.map_theory
    10  (Outer_Syntax.process_file (Path.explode "Pure.thy") #>
    11   Theory.end_theory));
    12 
    13 structure Pure = struct val thy = ML_Context.the_global_context () end;
    14 
    15 Context.set_thread_data NONE;
    16 Thy_Info.register_thy Pure.thy;
    17 
    18 
    19 (* ML toplevel pretty printing *)
    20 
    21 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
    22 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
    23 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
    24 toplevel_pp ["Position", "T"] "Pretty.position";
    25 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
    26 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
    27 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
    28 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
    29 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
    30 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
    31 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
    32 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
    33 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
    34 toplevel_pp ["Path", "T"] "Path.pretty";
    35 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
    36 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
    37 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
    38 
    39 if ml_system = "polyml-5.2.1"
    40 then use "ML/install_pp_polyml.ML"
    41 else if String.isPrefix "polyml" ml_system
    42 then use "ML/install_pp_polyml-5.3.ML"
    43 else ();
    44 
    45 
    46 (* ML toplevel use commands *)
    47 
    48 fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
    49 
    50 fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
    51 fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
    52 
    53 
    54 (* misc *)
    55 
    56 val cd = File.cd o Path.explode;
    57 
    58 Proofterm.proofs := 0;
    59 
    60 (*legacy*)
    61 structure ProofContext = Proof_Context;
    62