Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/graphs/wrappers.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/graphs/wrappers.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : monnier 411 (*
2 :     * These graph wrappers allow the client to attach triggers to
3 :     * various graph methods.
4 :     *
5 :     * -- Allen
6 :     *)
7 :    
8 : monnier 245 signature GRAPH_WRAPPERS =
9 :     sig
10 :    
11 :     val do_before_new_id :
12 :     (unit -> unit) -> ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
13 :     val do_after_new_id :
14 :     (Graph.node_id -> unit) ->
15 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
16 :     val do_before_add_node :
17 :     ('n Graph.node -> unit) ->
18 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
19 :     val do_after_add_node :
20 :     ('n Graph.node -> unit) ->
21 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
22 :     val do_before_add_edge :
23 :     ('e Graph.edge -> unit) ->
24 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
25 :     val do_after_add_edge :
26 :     ('e Graph.edge -> unit) ->
27 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
28 :     val do_before_remove_node :
29 :     (Graph.node_id -> unit) ->
30 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
31 :     val do_after_remove_node :
32 :     (Graph.node_id -> unit) ->
33 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
34 :     val do_before_set_in_edges :
35 :     (Graph.node_id * 'e Graph.edge list -> unit) ->
36 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
37 :     val do_after_set_in_edges :
38 :     (Graph.node_id * 'e Graph.edge list -> unit) ->
39 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
40 :     val do_before_set_out_edges :
41 :     (Graph.node_id * 'e Graph.edge list -> unit) ->
42 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
43 :     val do_after_set_out_edges :
44 :     (Graph.node_id * 'e Graph.edge list -> unit) ->
45 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
46 :     val do_before_set_entries :
47 :     (Graph.node_id list -> unit) ->
48 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
49 :     val do_after_set_entries :
50 :     (Graph.node_id list -> unit) ->
51 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
52 :     val do_before_set_exits :
53 :     (Graph.node_id list -> unit) ->
54 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
55 :     val do_after_set_exits :
56 :     (Graph.node_id list -> unit) ->
57 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
58 :     val do_before_changed : (('n,'e,'g) Graph.graph -> unit) ->
59 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
60 :     val do_after_changed : (('n,'e,'g) Graph.graph -> unit) ->
61 :     ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
62 :     end
63 :    
64 :     structure GraphWrappers : GRAPH_WRAPPERS =
65 :     struct
66 :    
67 :     structure G = Graph
68 :    
69 :     fun do_before_new_id f (G.GRAPH G) =
70 :     G.GRAPH
71 :     { name = #name G,
72 :     graph_info = #graph_info G,
73 :     new_id = fn () => (f(); #new_id G ()),
74 :     add_node = #add_node G,
75 :     add_edge = #add_edge G,
76 :     remove_node = #remove_node G,
77 :     set_in_edges = #set_in_edges G,
78 :     set_out_edges = #set_out_edges G,
79 :     set_entries = #set_entries G,
80 :     set_exits = #set_exits G,
81 :     garbage_collect = #garbage_collect G,
82 :     nodes = #nodes G,
83 :     edges = #edges G,
84 :     order = #order G,
85 :     size = #size G,
86 :     capacity = #capacity G,
87 :     out_edges = #out_edges G,
88 :     in_edges = #in_edges G,
89 :     succ = #succ G,
90 :     pred = #pred G,
91 :     has_edge = #has_edge G,
92 :     has_node = #has_node G,
93 :     node_info = #node_info G,
94 :     entries = #entries G,
95 :     exits = #exits G,
96 :     entry_edges = #entry_edges G,
97 :     exit_edges = #exit_edges G,
98 :     forall_nodes = #forall_nodes G,
99 :     forall_edges = #forall_edges G
100 :     }
101 :    
102 :     fun do_after_new_id f (G.GRAPH G) =
103 :     G.GRAPH
104 :     { name = #name G,
105 :     graph_info = #graph_info G,
106 :     new_id = fn () => let val x = #new_id G () in f x; x end,
107 :     add_node = #add_node G,
108 :     add_edge = #add_edge G,
109 :     remove_node = #remove_node G,
110 :     set_in_edges = #set_in_edges G,
111 :     set_out_edges = #set_out_edges G,
112 :     set_entries = #set_entries G,
113 :     set_exits = #set_exits G,
114 :     garbage_collect = #garbage_collect G,
115 :     nodes = #nodes G,
116 :     edges = #edges G,
117 :     order = #order G,
118 :     size = #size G,
119 :     capacity = #capacity G,
120 :     out_edges = #out_edges G,
121 :     in_edges = #in_edges G,
122 :     succ = #succ G,
123 :     pred = #pred G,
124 :     has_edge = #has_edge G,
125 :     has_node = #has_node G,
126 :     node_info = #node_info G,
127 :     entries = #entries G,
128 :     exits = #exits G,
129 :     entry_edges = #entry_edges G,
130 :     exit_edges = #exit_edges G,
131 :     forall_nodes = #forall_nodes G,
132 :     forall_edges = #forall_edges G
133 :     }
134 :    
135 :     fun do_before_add_node f (G.GRAPH G) =
136 :     G.GRAPH
137 :     { name = #name G,
138 :     graph_info = #graph_info G,
139 :     new_id = #new_id G,
140 :     add_node = fn n => (f n; #add_node G n),
141 :     add_edge = #add_edge G,
142 :     remove_node = #remove_node G,
143 :     set_in_edges = #set_in_edges G,
144 :     set_out_edges = #set_out_edges G,
145 :     set_entries = #set_entries G,
146 :     set_exits = #set_exits G,
147 :     garbage_collect = #garbage_collect G,
148 :     nodes = #nodes G,
149 :     edges = #edges G,
150 :     order = #order G,
151 :     size = #size G,
152 :     capacity = #capacity G,
153 :     out_edges = #out_edges G,
154 :     in_edges = #in_edges G,
155 :     succ = #succ G,
156 :     pred = #pred G,
157 :     has_edge = #has_edge G,
158 :     has_node = #has_node G,
159 :     node_info = #node_info G,
160 :     entries = #entries G,
161 :     exits = #exits G,
162 :     entry_edges = #entry_edges G,
163 :     exit_edges = #exit_edges G,
164 :     forall_nodes = #forall_nodes G,
165 :     forall_edges = #forall_edges G
166 :     }
167 :    
168 :     fun do_after_add_node f (G.GRAPH G) =
169 :     G.GRAPH
170 :     { name = #name G,
171 :     graph_info = #graph_info G,
172 :     new_id = #new_id G,
173 :     add_node = fn n => (#add_node G n; f n),
174 :     add_edge = #add_edge G,
175 :     remove_node = #remove_node G,
176 :     set_in_edges = #set_in_edges G,
177 :     set_out_edges = #set_out_edges G,
178 :     set_entries = #set_entries G,
179 :     set_exits = #set_exits G,
180 :     garbage_collect = #garbage_collect G,
181 :     nodes = #nodes G,
182 :     edges = #edges G,
183 :     order = #order G,
184 :     size = #size G,
185 :     capacity = #capacity G,
186 :     out_edges = #out_edges G,
187 :     in_edges = #in_edges G,
188 :     succ = #succ G,
189 :     pred = #pred G,
190 :     has_edge = #has_edge G,
191 :     has_node = #has_node G,
192 :     node_info = #node_info G,
193 :     entries = #entries G,
194 :     exits = #exits G,
195 :     entry_edges = #entry_edges G,
196 :     exit_edges = #exit_edges G,
197 :     forall_nodes = #forall_nodes G,
198 :     forall_edges = #forall_edges G
199 :     }
200 :    
201 :     fun do_before_add_edge f (G.GRAPH G) =
202 :     G.GRAPH
203 :     { name = #name G,
204 :     graph_info = #graph_info G,
205 :     new_id = #new_id G,
206 :     add_node = #add_node G,
207 :     add_edge = fn e => (f e; #add_edge G e),
208 :     remove_node = #remove_node G,
209 :     set_in_edges = #set_in_edges G,
210 :     set_out_edges = #set_out_edges G,
211 :     set_entries = #set_entries G,
212 :     set_exits = #set_exits G,
213 :     garbage_collect = #garbage_collect G,
214 :     nodes = #nodes G,
215 :     edges = #edges G,
216 :     order = #order G,
217 :     size = #size G,
218 :     capacity = #capacity G,
219 :     out_edges = #out_edges G,
220 :     in_edges = #in_edges G,
221 :     succ = #succ G,
222 :     pred = #pred G,
223 :     has_edge = #has_edge G,
224 :     has_node = #has_node G,
225 :     node_info = #node_info G,
226 :     entries = #entries G,
227 :     exits = #exits G,
228 :     entry_edges = #entry_edges G,
229 :     exit_edges = #exit_edges G,
230 :     forall_nodes = #forall_nodes G,
231 :     forall_edges = #forall_edges G
232 :     }
233 :    
234 :     fun do_after_add_edge f (G.GRAPH G) =
235 :     G.GRAPH
236 :     { name = #name G,
237 :     graph_info = #graph_info G,
238 :     new_id = #new_id G,
239 :     add_node = #add_node G,
240 :     add_edge = fn e => (#add_edge G e; f e),
241 :     remove_node = #remove_node G,
242 :     set_in_edges = #set_in_edges G,
243 :     set_out_edges = #set_out_edges G,
244 :     set_entries = #set_entries G,
245 :     set_exits = #set_exits G,
246 :     garbage_collect = #garbage_collect G,
247 :     nodes = #nodes G,
248 :     edges = #edges G,
249 :     order = #order G,
250 :     size = #size G,
251 :     capacity = #capacity G,
252 :     out_edges = #out_edges G,
253 :     in_edges = #in_edges G,
254 :     succ = #succ G,
255 :     pred = #pred G,
256 :     has_edge = #has_edge G,
257 :     has_node = #has_node G,
258 :     node_info = #node_info G,
259 :     entries = #entries G,
260 :     exits = #exits G,
261 :     entry_edges = #entry_edges G,
262 :     exit_edges = #exit_edges G,
263 :     forall_nodes = #forall_nodes G,
264 :     forall_edges = #forall_edges G
265 :     }
266 :    
267 :     fun do_before_remove_node f (G.GRAPH G) =
268 :     G.GRAPH
269 :     { name = #name G,
270 :     graph_info = #graph_info G,
271 :     new_id = #new_id G,
272 :     add_node = #add_node G,
273 :     add_edge = #add_edge G,
274 :     remove_node = fn n => (f n; #remove_node G n),
275 :     set_in_edges = #set_in_edges G,
276 :     set_out_edges = #set_out_edges G,
277 :     set_entries = #set_entries G,
278 :     set_exits = #set_exits G,
279 :     garbage_collect = #garbage_collect G,
280 :     nodes = #nodes G,
281 :     edges = #edges G,
282 :     order = #order G,
283 :     size = #size G,
284 :     capacity = #capacity G,
285 :     out_edges = #out_edges G,
286 :     in_edges = #in_edges G,
287 :     succ = #succ G,
288 :     pred = #pred G,
289 :     has_edge = #has_edge G,
290 :     has_node = #has_node G,
291 :     node_info = #node_info G,
292 :     entries = #entries G,
293 :     exits = #exits G,
294 :     entry_edges = #entry_edges G,
295 :     exit_edges = #exit_edges G,
296 :     forall_nodes = #forall_nodes G,
297 :     forall_edges = #forall_edges G
298 :     }
299 :    
300 :     fun do_after_remove_node f (G.GRAPH G) =
301 :     G.GRAPH
302 :     { name = #name G,
303 :     graph_info = #graph_info G,
304 :     new_id = #new_id G,
305 :     add_node = #add_node G,
306 :     add_edge = #add_edge G,
307 :     remove_node = fn n => (#remove_node G n; f n),
308 :     set_in_edges = #set_in_edges G,
309 :     set_out_edges = #set_out_edges G,
310 :     set_entries = #set_entries G,
311 :     set_exits = #set_exits G,
312 :     garbage_collect = #garbage_collect G,
313 :     nodes = #nodes G,
314 :     edges = #edges G,
315 :     order = #order G,
316 :     size = #size G,
317 :     capacity = #capacity G,
318 :     out_edges = #out_edges G,
319 :     in_edges = #in_edges G,
320 :     succ = #succ G,
321 :     pred = #pred G,
322 :     has_edge = #has_edge G,
323 :     has_node = #has_node G,
324 :     node_info = #node_info G,
325 :     entries = #entries G,
326 :     exits = #exits G,
327 :     entry_edges = #entry_edges G,
328 :     exit_edges = #exit_edges G,
329 :     forall_nodes = #forall_nodes G,
330 :     forall_edges = #forall_edges G
331 :     }
332 :    
333 :     fun do_before_set_in_edges f (G.GRAPH G) =
334 :     G.GRAPH
335 :     { name = #name G,
336 :     graph_info = #graph_info G,
337 :     new_id = #new_id G,
338 :     add_node = #add_node G,
339 :     add_edge = #add_edge G,
340 :     remove_node = #remove_node G,
341 :     set_in_edges = fn e => (f e; #set_in_edges G e),
342 :     set_out_edges = #set_out_edges G,
343 :     set_entries = #set_entries G,
344 :     set_exits = #set_exits G,
345 :     garbage_collect = #garbage_collect G,
346 :     nodes = #nodes G,
347 :     edges = #edges G,
348 :     order = #order G,
349 :     size = #size G,
350 :     capacity = #capacity G,
351 :     out_edges = #out_edges G,
352 :     in_edges = #in_edges G,
353 :     succ = #succ G,
354 :     pred = #pred G,
355 :     has_edge = #has_edge G,
356 :     has_node = #has_node G,
357 :     node_info = #node_info G,
358 :     entries = #entries G,
359 :     exits = #exits G,
360 :     entry_edges = #entry_edges G,
361 :     exit_edges = #exit_edges G,
362 :     forall_nodes = #forall_nodes G,
363 :     forall_edges = #forall_edges G
364 :     }
365 :    
366 :     fun do_after_set_in_edges f (G.GRAPH G) =
367 :     G.GRAPH
368 :     { name = #name G,
369 :     graph_info = #graph_info G,
370 :     new_id = #new_id G,
371 :     add_node = #add_node G,
372 :     add_edge = #add_edge G,
373 :     remove_node = #remove_node G,
374 :     set_in_edges = fn e => (#set_in_edges G e; f e),
375 :     set_out_edges = #set_out_edges G,
376 :     set_entries = #set_entries G,
377 :     set_exits = #set_exits G,
378 :     garbage_collect = #garbage_collect G,
379 :     nodes = #nodes G,
380 :     edges = #edges G,
381 :     order = #order G,
382 :     size = #size G,
383 :     capacity = #capacity G,
384 :     out_edges = #out_edges G,
385 :     in_edges = #in_edges G,
386 :     succ = #succ G,
387 :     pred = #pred G,
388 :     has_edge = #has_edge G,
389 :     has_node = #has_node G,
390 :     node_info = #node_info G,
391 :     entries = #entries G,
392 :     exits = #exits G,
393 :     entry_edges = #entry_edges G,
394 :     exit_edges = #exit_edges G,
395 :     forall_nodes = #forall_nodes G,
396 :     forall_edges = #forall_edges G
397 :     }
398 :    
399 :     fun do_before_set_out_edges f (G.GRAPH G) =
400 :     G.GRAPH
401 :     { name = #name G,
402 :     graph_info = #graph_info G,
403 :     new_id = #new_id G,
404 :     add_node = #add_node G,
405 :     add_edge = #add_edge G,
406 :     remove_node = #remove_node G,
407 :     set_out_edges = fn e => (f e; #set_out_edges G e),
408 :     set_in_edges = #set_in_edges G,
409 :     set_entries = #set_entries G,
410 :     set_exits = #set_exits G,
411 :     garbage_collect = #garbage_collect G,
412 :     nodes = #nodes G,
413 :     edges = #edges G,
414 :     order = #order G,
415 :     size = #size G,
416 :     capacity = #capacity G,
417 :     out_edges = #out_edges G,
418 :     in_edges = #in_edges G,
419 :     succ = #succ G,
420 :     pred = #pred G,
421 :     has_edge = #has_edge G,
422 :     has_node = #has_node G,
423 :     node_info = #node_info G,
424 :     entries = #entries G,
425 :     exits = #exits G,
426 :     entry_edges = #entry_edges G,
427 :     exit_edges = #exit_edges G,
428 :     forall_nodes = #forall_nodes G,
429 :     forall_edges = #forall_edges G
430 :     }
431 :    
432 :     fun do_after_set_out_edges f (G.GRAPH G) =
433 :     G.GRAPH
434 :     { name = #name G,
435 :     graph_info = #graph_info G,
436 :     new_id = #new_id G,
437 :     add_node = #add_node G,
438 :     add_edge = #add_edge G,
439 :     remove_node = #remove_node G,
440 :     set_out_edges = fn e => (#set_out_edges G e; f e),
441 :     set_in_edges = #set_in_edges G,
442 :     set_entries = #set_entries G,
443 :     set_exits = #set_exits G,
444 :     garbage_collect = #garbage_collect G,
445 :     nodes = #nodes G,
446 :     edges = #edges G,
447 :     order = #order G,
448 :     size = #size G,
449 :     capacity = #capacity G,
450 :     out_edges = #out_edges G,
451 :     in_edges = #in_edges G,
452 :     succ = #succ G,
453 :     pred = #pred G,
454 :     has_edge = #has_edge G,
455 :     has_node = #has_node G,
456 :     node_info = #node_info G,
457 :     entries = #entries G,
458 :     exits = #exits G,
459 :     entry_edges = #entry_edges G,
460 :     exit_edges = #exit_edges G,
461 :     forall_nodes = #forall_nodes G,
462 :     forall_edges = #forall_edges G
463 :     }
464 :    
465 :     fun do_before_set_entries f (G.GRAPH G) =
466 :     G.GRAPH
467 :     { name = #name G,
468 :     graph_info = #graph_info G,
469 :     new_id = #new_id G,
470 :     add_node = #add_node G,
471 :     add_edge = #add_edge G,
472 :     remove_node = #remove_node G,
473 :     set_in_edges = #set_in_edges G,
474 :     set_out_edges = #set_out_edges G,
475 :     set_entries = fn ns => (f ns; #set_entries G ns),
476 :     set_exits = #set_exits G,
477 :     garbage_collect = #garbage_collect G,
478 :     nodes = #nodes G,
479 :     edges = #edges G,
480 :     order = #order G,
481 :     size = #size G,
482 :     capacity = #capacity G,
483 :     out_edges = #out_edges G,
484 :     in_edges = #in_edges G,
485 :     succ = #succ G,
486 :     pred = #pred G,
487 :     has_edge = #has_edge G,
488 :     has_node = #has_node G,
489 :     node_info = #node_info G,
490 :     entries = #entries G,
491 :     exits = #exits G,
492 :     entry_edges = #entry_edges G,
493 :     exit_edges = #exit_edges G,
494 :     forall_nodes = #forall_nodes G,
495 :     forall_edges = #forall_edges G
496 :     }
497 :    
498 :     fun do_after_set_entries f (G.GRAPH G) =
499 :     G.GRAPH
500 :     { name = #name G,
501 :     graph_info = #graph_info G,
502 :     new_id = #new_id G,
503 :     add_node = #add_node G,
504 :     add_edge = #add_edge G,
505 :     remove_node = #remove_node G,
506 :     set_in_edges = #set_in_edges G,
507 :     set_out_edges = #set_out_edges G,
508 :     set_entries = fn ns => (#set_entries G ns; f ns),
509 :     set_exits = #set_exits G,
510 :     garbage_collect = #garbage_collect G,
511 :     nodes = #nodes G,
512 :     edges = #edges G,
513 :     order = #order G,
514 :     size = #size G,
515 :     capacity = #capacity G,
516 :     out_edges = #out_edges G,
517 :     in_edges = #in_edges G,
518 :     succ = #succ G,
519 :     pred = #pred G,
520 :     has_edge = #has_edge G,
521 :     has_node = #has_node G,
522 :     node_info = #node_info G,
523 :     entries = #entries G,
524 :     exits = #exits G,
525 :     entry_edges = #entry_edges G,
526 :     exit_edges = #exit_edges G,
527 :     forall_nodes = #forall_nodes G,
528 :     forall_edges = #forall_edges G
529 :     }
530 :    
531 :     fun do_before_set_exits f (G.GRAPH G) =
532 :     G.GRAPH
533 :     { name = #name G,
534 :     graph_info = #graph_info G,
535 :     new_id = #new_id G,
536 :     add_node = #add_node G,
537 :     add_edge = #add_edge G,
538 :     remove_node = #remove_node G,
539 :     set_in_edges = #set_in_edges G,
540 :     set_out_edges = #set_out_edges G,
541 :     set_entries = #set_entries G,
542 :     set_exits = fn ns => (f ns; #set_exits G ns),
543 :     garbage_collect = #garbage_collect G,
544 :     nodes = #nodes G,
545 :     edges = #edges G,
546 :     order = #order G,
547 :     size = #size G,
548 :     capacity = #capacity G,
549 :     out_edges = #out_edges G,
550 :     in_edges = #in_edges G,
551 :     succ = #succ G,
552 :     pred = #pred G,
553 :     has_edge = #has_edge G,
554 :     has_node = #has_node G,
555 :     node_info = #node_info G,
556 :     entries = #entries G,
557 :     exits = #exits G,
558 :     entry_edges = #entry_edges G,
559 :     exit_edges = #exit_edges G,
560 :     forall_nodes = #forall_nodes G,
561 :     forall_edges = #forall_edges G
562 :     }
563 :    
564 :     fun do_after_set_exits f (G.GRAPH G) =
565 :     G.GRAPH
566 :     { name = #name G,
567 :     graph_info = #graph_info G,
568 :     new_id = #new_id G,
569 :     add_node = #add_node G,
570 :     add_edge = #add_edge G,
571 :     remove_node = #remove_node G,
572 :     set_in_edges = #set_in_edges G,
573 :     set_out_edges = #set_out_edges G,
574 :     set_entries = #set_entries G,
575 :     set_exits = fn ns => (#set_exits G ns; f ns),
576 :     garbage_collect = #garbage_collect G,
577 :     nodes = #nodes G,
578 :     edges = #edges G,
579 :     order = #order G,
580 :     size = #size G,
581 :     capacity = #capacity G,
582 :     out_edges = #out_edges G,
583 :     in_edges = #in_edges G,
584 :     succ = #succ G,
585 :     pred = #pred G,
586 :     has_edge = #has_edge G,
587 :     has_node = #has_node G,
588 :     node_info = #node_info G,
589 :     entries = #entries G,
590 :     exits = #exits G,
591 :     entry_edges = #entry_edges G,
592 :     exit_edges = #exit_edges G,
593 :     forall_nodes = #forall_nodes G,
594 :     forall_edges = #forall_edges G
595 :     }
596 :    
597 :     fun do_before_changed f (G' as G.GRAPH G) =
598 :     G.GRAPH
599 :     { name = #name G,
600 :     graph_info = #graph_info G,
601 :     new_id = (fn x => (f G'; #new_id G x)),
602 :     add_node = (fn x => (f G'; #add_node G x)),
603 :     add_edge = (fn x => (f G'; #add_edge G x)),
604 :     remove_node = (fn x => (f G'; #remove_node G x)),
605 :     set_in_edges = (fn x => (f G'; #set_in_edges G x)),
606 :     set_out_edges = (fn x => (f G'; #set_out_edges G x)),
607 :     set_entries = (fn x => (f G'; #set_entries G x)),
608 :     set_exits = (fn x => (f G'; #set_exits G x)),
609 :     garbage_collect = #garbage_collect G,
610 :     nodes = #nodes G,
611 :     edges = #edges G,
612 :     order = #order G,
613 :     size = #size G,
614 :     capacity = #capacity G,
615 :     out_edges = #out_edges G,
616 :     in_edges = #in_edges G,
617 :     succ = #succ G,
618 :     pred = #pred G,
619 :     has_edge = #has_edge G,
620 :     has_node = #has_node G,
621 :     node_info = #node_info G,
622 :     entries = #entries G,
623 :     exits = #exits G,
624 :     entry_edges = #entry_edges G,
625 :     exit_edges = #exit_edges G,
626 :     forall_nodes = #forall_nodes G,
627 :     forall_edges = #forall_edges G
628 :     }
629 :    
630 :     fun do_after_changed f (G' as G.GRAPH G) =
631 :     G.GRAPH
632 :     { name = #name G,
633 :     graph_info = #graph_info G,
634 :     new_id = (fn x => (#new_id G x before f G')),
635 :     add_node = (fn x => (#add_node G x before f G')),
636 :     add_edge = (fn x => (#add_edge G x before f G')),
637 :     remove_node = (fn x => (#remove_node G x before f G')),
638 :     set_out_edges = (fn x => (#set_out_edges G x before f G')),
639 :     set_in_edges = (fn x => (#set_in_edges G x before f G')),
640 :     set_entries = (fn x => (#set_entries G x before f G')),
641 :     set_exits = (fn x => (#set_exits G x before f G')),
642 :     garbage_collect = #garbage_collect G,
643 :     nodes = #nodes G,
644 :     edges = #edges G,
645 :     order = #order G,
646 :     size = #size G,
647 :     capacity = #capacity G,
648 :     out_edges = #out_edges G,
649 :     in_edges = #in_edges G,
650 :     succ = #succ G,
651 :     pred = #pred G,
652 :     has_edge = #has_edge G,
653 :     has_node = #has_node G,
654 :     node_info = #node_info G,
655 :     entries = #entries G,
656 :     exits = #exits G,
657 :     entry_edges = #entry_edges G,
658 :     exit_edges = #exit_edges G,
659 :     forall_nodes = #forall_nodes G,
660 :     forall_edges = #forall_edges G
661 :     }
662 :    
663 :     end
664 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0