author | wenzelm |
Thu, 22 Oct 1998 20:11:19 +0200 | |
changeset 5730 | 82a7aa74a631 |
parent 5615 | 9ea709aa275c |
permissions | -rw-r--r-- |
391 | 1 |
(* Title: Pure/Thy/thy_read.ML |
2 |
ID: $Id$ |
|
559 | 3 |
Author: Carsten Clasohm and Markus Wenzel and Sonia Mahjoub and |
4 |
Tobias Nipkow and L C Paulson |
|
5 |
Copyright 1994 TU Muenchen |
|
391 | 6 |
|
3602 | 7 |
Functions for reading theory files. |
391 | 8 |
*) |
9 |
||
3619 | 10 |
signature THY_READ = |
391 | 11 |
sig |
12 |
datatype basetype = Thy of string |
|
13 |
| File of string |
|
14 |
||
15 |
val loadpath : string list ref |
|
16 |
val delete_tmpfiles: bool ref |
|
17 |
||
18 |
val use_thy : string -> unit |
|
1348
b9305143fa91
index.html files are now made separatly for each subdirectory
clasohm
parents:
1332
diff
changeset
|
19 |
val time_use_thy : string -> unit |
b9305143fa91
index.html files are now made separatly for each subdirectory
clasohm
parents:
1332
diff
changeset
|
20 |
val use_dir : string -> unit |
b9305143fa91
index.html files are now made separatly for each subdirectory
clasohm
parents:
1332
diff
changeset
|
21 |
val exit_use_dir : string -> unit |
391 | 22 |
val update : unit -> unit |
23 |
val unlink_thy : string -> unit |
|
3876 | 24 |
val mk_base : basetype list -> string -> theory |
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
25 |
|
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
26 |
(* Additions for Proof General by David Aspinall <da@dcs.ed.ac.uk> *) |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
27 |
val use_thy_no_topml : string -> unit |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
28 |
val get_thy_filenames : string -> string -> string * string |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
29 |
val update_verbose : bool ref |
391 | 30 |
end; |
31 |
||
32 |
||
3619 | 33 |
structure ThyRead: THY_READ = |
391 | 34 |
struct |
1242 | 35 |
|
3626 | 36 |
open ThmDatabase ThyInfo BrowserInfo; |
3602 | 37 |
|
391 | 38 |
|
39 |
datatype basetype = Thy of string |
|
40 |
| File of string; |
|
41 |
||
3602 | 42 |
|
1457
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
43 |
(*Default search path for theory files*) |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
44 |
val loadpath = ref ["."]; |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
45 |
|
3602 | 46 |
|
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
47 |
(*Directory given as parameter to use_thy. This is temporarily added to |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
48 |
loadpath while the theory's ancestors are loaded.*) |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
49 |
val tmp_loadpath = ref [] : string list ref; |
1291 | 50 |
|
1457
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
51 |
|
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
52 |
(*Remove temporary files after use*) |
3602 | 53 |
val delete_tmpfiles = ref true; |
54 |
||
391 | 55 |
|
2244
dacee519738a
Converted I/O operatios for Basis Library compatibility
paulson
parents:
2188
diff
changeset
|
56 |
(*Make name of the TextIO.output ML file for a theory *) |
4429 | 57 |
fun out_name tname = File.tmp_name (tname ^ "_thy.ML"); |
391 | 58 |
|
3602 | 59 |
|
3626 | 60 |
(*Read a file specified by thy_file containing theory tname*) |
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
61 |
fun read_thy tname thy_file = |
559 | 62 |
let |
4218 | 63 |
val intext = File.read thy_file; |
3619 | 64 |
val outext = ThySyn.parse tname intext; |
3626 | 65 |
in |
4218 | 66 |
File.write (out_name tname) outext |
3626 | 67 |
end; |
391 | 68 |
|
69 |
||
971
f4815812665b
fixed bug: parent theory wasn't loaded if .thy file was completly read before
clasohm
parents:
922
diff
changeset
|
70 |
(*Check if a theory was completly loaded *) |
391 | 71 |
fun already_loaded thy = |
72 |
let val t = get_thyinfo thy |
|
73 |
in if is_none t then false |
|
3976 | 74 |
else let val {thy_time, ml_time, ...} = the t |
971
f4815812665b
fixed bug: parent theory wasn't loaded if .thy file was completly read before
clasohm
parents:
922
diff
changeset
|
75 |
in is_some thy_time andalso is_some ml_time end |
391 | 76 |
end; |
77 |
||
3602 | 78 |
|
391 | 79 |
(*Check if a theory file has changed since its last use. |
80 |
Return a pair of boolean values for .thy and for .ML *) |
|
559 | 81 |
fun thy_unchanged thy thy_file ml_file = |
1098
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
82 |
case get_thyinfo thy of |
3976 | 83 |
Some {thy_time, ml_time, ...} => |
1098
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
84 |
let val tn = is_none thy_time; |
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
85 |
val mn = is_none ml_time |
391 | 86 |
in if not tn andalso not mn then |
1098
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
87 |
((file_info thy_file = the thy_time), |
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
88 |
(file_info ml_file = the ml_time)) |
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
89 |
else if not tn andalso mn then |
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
90 |
(file_info thy_file = the thy_time, false) |
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
91 |
else |
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
92 |
(false, false) |
391 | 93 |
end |
1098
487089cb173e
fixed bug in thy_unchanged that occurred when the .thy file was changed
clasohm
parents:
971
diff
changeset
|
94 |
| None => (false, false) |
391 | 95 |
|
1242 | 96 |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
97 |
(*Get all descendants of a theory list *) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
98 |
fun get_descendants [] = [] |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
99 |
| get_descendants (t :: ts) = |
1291 | 100 |
let val children = children_of t |
101 |
in children union (get_descendants (children union ts)) end; |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
102 |
|
1291 | 103 |
|
391 | 104 |
(*Find a file using a list of paths if no absolute or relative path is |
105 |
specified.*) |
|
106 |
fun find_file "" name = |
|
1291 | 107 |
let fun find_it (cur :: paths) = |
4218 | 108 |
if File.exists (tack_on cur name) then |
1291 | 109 |
(if cur = "." then name else tack_on cur name) |
559 | 110 |
else |
1291 | 111 |
find_it paths |
391 | 112 |
| find_it [] = "" |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
113 |
in find_it (!tmp_loadpath @ !loadpath) end |
391 | 114 |
| find_file path name = |
4218 | 115 |
if File.exists (tack_on path name) then tack_on path name |
391 | 116 |
else ""; |
117 |
||
3602 | 118 |
|
391 | 119 |
(*Get absolute pathnames for a new or already loaded theory *) |
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
120 |
fun get_filenames1 give_error_if_none_found path name = |
1457
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
121 |
let fun new_filename () = |
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
122 |
let val found = find_file path (name ^ ".thy"); |
2244
dacee519738a
Converted I/O operatios for Basis Library compatibility
paulson
parents:
2188
diff
changeset
|
123 |
val absolute_path = absolute_path (OS.FileSys.getDir ()); |
1457
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
124 |
val thy_file = absolute_path found; |
391 | 125 |
val (thy_path, _) = split_filename thy_file; |
126 |
val found = find_file path (name ^ ".ML"); |
|
1457
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
127 |
val ml_file = if thy_file = "" then absolute_path found |
4218 | 128 |
else if File.exists (tack_on thy_path (name ^ ".ML")) |
391 | 129 |
then tack_on thy_path (name ^ ".ML") |
130 |
else ""; |
|
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
131 |
val searched_dirs = if path = "" then (!tmp_loadpath @ !loadpath) |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
132 |
else [path] |
391 | 133 |
in if thy_file = "" andalso ml_file = "" then |
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
134 |
(if give_error_if_none_found then error else warning) |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
135 |
("Could not find file \"" ^ name ^ ".thy\" or \"" |
391 | 136 |
^ name ^ ".ML\" for theory \"" ^ name ^ "\"\n" |
137 |
^ "in the following directories: \"" ^ |
|
138 |
(space_implode "\", \"" searched_dirs) ^ "\"") |
|
139 |
else (); |
|
559 | 140 |
(thy_file, ml_file) |
391 | 141 |
end; |
142 |
||
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
143 |
val tinfo = get_thyinfo name; |
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
144 |
in if is_some tinfo andalso path = "" then |
3976 | 145 |
let val {path = abs_path, ...} = the tinfo; |
391 | 146 |
val (thy_file, ml_file) = if abs_path = "" then new_filename () |
147 |
else (find_file abs_path (name ^ ".thy"), |
|
148 |
find_file abs_path (name ^ ".ML")) |
|
149 |
in if thy_file = "" andalso ml_file = "" then |
|
1580
e3fd931e6095
Added some functions which allow redirection of Isabelle's output
berghofe
parents:
1554
diff
changeset
|
150 |
(warning ("File \"" ^ (tack_on path name) |
391 | 151 |
^ ".thy\"\ncontaining theory \"" ^ name |
152 |
^ "\" no longer exists."); |
|
153 |
new_filename () |
|
154 |
) |
|
155 |
else (thy_file, ml_file) |
|
156 |
end |
|
157 |
else new_filename () |
|
158 |
end; |
|
159 |
||
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
160 |
val get_filenames = get_filenames1 true; |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
161 |
|
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
162 |
val get_thy_filenames = get_filenames1 false; |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
163 |
|
3602 | 164 |
|
391 | 165 |
(*Remove theory from all child lists in loaded_thys *) |
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
166 |
fun unlink_thy tname = |
4111 | 167 |
let fun remove ({path, children, parents, thy_time, ml_time, theory}) = |
3976 | 168 |
{path = path, children = children \ tname, parents = parents, |
4111 | 169 |
thy_time = thy_time, ml_time = ml_time, theory = theory} |
559 | 170 |
in loaded_thys := Symtab.map remove (!loaded_thys) end; |
391 | 171 |
|
3602 | 172 |
|
391 | 173 |
(*Remove a theory from loaded_thys *) |
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
174 |
fun remove_thy tname = |
559 | 175 |
loaded_thys := Symtab.make (filter_out (fn (id, _) => id = tname) |
176 |
(Symtab.dest (!loaded_thys))); |
|
391 | 177 |
|
3602 | 178 |
|
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
179 |
(*Change thy_time and ml_time for an existent item *) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
180 |
fun set_info tname thy_time ml_time = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
181 |
let val tinfo = case Symtab.lookup (!loaded_thys, tname) of |
4111 | 182 |
Some ({path, children, parents, theory, thy_time = _, ml_time = _}) => |
3976 | 183 |
{path = path, children = children, parents = parents, |
4111 | 184 |
thy_time = thy_time, ml_time = ml_time, theory = theory} |
1291 | 185 |
| None => error ("set_info: theory " ^ tname ^ " not found"); |
1359
71124bd19b40
added functions for storing and retrieving information about datatypes
clasohm
parents:
1348
diff
changeset
|
186 |
in loaded_thys := Symtab.update ((tname, tinfo), !loaded_thys) end; |
391 | 187 |
|
3602 | 188 |
|
391 | 189 |
(*Mark theory as changed since last read if it has been completly read *) |
559 | 190 |
fun mark_outdated tname = |
971
f4815812665b
fixed bug: parent theory wasn't loaded if .thy file was completly read before
clasohm
parents:
922
diff
changeset
|
191 |
let val t = get_thyinfo tname; |
f4815812665b
fixed bug: parent theory wasn't loaded if .thy file was completly read before
clasohm
parents:
922
diff
changeset
|
192 |
in if is_none t then () |
1291 | 193 |
else |
3976 | 194 |
let val {thy_time, ml_time, ...} = the t |
1291 | 195 |
in set_info tname (if is_none thy_time then None else Some "") |
196 |
(if is_none ml_time then None else Some "") |
|
197 |
end |
|
971
f4815812665b
fixed bug: parent theory wasn't loaded if .thy file was completly read before
clasohm
parents:
922
diff
changeset
|
198 |
end; |
391 | 199 |
|
1656 | 200 |
|
559 | 201 |
(*Read .thy and .ML files that haven't been read yet or have changed since |
391 | 202 |
they were last read; |
559 | 203 |
loaded_thys is a thy_info list ref containing all theories that have |
391 | 204 |
completly been read by this and preceeding use_thy calls. |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
205 |
tmp_loadpath is temporarily added to loadpath while the ancestors of a |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
206 |
theory that the user specified as e.g. "ex/Nat" are loaded. Because of |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
207 |
raised exceptions we cannot guarantee that it's value is always valid. |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
208 |
Therefore this has to be assured by the first parameter of use_thy1 which |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
209 |
is "true" if use_thy gets invoked by mk_base and "false" else. |
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
210 |
no_mlfile is a flag which indicates that the ml file for this theory |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
211 |
should not be read, used to implement use_thy_no_topml. |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
212 |
*) |
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
213 |
fun use_thy1 no_mlfile tmp_loadpath_valid name = |
1242 | 214 |
let |
215 |
val (path, tname) = split_filename name; |
|
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
216 |
val dummy = (tmp_loadpath := |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
217 |
(if not tmp_loadpath_valid then (if path = "" then [] else [path]) |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
218 |
else !tmp_loadpath)); |
1242 | 219 |
val (thy_file, ml_file) = get_filenames path tname; |
220 |
val (abs_path, _) = if thy_file = "" then split_filename ml_file |
|
221 |
else split_filename thy_file; |
|
222 |
val (thy_uptodate, ml_uptodate) = thy_unchanged tname thy_file ml_file; |
|
1403
cdfa3ffcead2
renamed parents_of to parents_of_name to avoid name clash with function
clasohm
parents:
1386
diff
changeset
|
223 |
val old_parents = parents_of_name tname; |
391 | 224 |
|
1242 | 225 |
(*Set absolute path for loaded theory *) |
226 |
fun set_path () = |
|
4111 | 227 |
let val {path = _, children, parents, thy_time, ml_time, theory} = |
1242 | 228 |
the (Symtab.lookup (!loaded_thys, tname)); |
229 |
in loaded_thys := Symtab.update ((tname, |
|
3976 | 230 |
{path = abs_path, |
1291 | 231 |
children = children, parents = parents, |
1242 | 232 |
thy_time = thy_time, ml_time = ml_time, |
4111 | 233 |
theory = theory}), |
1242 | 234 |
!loaded_thys) |
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
235 |
end |
1242 | 236 |
|
237 |
(*Mark all direct descendants of a theory as changed *) |
|
238 |
fun mark_children thy = |
|
1291 | 239 |
let val children = children_of thy; |
1242 | 240 |
val present = filter (is_some o get_thyinfo) children; |
241 |
val loaded = filter already_loaded present; |
|
242 |
in if loaded <> [] then |
|
243 |
writeln ("The following children of theory " ^ (quote thy) |
|
244 |
^ " are now out-of-date: " |
|
245 |
^ (quote (space_implode "\",\"" loaded))) |
|
246 |
else (); |
|
247 |
seq mark_outdated present |
|
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
248 |
end |
391 | 249 |
|
1554 | 250 |
(*Make sure that loaded_thys contains an entry for tname*) |
251 |
fun init_thyinfo () = |
|
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
252 |
let val tinfo = {path = "", children = [], parents = [], |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
253 |
thy_time = None, ml_time = None, |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
254 |
theory = None}; |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
255 |
in if is_some (get_thyinfo tname) then () |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
256 |
else loaded_thys := Symtab.update ((tname, tinfo), !loaded_thys) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
257 |
end |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
258 |
fun read_thy_file() = |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
259 |
if thy_file = "" then () |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
260 |
else |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
261 |
(writeln ("Reading \"" ^ name ^ ".thy\""); |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
262 |
init_thyinfo (); |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
263 |
read_thy tname thy_file; |
5615
9ea709aa275c
deleted incorrect code that set Goals.proof_timing:=false
paulson
parents:
5495
diff
changeset
|
264 |
Use.use (out_name tname); |
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
265 |
if not (!delete_tmpfiles) then () |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
266 |
else OS.FileSys.remove (out_name tname); |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
267 |
thyfile2html tname abs_path) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
268 |
|
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
269 |
(*Add theory to list of all loaded theories (for index.html) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
270 |
and it to its parents' sub-charts*) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
271 |
fun add_theory path = |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
272 |
if path = "" then (*first time theory has been read*) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
273 |
(mk_html tname abs_path old_parents; |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
274 |
mk_graph tname abs_path) (*Add it to graph definition file*) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
275 |
else () |
1242 | 276 |
in if thy_uptodate andalso ml_uptodate then () |
277 |
else |
|
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
278 |
(read_thy_file(); |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
279 |
set_info tname (Some (file_info thy_file)) None; |
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
280 |
(*mark thy_file as successfully loaded*) |
391 | 281 |
|
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
282 |
if (no_mlfile orelse ml_file = "") then () |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
283 |
else (writeln ("Reading \"" ^ name ^ ".ML\""); |
4218 | 284 |
Use.use ml_file); |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
285 |
|
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
286 |
(*Store theory again because it could have been redefined*) |
5090 | 287 |
use_text false ("val _ = store_theory " ^ tname ^ ".thy;"); |
391 | 288 |
|
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
289 |
add_theory (path_of tname); |
1291 | 290 |
|
1242 | 291 |
(*Now set the correct info*) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
292 |
set_info tname (Some (file_info thy_file)) (Some (file_info ml_file)); |
1242 | 293 |
set_path (); |
5495
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
294 |
mark_children tname; (*Mark theories that have to be reloaded*) |
48036910ab7e
Suppress timing messages for theorems proved in theory sections
paulson
parents:
5209
diff
changeset
|
295 |
close_html () ) |
1242 | 296 |
end; |
391 | 297 |
|
3602 | 298 |
|
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
299 |
val use_thy = use_thy1 false false; |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
300 |
val use_thy_no_topml = use_thy1 true false; |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
301 |
|
3602 | 302 |
|
391 | 303 |
fun time_use_thy tname = timeit(fn()=> |
559 | 304 |
(writeln("\n**** Starting Theory " ^ tname ^ " ****"); |
5615
9ea709aa275c
deleted incorrect code that set Goals.proof_timing:=false
paulson
parents:
5495
diff
changeset
|
305 |
setmp Goals.proof_timing true use_thy tname; |
391 | 306 |
writeln("\n**** Finished Theory " ^ tname ^ " ****")) |
307 |
); |
|
308 |
||
3602 | 309 |
|
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
310 |
val update_verbose = ref false; |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
311 |
|
391 | 312 |
(*Load all thy or ML files that have been changed and also |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
313 |
all theories that depend on them.*) |
391 | 314 |
fun update () = |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
315 |
let (*List theories in the order they have to be loaded in.*) |
391 | 316 |
fun load_order [] result = result |
317 |
| load_order thys result = |
|
1291 | 318 |
let fun next_level [] = [] |
319 |
| next_level (t :: ts) = |
|
320 |
let val children = children_of t |
|
321 |
in children union (next_level ts) end; |
|
559 | 322 |
|
1291 | 323 |
val descendants = next_level thys; |
324 |
in load_order descendants ((result \\ descendants) @ descendants) |
|
325 |
end; |
|
391 | 326 |
|
327 |
fun reload_changed (t :: ts) = |
|
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
328 |
let val abspath = case get_thyinfo t of |
3976 | 329 |
Some ({path, ...}) => path |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
330 |
| None => ""; |
391 | 331 |
|
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
332 |
val (thy_file, ml_file) = get_filenames abspath t; |
391 | 333 |
val (thy_uptodate, ml_uptodate) = |
334 |
thy_unchanged t thy_file ml_file; |
|
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
335 |
in if thy_uptodate andalso ml_uptodate then |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
336 |
(if !update_verbose then |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
337 |
(writeln |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
338 |
("Not reading \"" ^ thy_file ^ |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
339 |
"\" (unchanged)" ^ |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
340 |
(if ml_file <> "" |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
341 |
then "\nNot reading \"" ^ ml_file ^ |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
342 |
"\" (unchanged)" |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
343 |
else ""))) |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
344 |
else ()) |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
345 |
else use_thy t; |
391 | 346 |
reload_changed ts |
347 |
end |
|
348 |
| reload_changed [] = (); |
|
349 |
||
922
196ca0973a6d
added CPure (curried functions) and ProtoPure (ancestor of Pure and CPure)
clasohm
parents:
871
diff
changeset
|
350 |
(*Remove all theories that are no descendants of ProtoPure. |
391 | 351 |
If there are still children in the deleted theory's list |
352 |
schedule them for reloading *) |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
353 |
fun collect_garbage no_garbage = |
3976 | 354 |
let fun collect ((tname, {children, ...}: thy_info) :: ts) = |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
355 |
if tname mem no_garbage then collect ts |
922
196ca0973a6d
added CPure (curried functions) and ProtoPure (ancestor of Pure and CPure)
clasohm
parents:
871
diff
changeset
|
356 |
else (writeln ("Theory \"" ^ tname ^ |
196ca0973a6d
added CPure (curried functions) and ProtoPure (ancestor of Pure and CPure)
clasohm
parents:
871
diff
changeset
|
357 |
"\" is no longer linked with ProtoPure - removing it."); |
476
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
358 |
remove_thy tname; |
836cad329311
added check for concistency of filename and theory name;
clasohm
parents:
426
diff
changeset
|
359 |
seq mark_outdated children) |
391 | 360 |
| collect [] = () |
559 | 361 |
in collect (Symtab.dest (!loaded_thys)) end; |
1704
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
362 |
in tmp_loadpath := []; |
35045774bc1e
changed use_thy's behaviour so that if the user specifies a path for a theory
clasohm
parents:
1670
diff
changeset
|
363 |
collect_garbage ("ProtoPure" :: (load_order ["ProtoPure"] [])); |
922
196ca0973a6d
added CPure (curried functions) and ProtoPure (ancestor of Pure and CPure)
clasohm
parents:
871
diff
changeset
|
364 |
reload_changed (load_order ["Pure", "CPure"] []) |
391 | 365 |
end; |
366 |
||
3602 | 367 |
|
391 | 368 |
(*Merge theories to build a base for a new theory. |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
369 |
Base members are only loaded if they are missing.*) |
3876 | 370 |
fun mk_base bases child = |
1291 | 371 |
let (*Show the cycle that would be created by add_child*) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
372 |
fun show_cycle base = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
373 |
let fun find_it result curr = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
374 |
let val tinfo = get_thyinfo curr |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
375 |
in if base = curr then |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
376 |
error ("Cyclic dependency of theories: " |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
377 |
^ child ^ "->" ^ base ^ result) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
378 |
else if is_some tinfo then |
3976 | 379 |
let val {children, ...} = the tinfo |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
380 |
in seq (find_it ("->" ^ curr ^ result)) children |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
381 |
end |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
382 |
else () |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
383 |
end |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
384 |
in find_it "" child end; |
391 | 385 |
|
1291 | 386 |
(*Check if a cycle would be created by add_child*) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
387 |
fun find_cycle base = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
388 |
if base mem (get_descendants [child]) then show_cycle base |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
389 |
else (); |
559 | 390 |
|
1291 | 391 |
(*Add child to child list of base*) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
392 |
fun add_child base = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
393 |
let val tinfo = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
394 |
case Symtab.lookup (!loaded_thys, base) of |
3976 | 395 |
Some ({path, children, parents, thy_time, ml_time, |
4111 | 396 |
theory}) => |
3976 | 397 |
{path = path, |
1291 | 398 |
children = child ins children, parents = parents, |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
399 |
thy_time = thy_time, ml_time = ml_time, |
4111 | 400 |
theory = theory} |
3976 | 401 |
| None => {path = "", children = [child], parents = [], |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
402 |
thy_time = None, ml_time = None, |
4111 | 403 |
theory = None}; |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
404 |
in loaded_thys := Symtab.update ((base, tinfo), !loaded_thys) end; |
559 | 405 |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
406 |
(*Load a base theory if not already done |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
407 |
and no cycle would be created *) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
408 |
fun load base = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
409 |
let val thy_loaded = already_loaded base |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
410 |
(*test this before child is added *) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
411 |
in |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
412 |
if child = base then |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
413 |
error ("Cyclic dependency of theories: " ^ child |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
414 |
^ "->" ^ child) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
415 |
else |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
416 |
(find_cycle base; |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
417 |
add_child base; |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
418 |
if thy_loaded then () |
3876 | 419 |
else (writeln ("Autoloading theory " ^ quote base |
420 |
^ " (required by " ^ quote child ^ ")"); |
|
5730
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
421 |
(* autoloaded theories always use .ML files too *) |
82a7aa74a631
some additions for Proof General by David Aspinall;
wenzelm
parents:
5615
diff
changeset
|
422 |
use_thy1 false true base) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
423 |
) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
424 |
end; |
391 | 425 |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
426 |
(*Load all needed files and make a list of all real theories *) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
427 |
fun load_base (Thy b :: bs) = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
428 |
(load b; |
1291 | 429 |
b :: load_base bs) |
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
430 |
| load_base (File b :: bs) = |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
431 |
(load b; |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
432 |
load_base bs) (*don't add it to mergelist *) |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
433 |
| load_base [] = []; |
391 | 434 |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
435 |
val dummy = unlink_thy child; |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
436 |
val mergelist = load_base bases; |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
437 |
|
3876 | 438 |
val base_thy = |
439 |
(writeln ("Loading theory " ^ quote child); |
|
3998 | 440 |
if null mergelist then ProtoPure.thy |
5209 | 441 |
else Theory.prep_ext_merge (map ThyInfo.theory mergelist)); |
1457
ad856378ad62
added facility to associate arbitrary data with theories
clasohm
parents:
1408
diff
changeset
|
442 |
|
1291 | 443 |
val dummy = |
444 |
let val tinfo = case Symtab.lookup (!loaded_thys, child) of |
|
4111 | 445 |
Some ({path, children, parents = _, thy_time, ml_time, theory}) => |
446 |
{path = path, children = children, parents = mergelist, |
|
447 |
thy_time = thy_time, ml_time = ml_time, theory = theory} |
|
448 |
| None => sys_error ("set_parents: theory " ^ child ^ " not found"); |
|
1291 | 449 |
in loaded_thys := Symtab.update ((child, tinfo), !loaded_thys) end; |
450 |
||
4111 | 451 |
in |
452 |
cur_thyname := child; |
|
1262
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
453 |
base_thy |
8f40ff1299d8
added removal of theorems if theory is to be reloaded; changed functions for
clasohm
parents:
1244
diff
changeset
|
454 |
end; |
391 | 455 |
|
1359
71124bd19b40
added functions for storing and retrieving information about datatypes
clasohm
parents:
1348
diff
changeset
|
456 |
|
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
457 |
(*Temporarily enter a directory and load its ROOT.ML file; |
3602 | 458 |
also do some work for HTML and graph generation*) |
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
459 |
local |
1348
b9305143fa91
index.html files are now made separatly for each subdirectory
clasohm
parents:
1332
diff
changeset
|
460 |
|
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
461 |
fun gen_use_dir use_cmd dirname = |
2244
dacee519738a
Converted I/O operatios for Basis Library compatibility
paulson
parents:
2188
diff
changeset
|
462 |
let val old_dir = OS.FileSys.getDir (); |
dacee519738a
Converted I/O operatios for Basis Library compatibility
paulson
parents:
2188
diff
changeset
|
463 |
in OS.FileSys.chDir dirname; |
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
464 |
if !make_html then init_html() else (); |
3602 | 465 |
if !make_graph then init_graph dirname else (); |
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
466 |
use_cmd "ROOT.ML"; |
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
467 |
finish_html(); |
2244
dacee519738a
Converted I/O operatios for Basis Library compatibility
paulson
parents:
2188
diff
changeset
|
468 |
OS.FileSys.chDir old_dir |
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
469 |
end; |
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
470 |
|
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
471 |
in |
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
472 |
|
4218 | 473 |
val use_dir = gen_use_dir Use.use; |
474 |
val exit_use_dir = gen_use_dir Use.exit_use; |
|
1670
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
475 |
|
d706a6dce930
use_dir and exit_use_dir now change the CWD only temporarily
clasohm
parents:
1664
diff
changeset
|
476 |
end |
1348
b9305143fa91
index.html files are now made separatly for each subdirectory
clasohm
parents:
1332
diff
changeset
|
477 |
|
391 | 478 |
end; |