author | wenzelm |
Sun, 28 Nov 2010 15:28:48 +0100 | |
changeset 40782 | aa533c5e3f48 |
parent 40741 | 17d6293a1e26 |
child 41415 | 23533273220a |
permissions | -rw-r--r-- |
23828 | 1 |
(* Title: Pure/pure_setup.ML |
2 |
Author: Makarius |
|
3 |
||
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
4 |
Pure theory and ML toplevel setup. |
23828 | 5 |
*) |
6 |
||
37954
a2e73df0b1e0
simplified/clarified register_thy: more precise treatment of new dependencies, remove descendants;
wenzelm
parents:
37949
diff
changeset
|
7 |
(* the Pure theory *) |
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
8 |
|
26463 | 9 |
Context.>> (Context.map_theory |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
33917
diff
changeset
|
10 |
(Outer_Syntax.process_file (Path.explode "Pure.thy") #> |
26463 | 11 |
Theory.end_theory)); |
37954
a2e73df0b1e0
simplified/clarified register_thy: more precise treatment of new dependencies, remove descendants;
wenzelm
parents:
37949
diff
changeset
|
12 |
|
26427 | 13 |
structure Pure = struct val thy = ML_Context.the_global_context () end; |
37954
a2e73df0b1e0
simplified/clarified register_thy: more precise treatment of new dependencies, remove descendants;
wenzelm
parents:
37949
diff
changeset
|
14 |
|
26427 | 15 |
Context.set_thread_data NONE; |
37954
a2e73df0b1e0
simplified/clarified register_thy: more precise treatment of new dependencies, remove descendants;
wenzelm
parents:
37949
diff
changeset
|
16 |
Thy_Info.register_thy Pure.thy; |
23828 | 17 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
18 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
19 |
(* ML toplevel pretty printing *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
20 |
|
38470
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
21 |
if String.isPrefix "polyml" ml_system |
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
22 |
then toplevel_pp ["String", "string"] "ML_Syntax.pretty_string" |
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
23 |
else (); |
37860
aa3b3d00698b
SML/NJ: refrain from modifying toplevel pp for type string -- unclear if it could work here;
wenzelm
parents:
37858
diff
changeset
|
24 |
|
37529 | 25 |
toplevel_pp ["Pretty", "T"] "(fn _: Pretty.T => Pretty.str \"<pretty>\")"; |
30625
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
26 |
toplevel_pp ["Task_Queue", "task"] "Pretty.str o Task_Queue.str_of_task"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
27 |
toplevel_pp ["Task_Queue", "group"] "Pretty.str o Task_Queue.str_of_group"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
28 |
toplevel_pp ["Position", "T"] "Pretty.position"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
29 |
toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of"; |
33389 | 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"; |
|
30625
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
34 |
toplevel_pp ["Context", "theory"] "Context.pretty_thy"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
35 |
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref"; |
33389 | 36 |
toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context"; |
30625
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
37 |
toplevel_pp ["Syntax", "ast"] "Syntax.pretty_ast"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
38 |
toplevel_pp ["Path", "T"] "Pretty.str o quote o Path.implode"; |
40741
17d6293a1e26
moved file identification to thy_load.ML (where it is actually used);
wenzelm
parents:
38470
diff
changeset
|
39 |
toplevel_pp ["Thy_Load", "file_ident"] "Thy_Load.pretty_file_ident"; |
37858 | 40 |
toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")"; |
41 |
toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract"; |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
42 |
|
38470
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
43 |
if ml_system = "polyml-5.2" orelse ml_system = "polyml-5.2.1" |
38327 | 44 |
then use "ML/install_pp_polyml.ML" |
38470
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
45 |
else if String.isPrefix "polyml" ml_system |
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
46 |
then use "ML/install_pp_polyml-5.3.ML" |
33917
186262d7cabf
workaround for strange compiler crash of Poly/ML 5.0 and 5.1 at this point http://isabelle.in.tum.de/repos/isabelle/file/a2fc533175ff/src/HOL/Tools/Nitpick/nitpick_nut.ML#l997
wenzelm
parents:
33538
diff
changeset
|
47 |
else (); |
186262d7cabf
workaround for strange compiler crash of Poly/ML 5.0 and 5.1 at this point http://isabelle.in.tum.de/repos/isabelle/file/a2fc533175ff/src/HOL/Tools/Nitpick/nitpick_nut.ML#l997
wenzelm
parents:
33538
diff
changeset
|
48 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
49 |
|
31646 | 50 |
(* ML toplevel use commands *) |
51 |
||
37949
48a874444164
moved management of auxiliary theory source files to Thy_Load -- as theory data instead of accidental loader state;
wenzelm
parents:
37873
diff
changeset
|
52 |
fun use name = Toplevel.program (fn () => Thy_Load.use_ml (Path.explode name)); |
48a874444164
moved management of auxiliary theory source files to Thy_Load -- as theory data instead of accidental loader state;
wenzelm
parents:
37873
diff
changeset
|
53 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
54 |
fun use_thys name = Toplevel.program (fn () => Thy_Info.use_thys name); |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
55 |
fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name); |
31646 | 56 |
|
57 |
||
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
58 |
(* misc *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
59 |
|
23828 | 60 |
val cd = File.cd o Path.explode; |
61 |
||
25223 | 62 |
Proofterm.proofs := 0; |