author | wenzelm |
Fri, 06 Mar 2009 22:32:27 +0100 | |
changeset 30318 | 3d03190d2864 |
parent 30218 | cdd82ba2b4fd |
child 30408 | d1fe8cea5db9 |
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 |
|
29123 | 30 |
install_pp (make_pp ["Task_Queue", "task"] (Pretty.pprint o Pretty.str o Task_Queue.str_of_task)); |
31 |
install_pp (make_pp ["Task_Queue", "group"] (Pretty.pprint o Pretty.str o Task_Queue.str_of_group)); |
|
27776 | 32 |
install_pp (make_pp ["Position", "T"] (Pretty.pprint o Pretty.enum "," "{" "}" o |
33 |
map (fn (x, y) => Pretty.str (x ^ "=" ^ y)) o Position.properties_of)); |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
34 |
install_pp (make_pp ["Thm", "thm"] ProofDisplay.pprint_thm); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
35 |
install_pp (make_pp ["Thm", "cterm"] ProofDisplay.pprint_cterm); |
30218 | 36 |
install_pp (make_pp ["Binding", "binding"] (Pretty.pprint o Pretty.str o Binding.str_of)); |
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
37 |
install_pp (make_pp ["Thm", "ctyp"] ProofDisplay.pprint_ctyp); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
38 |
install_pp (make_pp ["Context", "theory"] Context.pprint_thy); |
27341 | 39 |
install_pp (make_pp ["Context", "theory_ref"] Context.pprint_thy_ref); |
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
40 |
install_pp (make_pp ["Context", "proof"] ProofDisplay.pprint_context); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
41 |
install_pp (make_pp ["Syntax", "ast"] Syntax.pprint_ast); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
42 |
install_pp (make_pp ["typ"] (ProofDisplay.pprint_typ Pure.thy)); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
43 |
install_pp (make_pp ["Path", "T"] (Pretty.pprint o Pretty.str o quote o Path.implode)); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
44 |
install_pp (make_pp ["File", "ident"] (Pretty.pprint o Pretty.str o quote o File.rep_ident)); |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
45 |
|
28557
6a661aeff564
extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
28414
diff
changeset
|
46 |
if String.isPrefix "polyml" ml_system then use "ML-Systems/install_pp_polyml.ML" |
6a661aeff564
extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
28414
diff
changeset
|
47 |
else (); |
6a661aeff564
extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
28414
diff
changeset
|
48 |
|
24053
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
49 |
|
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
50 |
(* misc *) |
af1dd276fae0
added ML toplevel use commands: Toplevel.program;
wenzelm
parents:
23828
diff
changeset
|
51 |
|
23828 | 52 |
val cd = File.cd o Path.explode; |
53 |
ml_prompts "ML> " "ML# "; |
|
54 |
||
25223 | 55 |
Proofterm.proofs := 0; |