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;
wenzelm@23828
     1
(*  Title:      Pure/pure_setup.ML
wenzelm@23828
     2
    Author:     Makarius
wenzelm@23828
     3
wenzelm@24053
     4
Pure theory and ML toplevel setup.
wenzelm@23828
     5
*)
wenzelm@23828
     6
wenzelm@37954
     7
(* the Pure theory *)
wenzelm@24053
     8
wenzelm@26463
     9
Context.>> (Context.map_theory
wenzelm@36953
    10
 (Outer_Syntax.process_file (Path.explode "Pure.thy") #>
wenzelm@26463
    11
  Theory.end_theory));
wenzelm@37954
    12
wenzelm@26427
    13
structure Pure = struct val thy = ML_Context.the_global_context () end;
wenzelm@37954
    14
wenzelm@26427
    15
Context.set_thread_data NONE;
wenzelm@37954
    16
Thy_Info.register_thy Pure.thy;
wenzelm@23828
    17
wenzelm@24053
    18
wenzelm@24053
    19
(* ML toplevel pretty printing *)
wenzelm@24053
    20
wenzelm@38470
    21
if String.isPrefix "polyml" ml_system
wenzelm@38470
    22
then toplevel_pp ["String", "string"] "ML_Syntax.pretty_string"
wenzelm@38470
    23
else ();
wenzelm@37860
    24
wenzelm@37529
    25
toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
wenzelm@30625
    26
toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
wenzelm@30625
    27
toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
wenzelm@30625
    28
toplevel_pp ["Position", "T"] "Pretty.position";
wenzelm@30625
    29
toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of";
wenzelm@33389
    30
toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
wenzelm@33389
    31
toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
wenzelm@33389
    32
toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
wenzelm@33389
    33
toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
wenzelm@30625
    34
toplevel_pp ["Context", "theory"] "Context.pretty_thy";
wenzelm@30625
    35
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
wenzelm@33389
    36
toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
wenzelm@30625
    37
toplevel_pp ["Syntax", "ast"] "Syntax.pretty_ast";
wenzelm@30625
    38
toplevel_pp ["Path", "T"] "Pretty.str o quote o Path.implode";
wenzelm@30625
    39
toplevel_pp ["File", "ident"] "Pretty.str o quote o File.rep_ident";
wenzelm@37858
    40
toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
wenzelm@37858
    41
toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
wenzelm@24053
    42
wenzelm@38470
    43
if ml_system = "polyml-5.2" orelse ml_system = "polyml-5.2.1"
wenzelm@38327
    44
then use "ML/install_pp_polyml.ML"
wenzelm@38470
    45
else if String.isPrefix "polyml" ml_system
wenzelm@38470
    46
then use "ML/install_pp_polyml-5.3.ML"
wenzelm@33917
    47
else ();
wenzelm@33917
    48
wenzelm@24053
    49
wenzelm@31646
    50
(* ML toplevel use commands *)
wenzelm@31646
    51
wenzelm@37949
    52
fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
wenzelm@37949
    53
wenzelm@37216
    54
fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
wenzelm@37216
    55
fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
wenzelm@31646
    56
wenzelm@31646
    57
wenzelm@24053
    58
(* misc *)
wenzelm@24053
    59
wenzelm@23828
    60
val cd = File.cd o Path.explode;
wenzelm@23828
    61
wenzelm@25223
    62
Proofterm.proofs := 0;