src/Pure/pure_setup.ML
author wenzelm
Sat Dec 13 15:00:39 2008 +0100 (2008-12-13)
changeset 29091 b81fe045e799
parent 28557 6a661aeff564
child 29123 63c25d3964f7
permissions -rw-r--r--
Context.display_names;
     1 (*  Title:      Pure/pure_setup.ML
     2     ID:         $Id$
     3     Author:     Makarius
     4 
     5 Pure theory and ML toplevel setup.
     6 *)
     7 
     8 (* ML toplevel use commands *)
     9 
    10 fun use name          = Toplevel.program (fn () => ThyInfo.use name);
    11 fun use_thys name     = Toplevel.program (fn () => ThyInfo.use_thys name);
    12 fun use_thy name      = Toplevel.program (fn () => ThyInfo.use_thy name);
    13 fun time_use name     = Toplevel.program (fn () => ThyInfo.time_use name);
    14 fun time_use_thy name = Toplevel.program (fn () => ThyInfo.time_use_thy name);
    15 
    16 
    17 (* the Pure theories *)
    18 
    19 val theory = ThyInfo.get_theory;
    20 
    21 Context.>> (Context.map_theory
    22  (OuterSyntax.process_file (Path.explode "Pure.thy") #>
    23   Theory.end_theory));
    24 structure Pure = struct val thy = ML_Context.the_global_context () end;
    25 Context.set_thread_data NONE;
    26 ThyInfo.register_theory Pure.thy;
    27 
    28 
    29 (* ML toplevel pretty printing *)
    30 
    31 install_pp (make_pp ["TaskQueue", "task"] (Pretty.pprint o Pretty.str o TaskQueue.str_of_task));
    32 install_pp (make_pp ["TaskQueue", "group"] (Pretty.pprint o Pretty.str o TaskQueue.str_of_group));
    33 install_pp (make_pp ["Position", "T"] (Pretty.pprint o Pretty.enum "," "{" "}" o
    34   map (fn (x, y) => Pretty.str (x ^ "=" ^ y)) o Position.properties_of));
    35 install_pp (make_pp ["Thm", "thm"] ProofDisplay.pprint_thm);
    36 install_pp (make_pp ["Thm", "cterm"] ProofDisplay.pprint_cterm);
    37 install_pp (make_pp ["Thm", "ctyp"] ProofDisplay.pprint_ctyp);
    38 install_pp (make_pp ["Context", "theory"] Context.pprint_thy);
    39 install_pp (make_pp ["Context", "theory_ref"] Context.pprint_thy_ref);
    40 install_pp (make_pp ["Context", "proof"] ProofDisplay.pprint_context);
    41 install_pp (make_pp ["Syntax", "ast"] Syntax.pprint_ast);
    42 install_pp (make_pp ["typ"] (ProofDisplay.pprint_typ Pure.thy));
    43 install_pp (make_pp ["Path", "T"] (Pretty.pprint o Pretty.str o quote o Path.implode));
    44 install_pp (make_pp ["File", "ident"] (Pretty.pprint o Pretty.str o quote o File.rep_ident));
    45 
    46 if String.isPrefix "polyml" ml_system then use "ML-Systems/install_pp_polyml.ML"
    47 else ();
    48 
    49 
    50 (* misc *)
    51 
    52 val cd = File.cd o Path.explode;
    53 ml_prompts "ML> " "ML# ";
    54 
    55 Proofterm.proofs := 0;