author | berghofe |
Fri, 03 Apr 2009 10:09:06 +0200 | |
changeset 30861 | 294e8ee163ea |
parent 30625 | d53d1a16d5ee |
child 31433 | 12f5f6af3d2d |
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 |
||
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
7 |
(* ML toplevel use commands *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
8 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
9 |
fun use name = Toplevel.program (fn () => ThyInfo.use name); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
10 |
fun use_thys name = Toplevel.program (fn () => ThyInfo.use_thys name); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
11 |
fun use_thy name = Toplevel.program (fn () => ThyInfo.use_thy name); |
24174
59a5ffec7078
theory loader: removed obsolete update_thy (coincides with use_thy);
wenzelm
parents:
24053
diff
changeset
|
12 |
fun time_use name = Toplevel.program (fn () => ThyInfo.time_use name); |
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
13 |
fun time_use_thy name = Toplevel.program (fn () => ThyInfo.time_use_thy name); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
14 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
15 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
16 |
(* the Pure theories *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
17 |
|
26608 | 18 |
val theory = ThyInfo.get_theory; |
19 |
||
26463 | 20 |
Context.>> (Context.map_theory |
21 |
(OuterSyntax.process_file (Path.explode "Pure.thy") #> |
|
22 |
Theory.end_theory)); |
|
26427 | 23 |
structure Pure = struct val thy = ML_Context.the_global_context () end; |
24 |
Context.set_thread_data NONE; |
|
25 |
ThyInfo.register_theory Pure.thy; |
|
23828 | 26 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
27 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
28 |
(* ML toplevel pretty printing *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
29 |
|
30625
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
30 |
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
|
31 |
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
|
32 |
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
|
33 |
toplevel_pp ["Binding", "binding"] "Pretty.str o quote o Binding.str_of"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
34 |
toplevel_pp ["Thm", "thm"] "ProofDisplay.pp_thm"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
35 |
toplevel_pp ["Thm", "cterm"] "ProofDisplay.pp_cterm"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
36 |
toplevel_pp ["Thm", "ctyp"] "ProofDisplay.pp_ctyp"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
37 |
toplevel_pp ["typ"] "ProofDisplay.pp_typ Pure.thy"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
38 |
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
|
39 |
toplevel_pp ["Context", "theory_ref"] "Context.pretty_thy o Theory.deref"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
40 |
toplevel_pp ["Context", "proof"] "ProofDisplay.pp_context"; |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
41 |
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
|
42 |
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
|
43 |
toplevel_pp ["File", "ident"] "Pretty.str o quote o File.rep_ident"; |
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
44 |
|
30625
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
45 |
if File.exists (Path.explode ("ML-Systems/install_pp_" ^ ml_system ^ ".ML")) |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
46 |
then use ("ML-Systems/install_pp_" ^ ml_system ^ ".ML") |
d53d1a16d5ee
replaced install_pp/make_pp by more general toplevel_pp based on use_text;
wenzelm
parents:
30621
diff
changeset
|
47 |
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
|
48 |
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
|
49 |
else (); |
6a661aeff564
extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
28414
diff
changeset
|
50 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
51 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
52 |
(* misc *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
53 |
|
23828 | 54 |
val cd = File.cd o Path.explode; |
55 |
||
25223 | 56 |
Proofterm.proofs := 0; |