author | wenzelm |
Sun, 04 Sep 2011 15:21:50 +0200 | |
changeset 44698 | 0385292321a0 |
parent 43948 | 8f5add916a99 |
child 45128 | 5af3a3203a76 |
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 |
|
37529 | 21 |
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
|
22 |
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
|
23 |
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
|
24 |
toplevel_pp ["Position", "T"] "Pretty.position"; |
42381
309ec68442c6
added Binding.print convenience, which includes quote already;
wenzelm
parents:
42360
diff
changeset
|
25 |
toplevel_pp ["Binding", "binding"] "Pretty.str o Binding.print"; |
33389 | 26 |
toplevel_pp ["Thm", "thm"] "Proof_Display.pp_thm"; |
27 |
toplevel_pp ["Thm", "cterm"] "Proof_Display.pp_cterm"; |
|
28 |
toplevel_pp ["Thm", "ctyp"] "Proof_Display.pp_ctyp"; |
|
29 |
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
|
30 |
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
|
31 |
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref"; |
33389 | 32 |
toplevel_pp ["Context", "Proof", "context"] "Proof_Display.pp_context"; |
42261 | 33 |
toplevel_pp ["Ast", "ast"] "Ast.pretty_ast"; |
43593 | 34 |
toplevel_pp ["Path", "T"] "Path.pretty"; |
41954 | 35 |
toplevel_pp ["SHA1", "digest"] "Pretty.str o quote o SHA1.rep"; |
37858 | 36 |
toplevel_pp ["Proof", "state"] "(fn _: Proof.state => Pretty.str \"<Proof.state>\")"; |
37 |
toplevel_pp ["Toplevel", "state"] "Toplevel.pretty_abstract"; |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
38 |
|
43948 | 39 |
if ML_System.name = "polyml-5.2.1" |
38327 | 40 |
then use "ML/install_pp_polyml.ML" |
43948 | 41 |
else if ML_System.is_polyml |
38470
484e483eb606
discontinued support for Poly/ML 5.0 and 5.1 versions;
wenzelm
parents:
38327
diff
changeset
|
42 |
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
|
43 |
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
|
44 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
45 |
|
31646 | 46 |
(* ML toplevel use commands *) |
47 |
||
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
|
48 |
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
|
49 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
50 |
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
|
51 |
fun use_thy name = Toplevel.program (fn () => Thy_Info.use_thy name); |
31646 | 52 |
|
53 |
||
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
54 |
(* misc *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
55 |
|
23828 | 56 |
val cd = File.cd o Path.explode; |
57 |
||
25223 | 58 |
Proofterm.proofs := 0; |
42360 | 59 |
|
60 |
(*legacy*) |
|
61 |
structure ProofContext = Proof_Context; |
|
62 |