author | wenzelm |
Mon, 26 Aug 2013 21:56:08 +0200 | |
changeset 53212 | 387b9f7cb0ac |
parent 52852 | 08ecbffaf25c |
child 53403 | c09f4005d6bd |
permissions | -rw-r--r-- |
52009 | 1 |
(* Title: Pure/Tools/proof_general.ML |
52006 | 2 |
Author: David Aspinall |
3 |
Author: Makarius |
|
21642 | 4 |
|
52006 | 5 |
Isabelle/Isar configuration for Proof General / Emacs. |
26549 | 6 |
See also http://proofgeneral.inf.ed.ac.uk |
21642 | 7 |
*) |
8 |
||
9 |
signature PROOF_GENERAL = |
|
10 |
sig |
|
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
11 |
type category = string |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
12 |
val category_display: category |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
13 |
val category_advanced_display: category |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
14 |
val category_tracing: category |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
15 |
val category_proof: category |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
16 |
type pgiptype = string |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
17 |
val pgipbool: pgiptype |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
18 |
val pgipint: pgiptype |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
19 |
val pgipfloat: pgiptype |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
20 |
val pgipstring: pgiptype |
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
21 |
val preference: category -> string option -> |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
22 |
(unit -> string) -> (string -> unit) -> string -> string -> string -> unit |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
23 |
val preference_bool: category -> string option -> |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
24 |
bool Unsynchronized.ref -> string -> string -> unit |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
25 |
val preference_int: category -> string option -> |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
26 |
int Unsynchronized.ref -> string -> string -> unit |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
27 |
val preference_real: category -> string option -> |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
28 |
real Unsynchronized.ref -> string -> string -> unit |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
29 |
val preference_string: category -> string option -> |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
30 |
string Unsynchronized.ref -> string -> string -> unit |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
31 |
val preference_option: category -> string option -> string -> string -> string -> unit |
52437
c88354589b43
more formal ProofGeneral command setup within theory Pure;
wenzelm
parents:
52017
diff
changeset
|
32 |
val process_pgip: string -> unit |
c88354589b43
more formal ProofGeneral command setup within theory Pure;
wenzelm
parents:
52017
diff
changeset
|
33 |
val tell_clear_goals: unit -> unit |
c88354589b43
more formal ProofGeneral command setup within theory Pure;
wenzelm
parents:
52017
diff
changeset
|
34 |
val tell_clear_response: unit -> unit |
c88354589b43
more formal ProofGeneral command setup within theory Pure;
wenzelm
parents:
52017
diff
changeset
|
35 |
val inform_file_processed: string -> unit |
c88354589b43
more formal ProofGeneral command setup within theory Pure;
wenzelm
parents:
52017
diff
changeset
|
36 |
val inform_file_retracted: string -> unit |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
37 |
structure ThyLoad: sig val add_path: string -> unit end |
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
38 |
val thm_deps: bool Unsynchronized.ref |
52013 | 39 |
val proof_generalN: string |
51938 | 40 |
val init: unit -> unit |
52437
c88354589b43
more formal ProofGeneral command setup within theory Pure;
wenzelm
parents:
52017
diff
changeset
|
41 |
val restart: unit -> unit |
21642 | 42 |
end; |
43 |
||
44 |
structure ProofGeneral: PROOF_GENERAL = |
|
45 |
struct |
|
46 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
47 |
(** preferences **) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
48 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
49 |
(* type preference *) |
52006 | 50 |
|
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
51 |
type category = string; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
52 |
val category_display = "Display"; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
53 |
val category_advanced_display = "Advanced Display"; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
54 |
val category_tracing = "Tracing"; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
55 |
val category_proof = "Proof"; |
52006 | 56 |
|
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
57 |
type pgiptype = string; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
58 |
val pgipbool = "pgipbool"; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
59 |
val pgipint = "pgipint"; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
60 |
val pgipfloat = "pgipint"; (*NB: PG 3.7.x and 4.0 lack pgipfloat, but accept floats as pgipint*) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
61 |
val pgipstring = "pgipstring"; |
52006 | 62 |
|
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
63 |
type preference = |
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
64 |
{category: string, |
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
65 |
override: string option, |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
66 |
descr: string, |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
67 |
pgiptype: pgiptype, |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
68 |
get: unit -> string, |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
69 |
set: string -> unit}; |
52006 | 70 |
|
71 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
72 |
(* global preferences *) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
73 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
74 |
local |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
75 |
val preferences = |
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
76 |
Synchronized.var "ProofGeneral.preferences" ([]: (string * preference) list); |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
77 |
in |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
78 |
|
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
79 |
fun add_preference name pref = |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
80 |
Synchronized.change preferences (fn prefs => |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
81 |
(if not (AList.defined (op =) prefs name) then () |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
82 |
else warning ("Redefining ProofGeneral preference: " ^ quote name); |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
83 |
AList.update (op =) (name, pref) prefs)); |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
84 |
|
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
85 |
fun set_preference name value = |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
86 |
(case AList.lookup (op =) (Synchronized.value preferences) name of |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
87 |
SOME {set, ...} => set value |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
88 |
| NONE => error ("Unknown ProofGeneral preference: " ^ quote name)); |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
89 |
|
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
90 |
fun all_preferences () = |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
91 |
rev (Synchronized.value preferences) |
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
92 |
|> map (fn (name, {category, descr, pgiptype, get, ...}) => |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
93 |
(category, {name = name, descr = descr, default = get (), pgiptype = pgiptype})) |
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
94 |
|> AList.group (op =); |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
95 |
|
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
96 |
fun init_preferences () = |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
97 |
Synchronized.value preferences |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
98 |
|> List.app (fn (_, {set, override = SOME value, ...}) => set value | _ => ()); |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
99 |
|
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
100 |
end; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
101 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
102 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
103 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
104 |
(* raw preferences *) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
105 |
|
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
106 |
fun preference category override get set typ name descr = |
52016
4b77f444afbb
simplified ProofGeneral.preference operation -- no need for CRITICAL section for atomic access (and sequential execution of PG/TTY loop);
wenzelm
parents:
52015
diff
changeset
|
107 |
add_preference name |
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
108 |
{category = category, override = override, descr = descr, pgiptype = typ, get = get, set = set}; |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
109 |
|
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
110 |
fun preference_ref category override read write typ r = |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
111 |
preference category override (fn () => read (! r)) (fn x => r := write x) typ; |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
112 |
|
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
113 |
fun preference_bool x y = preference_ref x y Markup.print_bool Markup.parse_bool pgipbool; |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
114 |
fun preference_int x y = preference_ref x y Markup.print_int Markup.parse_int pgipint; |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
115 |
fun preference_real x y = preference_ref x y Markup.print_real Markup.parse_real pgipfloat; |
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
116 |
fun preference_string x y = preference_ref x y I I pgipstring; |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
117 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
118 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
119 |
(* system options *) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
120 |
|
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
121 |
fun preference_option category override option_name pgip_name descr = |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
122 |
let |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
123 |
val typ = Options.default_typ option_name; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
124 |
val pgiptype = |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
125 |
if typ = Options.boolT then pgipbool |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
126 |
else if typ = Options.intT then pgipint |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
127 |
else if typ = Options.realT then pgipfloat |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
128 |
else pgipstring; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
129 |
in |
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
130 |
add_preference pgip_name |
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
131 |
{category = category, |
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
132 |
override = override, |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
133 |
descr = descr, |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
134 |
pgiptype = pgiptype, |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
135 |
get = fn () => Options.get_default option_name, |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
136 |
set = Options.put_default option_name} |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
137 |
end; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
138 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
139 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
140 |
(* minimal PGIP support for <askprefs>, <haspref>, <setpref> *) |
52006 | 141 |
|
142 |
local |
|
143 |
||
144 |
fun get_attr attrs name = |
|
145 |
(case Properties.get attrs name of |
|
146 |
SOME value => value |
|
147 |
| NONE => raise Fail ("Missing attribute: " ^ quote name)); |
|
148 |
||
149 |
fun attr x y = [(x, y)] : XML.attributes; |
|
150 |
||
151 |
fun opt_attr _ NONE = [] |
|
152 |
| opt_attr name (SOME value) = attr name value; |
|
153 |
||
154 |
val pgip_id = "dummy"; |
|
52537 | 155 |
val pgip_serial = Counter.make (); |
52006 | 156 |
|
157 |
fun output_pgip refid refseq content = |
|
158 |
XML.Elem (("pgip", |
|
159 |
attr "tag" "Isabelle/Isar" @ |
|
160 |
attr "id" pgip_id @ |
|
161 |
opt_attr "destid" refid @ |
|
162 |
attr "class" "pg" @ |
|
163 |
opt_attr "refid" refid @ |
|
164 |
attr "refseq" refseq @ |
|
165 |
attr "seq" (string_of_int (pgip_serial ()))), content) |
|
166 |
|> XML.string_of |
|
167 |
|> Output.urgent_message; |
|
168 |
||
169 |
||
170 |
fun invalid_pgip () = raise Fail "Invalid PGIP packet"; |
|
171 |
||
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
172 |
fun haspref {name, descr, default, pgiptype} = |
52006 | 173 |
XML.Elem (("haspref", [("name", name), ("descr", descr), ("default", default)]), |
174 |
[XML.Elem ((pgiptype, []), [])]); |
|
175 |
||
176 |
fun process_element refid refseq (XML.Elem (("askprefs", _), _)) = |
|
52014
45929e0e1d73
more standard Isabelle/ML structures for global preferences;
wenzelm
parents:
52013
diff
changeset
|
177 |
all_preferences () |> List.app (fn (category, prefs) => |
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
178 |
output_pgip refid refseq |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
179 |
[XML.Elem (("hasprefs", [("prefcategory", category)]), map haspref prefs)]) |
52006 | 180 |
| process_element _ _ (XML.Elem (("setpref", attrs), data)) = |
181 |
let |
|
182 |
val name = |
|
183 |
(case Properties.get attrs "name" of |
|
184 |
SOME name => name |
|
185 |
| NONE => invalid_pgip ()); |
|
186 |
val value = XML.content_of data; |
|
187 |
in set_preference name value end |
|
188 |
| process_element _ _ _ = invalid_pgip (); |
|
189 |
||
190 |
in |
|
191 |
||
192 |
fun process_pgip str = |
|
193 |
(case XML.parse str of |
|
194 |
XML.Elem (("pgip", attrs), pgips) => |
|
195 |
let |
|
196 |
val class = get_attr attrs "class"; |
|
197 |
val dest = Properties.get attrs "destid"; |
|
198 |
val refid = Properties.get attrs "id"; |
|
199 |
val refseq = get_attr attrs "seq"; |
|
200 |
val processit = |
|
201 |
(case dest of |
|
202 |
NONE => class = "pa" |
|
203 |
| SOME id => id = pgip_id); |
|
204 |
in if processit then List.app (process_element refid refseq) pgips else () end |
|
205 |
| _ => invalid_pgip ()) |
|
206 |
handle Fail msg => raise Fail (msg ^ "\n" ^ str); |
|
207 |
||
208 |
end; |
|
209 |
||
210 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
211 |
(** messages **) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
212 |
|
51939 | 213 |
(* render markup *) |
26549 | 214 |
|
43777 | 215 |
fun special ch = chr 1 ^ ch; |
21642 | 216 |
|
217 |
local |
|
218 |
||
29326 | 219 |
fun render_trees ts = fold render_tree ts |
49658 | 220 |
and render_tree t = |
221 |
(case XML.unwrap_elem t of |
|
222 |
SOME (_, ts) => render_trees ts |
|
223 |
| NONE => |
|
224 |
(case t of |
|
225 |
XML.Text s => Buffer.add s |
|
226 |
| XML.Elem ((name, props), ts) => |
|
227 |
let |
|
51939 | 228 |
val (bg, en) = |
49658 | 229 |
if null ts then Markup.no_output |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
230 |
else if name = Markup.stateN then (special "O" ^ "\n", "\n" ^ special "P") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
231 |
else if name = Markup.sendbackN then (special "W", special "X") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
232 |
else if name = Markup.intensifyN then (special "0", special "1") |
52643
34c29356930e
more explicit Markup.information for messages produced by "auto" tools;
wenzelm
parents:
52537
diff
changeset
|
233 |
else if name = Markup.informationN then ("\n" ^ special "0", special "1") |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
234 |
else if name = Markup.tfreeN then (special "C", special "A") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
235 |
else if name = Markup.tvarN then (special "D", special "A") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
236 |
else if name = Markup.freeN then (special "E", special "A") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
237 |
else if name = Markup.boundN then (special "F", special "A") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
238 |
else if name = Markup.varN then (special "G", special "A") |
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
239 |
else if name = Markup.skolemN then (special "H", special "A") |
49658 | 240 |
else |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
241 |
(case Markup.get_entity_kind (name, props) of |
49658 | 242 |
SOME kind => |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
50163
diff
changeset
|
243 |
if kind = Markup.classN then (special "B", special "A") |
49658 | 244 |
else Markup.no_output |
245 |
| NONE => Markup.no_output); |
|
51939 | 246 |
in Buffer.add bg #> render_trees ts #> Buffer.add en end)); |
21642 | 247 |
|
248 |
in |
|
249 |
||
29326 | 250 |
fun render text = |
251 |
Buffer.content (render_trees (YXML.parse_body text) Buffer.empty); |
|
21642 | 252 |
|
253 |
end; |
|
254 |
||
255 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
256 |
(* hooks *) |
29326 | 257 |
|
258 |
fun message bg en prfx text = |
|
259 |
(case render text of |
|
260 |
"" => () |
|
44389
a3b5fdfb04a3
tuned signature -- contrast physical output primitives versus Output.raw_message;
wenzelm
parents:
44270
diff
changeset
|
261 |
| s => Output.physical_writeln (enclose bg en (prefix_lines prfx s))); |
23641
d6f9d3acffaa
toplevel prompt/print_state: proper markup, removed hooks;
wenzelm
parents:
23621
diff
changeset
|
262 |
|
29326 | 263 |
fun setup_messages () = |
52852 | 264 |
(Output.Internal.writeln_fn := message "" "" ""; |
265 |
Output.Internal.status_fn := (fn _ => ()); |
|
266 |
Output.Internal.report_fn := (fn _ => ()); |
|
267 |
Output.Internal.urgent_message_fn := message (special "I") (special "J") ""; |
|
268 |
Output.Internal.tracing_fn := message (special "I" ^ special "V") (special "J") ""; |
|
269 |
Output.Internal.warning_fn := message (special "K") (special "L") "### "; |
|
270 |
Output.Internal.error_fn := (fn (_, s) => message (special "M") (special "N") "*** " s); |
|
271 |
Output.Internal.prompt_fn := (fn s => Output.physical_stdout (render s ^ special "S"))); |
|
29326 | 272 |
|
23641
d6f9d3acffaa
toplevel prompt/print_state: proper markup, removed hooks;
wenzelm
parents:
23621
diff
changeset
|
273 |
|
29326 | 274 |
(* notification *) |
21642 | 275 |
|
29326 | 276 |
val emacs_notify = message (special "I") (special "J") ""; |
21642 | 277 |
|
278 |
fun tell_clear_goals () = |
|
21940 | 279 |
emacs_notify "Proof General, please clear the goals buffer."; |
21642 | 280 |
|
281 |
fun tell_clear_response () = |
|
21940 | 282 |
emacs_notify "Proof General, please clear the response buffer."; |
21642 | 283 |
|
284 |
fun tell_file_loaded path = |
|
21940 | 285 |
emacs_notify ("Proof General, this file is loaded: " ^ quote (File.platform_path path)); |
21642 | 286 |
|
287 |
fun tell_file_retracted path = |
|
21940 | 288 |
emacs_notify ("Proof General, you can unlock the file " ^ quote (File.platform_path path)); |
21642 | 289 |
|
290 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
291 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
292 |
(** theory loader **) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
293 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
294 |
(* fake old ThyLoad -- with new semantics *) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
295 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
296 |
structure ThyLoad = |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
297 |
struct |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
298 |
val add_path = Thy_Load.set_master_path o Path.explode; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
299 |
end; |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
300 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
301 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
302 |
(* actions *) |
21642 | 303 |
|
304 |
local |
|
305 |
||
306 |
fun trace_action action name = |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
307 |
if action = Thy_Info.Update then |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
308 |
List.app tell_file_loaded (Thy_Info.loaded_files name) |
37981
9a15982f41fe
theory loader: removed obsolete touch/outdate operations (require_thy no longer changes the database implicitly);
wenzelm
parents:
37977
diff
changeset
|
309 |
else if action = Thy_Info.Remove then |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
310 |
List.app tell_file_retracted (Thy_Info.loaded_files name) |
21642 | 311 |
else (); |
312 |
||
313 |
in |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
314 |
fun setup_thy_loader () = Thy_Info.add_hook trace_action; |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
36953
diff
changeset
|
315 |
fun sync_thy_loader () = List.app (trace_action Thy_Info.Update) (Thy_Info.get_names ()); |
21642 | 316 |
end; |
317 |
||
318 |
||
21948 | 319 |
(* get informed about files *) |
21642 | 320 |
|
25442 | 321 |
(*liberal low-level version*) |
322 |
val thy_name = perhaps (try (unsuffix ".thy")) o List.last o space_explode "/"; |
|
323 |
||
37977
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37954
diff
changeset
|
324 |
val inform_file_retracted = Thy_Info.kill_thy o thy_name; |
25442 | 325 |
|
27577
7c7a9a343ca5
proper_inform_file_processed: new implementation based on global Isar state (cf. isar.ML);
wenzelm
parents:
27537
diff
changeset
|
326 |
fun inform_file_processed file = |
7c7a9a343ca5
proper_inform_file_processed: new implementation based on global Isar state (cf. isar.ML);
wenzelm
parents:
27537
diff
changeset
|
327 |
let |
7c7a9a343ca5
proper_inform_file_processed: new implementation based on global Isar state (cf. isar.ML);
wenzelm
parents:
27537
diff
changeset
|
328 |
val name = thy_name file; |
7c7a9a343ca5
proper_inform_file_processed: new implementation based on global Isar state (cf. isar.ML);
wenzelm
parents:
27537
diff
changeset
|
329 |
val _ = name = "" andalso error ("Bad file name: " ^ quote file); |
7c7a9a343ca5
proper_inform_file_processed: new implementation based on global Isar state (cf. isar.ML);
wenzelm
parents:
27537
diff
changeset
|
330 |
val _ = |
37977
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37954
diff
changeset
|
331 |
Thy_Info.register_thy (Toplevel.end_theory Position.none (Isar.state ())) |
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37954
diff
changeset
|
332 |
handle ERROR msg => |
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37954
diff
changeset
|
333 |
(warning (cat_lines ["Failed to register theory: " ^ quote name, msg]); |
46737 | 334 |
tell_file_retracted (Thy_Load.thy_path (Path.basic name))) |
29349 | 335 |
val _ = Isar.init (); |
27577
7c7a9a343ca5
proper_inform_file_processed: new implementation based on global Isar state (cf. isar.ML);
wenzelm
parents:
27537
diff
changeset
|
336 |
in () end; |
21642 | 337 |
|
338 |
||
339 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
340 |
(** theorem dependencies **) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
341 |
|
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
342 |
(* thm_deps *) |
51970 | 343 |
|
344 |
local |
|
345 |
||
346 |
fun add_proof_body (PBody {thms, ...}) = |
|
347 |
thms |> fold (fn (_, (name, _, _)) => name <> "" ? Symtab.update (name, ())); |
|
21642 | 348 |
|
51970 | 349 |
fun add_thm th = |
350 |
(case Thm.proof_body_of th of |
|
351 |
PBody {proof = PThm (_, ((name, _, _), body)), ...} => |
|
352 |
if Thm.has_name_hint th andalso Thm.get_name_hint th = name |
|
353 |
then add_proof_body (Future.join body) |
|
354 |
else I |
|
355 |
| body => add_proof_body body); |
|
356 |
||
357 |
in |
|
358 |
||
52011 | 359 |
fun get_thm_deps ths = |
51970 | 360 |
let |
361 |
(* FIXME proper derivation names!? *) |
|
362 |
val names = map Thm.get_name_hint (filter Thm.has_name_hint ths); |
|
363 |
val deps = Symtab.keys (fold add_thm ths Symtab.empty); |
|
364 |
in (names, deps) end; |
|
365 |
||
366 |
end; |
|
367 |
||
368 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
369 |
(* report via hook *) |
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
370 |
|
52011 | 371 |
val thm_deps = Unsynchronized.ref false; |
51939 | 372 |
|
21642 | 373 |
local |
374 |
||
375 |
val spaces_quote = space_implode " " o map quote; |
|
376 |
||
377 |
fun thm_deps_message (thms, deps) = |
|
21948 | 378 |
emacs_notify ("Proof General, theorem dependencies of " ^ thms ^ " are " ^ deps); |
21642 | 379 |
|
28096
046418f64474
theorem dependency output: Toplevel.add_hook, ProofGeneralPgip.new_thms_deps;
wenzelm
parents:
28020
diff
changeset
|
380 |
in |
046418f64474
theorem dependency output: Toplevel.add_hook, ProofGeneralPgip.new_thms_deps;
wenzelm
parents:
28020
diff
changeset
|
381 |
|
28103
b79e61861f0f
simplified Toplevel.add_hook: cover successful transactions only;
wenzelm
parents:
28100
diff
changeset
|
382 |
fun setup_present_hook () = Toplevel.add_hook (fn _ => fn state => fn state' => |
52011 | 383 |
if ! thm_deps andalso can Toplevel.theory_of state andalso Toplevel.is_theory state' |
28106 | 384 |
then |
51970 | 385 |
let |
386 |
val prev_facts = Global_Theory.facts_of (Toplevel.theory_of state); |
|
387 |
val facts = Global_Theory.facts_of (Toplevel.theory_of state'); |
|
52011 | 388 |
val (names, deps) = get_thm_deps (maps #2 (Facts.dest_static [prev_facts] facts)); |
28100
7650d5e0f8fb
refined theorem dependency output: previous state needs to contain a theory (not empty toplevel);
wenzelm
parents:
28096
diff
changeset
|
389 |
in |
21968 | 390 |
if null names orelse null deps then () |
391 |
else thm_deps_message (spaces_quote names, spaces_quote deps) |
|
392 |
end |
|
28096
046418f64474
theorem dependency output: Toplevel.add_hook, ProofGeneralPgip.new_thms_deps;
wenzelm
parents:
28020
diff
changeset
|
393 |
else ()); |
21642 | 394 |
|
395 |
end; |
|
396 |
||
397 |
||
52007
0b1183012a3c
maintain ProofGeneral preferences within ProofGeneral module;
wenzelm
parents:
52006
diff
changeset
|
398 |
|
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
399 |
(** startup **) |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
400 |
|
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
401 |
(* init *) |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
402 |
|
52013 | 403 |
val proof_generalN = "ProofGeneral"; |
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
404 |
|
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
405 |
val initialized = Unsynchronized.ref false; |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
406 |
|
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
407 |
fun init () = |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
408 |
(if ! initialized then () |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
409 |
else |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
410 |
(Output.add_mode Symbol.xsymbolsN Symbol.output Output.default_escape; |
52013 | 411 |
Output.add_mode proof_generalN Output.default_output Output.default_escape; |
412 |
Markup.add_mode proof_generalN YXML.output_markup; |
|
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
413 |
setup_messages (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
414 |
setup_thy_loader (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
415 |
setup_present_hook (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
416 |
initialized := true); |
52017
bc0238c1f73a
clarified preferences: "override" re-initialized on prover startup, and "default" sent to PG -- thus recover typical defaults like auto-quickcheck in PG 4.x;
wenzelm
parents:
52016
diff
changeset
|
417 |
init_preferences (); |
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
418 |
sync_thy_loader (); |
52013 | 419 |
Unsynchronized.change print_mode (update (op =) proof_generalN); |
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
420 |
Secure.PG_setup (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
421 |
Isar.toplevel_loop TextIO.stdIn |
52015
d021c180e7df
back to hidden welcome -- revert change 9ebf2da69b29, which appears to disturb startup protocol of PG 4.1;
wenzelm
parents:
52014
diff
changeset
|
422 |
{init = true, welcome = true, sync = true, secure = Secure.is_secure ()}); |
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
423 |
|
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
424 |
|
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
425 |
(* restart *) |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
426 |
|
52015
d021c180e7df
back to hidden welcome -- revert change 9ebf2da69b29, which appears to disturb startup protocol of PG 4.1;
wenzelm
parents:
52014
diff
changeset
|
427 |
val welcome = Output.urgent_message o Session.welcome; |
d021c180e7df
back to hidden welcome -- revert change 9ebf2da69b29, which appears to disturb startup protocol of PG 4.1;
wenzelm
parents:
52014
diff
changeset
|
428 |
|
52012
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
429 |
fun restart () = |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
430 |
(sync_thy_loader (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
431 |
tell_clear_goals (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
432 |
tell_clear_response (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
433 |
Isar.init (); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
434 |
welcome ()); |
9ebf2da69b29
uniform welcome -- actually visible on startup via Output.urgent_message;
wenzelm
parents:
52011
diff
changeset
|
435 |
|
21642 | 436 |
end; |
37977
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37954
diff
changeset
|
437 |