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;
     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 () => Thy_Load.use_ml (Path.explode name));
    10 
    11 fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name);
    12 fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name);
    13 
    14 
    15 (* the Pure theory *)
    16 
    17 val _ =
    18   Outer_Syntax.command
    19     (("theory", Keyword.tag_theory Keyword.thy_begin), Position.none) "begin theory context"
    20     (Thy_Header.args >> (fn header =>
    21       Toplevel.print o
    22         Toplevel.init_theory
    23           (fn () => Thy_Info.toplevel_begin_theory (Thy_Load.get_master_path ()) header)));
    24 
    25 Unsynchronized.setmp Multithreading.max_threads 1
    26   use_thy "Pure";
    27 Context.set_thread_data NONE;
    28 
    29 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
    30 
    31 
    32 (* ML toplevel pretty printing *)
    33 
    34 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
    35 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
    36 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
    37 toplevel_pp ["Position", "T"] "Pretty.position";
    38 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
    39 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
    40 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
    41 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
    42 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
    43 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
    44 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
    45 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
    46 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
    47 toplevel_pp ["Path", "T"] "Path.pretty";
    48 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
    49 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
    50 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
    51 
    52 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
    53 
    54 
    55 (* misc *)
    56 
    57 val cd = File.cd o Path.explode;
    58 
    59 Proofterm.proofs := 0;
    60