author | blanchet |
Tue, 27 Jul 2010 17:58:30 +0200 | |
changeset 38022 | d9c4d87838f3 |
parent 37954 | a2e73df0b1e0 |
child 38327 | d6afb77b0f6d |
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 |
|
37860
aa3b3d00698b
SML/NJ: refrain from modifying toplevel pp for type string -- unclear if it could work here;
wenzelm
parents:
37858
diff
changeset
|
21 |
if String.isPrefix "smlnj" ml_system then () |
aa3b3d00698b
SML/NJ: refrain from modifying toplevel pp for type string -- unclear if it could work here;
wenzelm
parents:
37858
diff
changeset
|
22 |
else toplevel_pp ["String", "string"] "ML_Syntax.pretty_string"; |
aa3b3d00698b
SML/NJ: refrain from modifying toplevel pp for type string -- unclear if it could work here;
wenzelm
parents:
37858
diff
changeset
|
23 |
|
37529 | 24 |
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
|
25 |
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
|
26 |
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
|
27 |
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
|
28 |
toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of"; |
33389 | 29 |
toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm"; |
30 |
toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm"; |
|
31 |
toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp"; |
|
32 |
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
|
33 |
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
|
34 |
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref"; |
33389 | 35 |
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
|
36 |
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
|
37 |
toplevel_pp ["Path", "T"] "Pretty.str o quote o Path.implode"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
38 |
toplevel_pp ["File", "ident"] "Pretty.str o quote o File.rep_ident"; |
37858 | 39 |
toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")"; |
40 |
toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract"; |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
41 |
|
33538
edf497b5b5d2
setup for official Poly/ML 5.3.0, which is now the default;
wenzelm
parents:
33389
diff
changeset
|
42 |
if ml_system = "polyml-5.3.0" |
31433 | 43 |
then use "ML-Systems/install_pp_polyml-5.3.ML" |
30625
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
44 |
else if String.isPrefix "polyml" ml_system |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
45 |
then use "ML-Systems/install_pp_polyml.ML" |
28557
6a661aeff564
extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
28414
diff
changeset
|
46 |
else (); |
6a661aeff564
extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
28414
diff
changeset
|
47 |
|
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
|
48 |
if ml_system = "polyml-5.0" orelse ml_system = "polyml-5.1" then |
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
|
49 |
Secure.use_text ML_Parse.global_context (0, "") false |
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
|
50 |
"PolyML.Compiler.maxInlineSize := 20" |
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
|
51 |
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
|
52 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
53 |
|
31646 | 54 |
(* ML toplevel use commands *) |
55 |
||
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
|
56 |
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
|
57 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
58 |
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
|
59 |
fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name); |
31646 | 60 |
|
61 |
||
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
62 |
(* misc *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
63 |
|
23828 | 64 |
val cd = File.cd o Path.explode; |
65 |
||
25223 | 66 |
Proofterm.proofs := 0; |