Project

General

Profile

Revision 3769b712 src/sortProg.ml

View differences:

src/sortProg.ml
9 9
(*                                                                  *)
10 10
(********************************************************************)
11 11

  
12
open Lustre_types
13
open Corelang
14
open Utils
12
open Lustrec.Lustre_types
13
open Lustrec.Corelang
14
open Lustrec.Utils
15 15
   
16 16
let get_node nid prog =
17 17
  List.find (fun t -> match t.top_decl_desc with Node n -> n.node_id = nid | _ -> false) prog
......
24 24
  in
25 25
  let sorted = 
26 26
    try
27
      let g = Causality.NodeDep.dependence_graph nodes in
28
      Causality.CycleDetection.check_cycles g;
27
      let g = Lustrec.Causality.NodeDep.dependence_graph nodes in
28
      Lustrec.Causality.CycleDetection.check_cycles g;
29 29
    
30 30
      (
31 31
	TopologicalDepGraph.fold 
......
41 41
	  )
42 42
	  g []
43 43
      )
44
  with (Causality.Error err) as exc ->
45
    Causality.pp_error Format.err_formatter err;
44
  with  (Lustrec.Causality.Error err) as exc ->
45
    Lustrec.Causality.pp_error Format.err_formatter err;
46 46
    raise exc
47 47
  in
48 48
  
49
  Log.report ~level:3 
50
    (fun fmt -> Format.fprintf fmt "Ordered list of declarations:@.%a@.@?" (Utils.fprintf_list ~sep:"@." Printers.pp_short_decl) sorted);
49
  Lustrec.Log.report ~level:3 
50
    (fun fmt -> Format.fprintf fmt "Ordered list of declarations:@.%a@.@?" (Lustrec.Utils.fprintf_list ~sep:"@." Lustrec.Printers.pp_short_decl) sorted);
51 51
  	  not_nodes@sorted
52 52

  
53 53

  
54 54
let sort_node_locals nd =
55
  { nd with node_locals = Causality.VarClockDep.sort nd.node_locals}
55
  { nd with node_locals = Lustrec.Causality.VarClockDep.sort nd.node_locals}
56 56
    
57 57
let sort_nodes_locals prog =
58 58
  List.map

Also available in: Unified diff