Revision b1a97ade src/causality.ml
src/causality.ml  

390  390 
match vdecls with 
391  391 
 [] > () 
392  392 
 vdecl :: q > begin 
393 
Hashtbl.add map vdecl.var_id (List.fold_left (fun r v > if Clocks.disjoint v.var_clock vdecl.var_clock then v::r else r) [] q); 

393 
Hashtbl.add map vdecl.var_id (List.fold_left (fun r v > if Clocks.disjoint v.var_clock vdecl.var_clock then v.var_id::r else r) [] q);


394  394 
add_vdecl map q 
395  395 
end 
396  396  
397 
let build_clock_map vdecls =


397 
let clock_disjoint_map vdecls =


398  398 
let root_branch vdecl = Clocks.root vdecl.var_clock, Clocks.branch vdecl.var_clock in 
399  399 
let map = Hashtbl.create 23 in 
400  400 
begin 
401  401 
add_vdecl map (List.sort (fun v1 v2 > compare (root_branch v1) (root_branch v2)) vdecls); 
402  402 
map 
403  403 
end 
404  
405 
let pp_disjoint_map fmt map = 

406 
begin 

407 
Format.fprintf fmt "{ /* disjoint map */@."; 

408 
Hashtbl.iter (fun k v > Format.fprintf fmt "%s # { %a }@." k (Utils.fprintf_list ~sep:", " Format.pp_print_string) v) map; 

409 
Format.fprintf fmt "}@." 

410 
end 

404  411 
end 
405  412  
406  413 
let pp_dep_graph fmt g = 
...  ...  
415  422 
(fprintf_list ~sep:">" pp_print_string) trace 
416  423  
417  424 
(* Merges elements of graph [g2] into graph [g1] *) 
418 
let merge_with g1 g2 =


425 
let merge_with g1 g2 = 

419  426 
IdentDepGraph.iter_vertex (fun v > IdentDepGraph.add_vertex g1 v) g2; 
420  427 
IdentDepGraph.iter_edges (fun s t > IdentDepGraph.add_edge g1 s t) g2 
421  428 
Also available in: Unified diff