src/Pure/pure_setup.ML
author wenzelm
Wed Jan 21 22:26:49 2009 +0100 (2009-01-21)
changeset 29605 f2924219125e
parent 29198 418ed6411847
child 29618 8161c8e3fa10
permissions -rw-r--r--
eliminated obsolete var morphism;
     1 (*  Title:      Pure/pure_setup.ML
     2     Author:     Makarius
     3 
     4 Pure theory and ML toplevel setup.
     5 *)
     6 
     7 (* ML toplevel use commands *)
     8 
     9 fun use name          = Toplevel.program (fn () => ThyInfo.use name);
    10 fun use_thys name     = Toplevel.program (fn () => ThyInfo.use_thys name);
    11 fun use_thy name      = Toplevel.program (fn () => ThyInfo.use_thy name);
    12 fun time_use name     = Toplevel.program (fn () => ThyInfo.time_use name);
    13 fun time_use_thy name = Toplevel.program (fn () => ThyInfo.time_use_thy name);
    14 
    15 
    16 (* the Pure theories *)
    17 
    18 val theory = ThyInfo.get_theory;
    19 
    20 Context.>> (Context.map_theory
    21  (OuterSyntax.process_file (Path.explode "Pure.thy") #>
    22   Theory.end_theory));
    23 structure Pure = struct val thy = ML_Context.the_global_context () end;
    24 Context.set_thread_data NONE;
    25 ThyInfo.register_theory Pure.thy;
    26 
    27 
    28 (* ML toplevel pretty printing *)
    29 
    30 install_pp (make_pp ["Task_Queue", "task"] (Pretty.pprint o Pretty.str o Task_Queue.str_of_task));
    31 install_pp (make_pp ["Task_Queue", "group"] (Pretty.pprint o Pretty.str o Task_Queue.str_of_group));
    32 install_pp (make_pp ["Position", "T"] (Pretty.pprint o Pretty.enum "," "{" "}" o
    33   map (fn (x, y) => Pretty.str (x ^ "=" ^ y)) o Position.properties_of));
    34 install_pp (make_pp ["Thm", "thm"] ProofDisplay.pprint_thm);
    35 install_pp (make_pp ["Thm", "cterm"] ProofDisplay.pprint_cterm);
    36 install_pp (make_pp ["Binding", "T"] (Pretty.pprint o Pretty.str o Binding.display));
    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;