src/Pure/pure_setup.ML
author wenzelm
Thu Sep 02 00:48:07 2010 +0200 (2010-09-02)
changeset 38980 af73cf0dc31f
parent 38470 484e483eb606
child 40741 17d6293a1e26
permissions -rw-r--r--
turned show_question_marks into proper configuration option;
show_question_marks only affects regular type/term pretty printing, not raw Term.string_of_vname;
tuned;
     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 if String.isPrefix "polyml" ml_system
    22 then toplevel_pp ["String", "string"] "ML_Syntax.pretty_string"
    23 else ();
    24 
    25 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
    26 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
    27 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
    28 toplevel_pp ["Position", "T"] "Pretty.position";
    29 toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of";
    30 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
    31 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
    32 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
    33 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
    34 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
    35 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
    36 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
    37 toplevel_pp ["Syntax", "ast"] "Syntax.pretty_ast";
    38 toplevel_pp ["Path", "T"] "Pretty.str o quote o Path.implode";
    39 toplevel_pp ["File", "ident"] "Pretty.str o quote o File.rep_ident";
    40 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
    41 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
    42 
    43 if ml_system = "polyml-5.2" orelse ml_system = "polyml-5.2.1"
    44 then use "ML/install_pp_polyml.ML"
    45 else if String.isPrefix "polyml" ml_system
    46 then use "ML/install_pp_polyml-5.3.ML"
    47 else ();
    48 
    49 
    50 (* ML toplevel use commands *)
    51 
    52 fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
    53 
    54 fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
    55 fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
    56 
    57 
    58 (* misc *)
    59 
    60 val cd = File.cd o Path.explode;
    61 
    62 Proofterm.proofs := 0;