src/Pure/pure_setup.ML
author wenzelm
Thu Aug 02 12:36:54 2012 +0200 (2012-08-02)
changeset 48646 91281e9472d8
parent 48641 92b48b8abfe4
permissions -rw-r--r--
more official command specifications, including source position;
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@48638
     7
(* ML toplevel use commands *)
wenzelm@48638
     8
wenzelm@48638
     9
fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name));
wenzelm@48638
    10
wenzelm@48638
    11
fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
wenzelm@48638
    12
fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
wenzelm@48638
    13
wenzelm@48638
    14
wenzelm@37954
    15
(* the Pure theory *)
wenzelm@24053
    16
wenzelm@48641
    17
val _ =
wenzelm@48646
    18
  Outer_Syntax.command
wenzelm@48646
    19
    (("theory", Keyword.tag_theory Keyword.thy_begin), Position.none) "begin theory context"
wenzelm@48641
    20
    (Thy_Header.args >> (fn header =>
wenzelm@48641
    21
      Toplevel.print o
wenzelm@48641
    22
        Toplevel.init_theory
wenzelm@48641
    23
          (fn () => Thy_Info.toplevel_begin_theory (Thy_Load.get_master_path ()) header)));
wenzelm@48641
    24
wenzelm@48638
    25
Unsynchronized.setmp Multithreading.max_threads 1
wenzelm@48638
    26
  use_thy "Pure";
wenzelm@48638
    27
Context.set_thread_data NONE;
wenzelm@37954
    28
wenzelm@48638
    29
structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
wenzelm@23828
    30
wenzelm@24053
    31
wenzelm@24053
    32
(* ML toplevel pretty printing *)
wenzelm@24053
    33
wenzelm@37529
    34
toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
wenzelm@30625
    35
toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
wenzelm@30625
    36
toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
wenzelm@30625
    37
toplevel_pp ["Position", "T"] "Pretty.position";
wenzelm@42381
    38
toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
wenzelm@33389
    39
toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
wenzelm@33389
    40
toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
wenzelm@33389
    41
toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
wenzelm@33389
    42
toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
wenzelm@30625
    43
toplevel_pp ["Context", "theory"] "Context.pretty_thy";
wenzelm@30625
    44
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
wenzelm@33389
    45
toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
wenzelm@42261
    46
toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
wenzelm@43593
    47
toplevel_pp ["Path", "T"] "Path.pretty";
wenzelm@41954
    48
toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
wenzelm@37858
    49
toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
wenzelm@37858
    50
toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
wenzelm@24053
    51
wenzelm@47980
    52
if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
wenzelm@33917
    53
wenzelm@24053
    54
wenzelm@24053
    55
(* misc *)
wenzelm@24053
    56
wenzelm@23828
    57
val cd = File.cd o Path.explode;
wenzelm@23828
    58
wenzelm@25223
    59
Proofterm.proofs := 0;
wenzelm@42360
    60