src/Pure/pure_setup.ML
author wenzelm
Wed Aug 01 23:33:26 2012 +0200 (2012-08-01)
changeset 48641 92b48b8abfe4
parent 48638 22d65e375c01
child 48646 91281e9472d8
permissions -rw-r--r--
more standard bootstrapping of Pure outer syntax;
     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 ("theory", Keyword.tag_theory Keyword.thy_begin) "begin theory context"
    19     (Thy_Header.args >> (fn header =>
    20       Toplevel.print o
    21         Toplevel.init_theory
    22           (fn () => Thy_Info.toplevel_begin_theory (Thy_Load.get_master_path ()) header)));
    23 
    24 Unsynchronized.setmp Multithreading.max_threads 1
    25   use_thy "Pure";
    26 Context.set_thread_data NONE;
    27 
    28 structure Pure = struct val thy = Thy_Info.get_theory "Pure" end;
    29 
    30 
    31 (* ML toplevel pretty printing *)
    32 
    33 toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")";
    34 toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task";
    35 toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group";
    36 toplevel_pp ["Position", "T"] "Pretty.position";
    37 toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print";
    38 toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm";
    39 toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm";
    40 toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp";
    41 toplevel_pp ["typ"] "Proof_Display.pp_typ Pure.thy";
    42 toplevel_pp ["Context", "theory"] "Context.pretty_thy";
    43 toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref";
    44 toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context";
    45 toplevel_pp ["Ast", "ast"] "Ast.pretty_ast";
    46 toplevel_pp ["Path", "T"] "Path.pretty";
    47 toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep";
    48 toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")";
    49 toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract";
    50 
    51 if ML_System.is_polyml then use "ML/install_pp_polyml.ML" else ();
    52 
    53 
    54 (* misc *)
    55 
    56 val cd = File.cd o Path.explode;
    57 
    58 Proofterm.proofs := 0;
    59