Project

General

Profile

« Previous | Next » 

Revision 70466917

Added by Pierre-Loïc Garoche over 5 years ago

[main] node locals are now sorted according to their dependencies wrt clocks. The produced lustre node with types shall now be compilable

View differences:

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

  
12
open Graph
13 12
open LustreSpec
14 13
open Corelang
15
module TopologicalDepGraph = Topological.Make(Causality.IdentDepGraph)
16 14

  
17 15
let get_node nid prog =
18 16
  List.find (fun t -> match t.top_decl_desc with Node n -> n.node_id = nid | _ -> false) prog
......
29 27
      Causality.CycleDetection.check_cycles g;
30 28
    
31 29
      (
32
	TopologicalDepGraph.fold 
30
	Causality.TopologicalDepGraph.fold 
33 31
	  (fun x accu -> 
34 32
	    try 
35 33
	      (get_node x nodes)::accu
......
50 48
    (fun fmt -> Format.fprintf fmt "Ordered list of declarations:@.%a@.@?" (Utils.fprintf_list ~sep:"@." Printers.pp_short_decl) sorted);
51 49
  	  not_nodes@sorted
52 50

  
51

  
52
let sort_node_locals nd =
53
  { nd with node_locals = Causality.VarClockDep.sort nd.node_locals}
54
    
55
let sort_nodes_locals prog =
56
  List.map
57
    (fun top ->
58
      match top.top_decl_desc with
59
      | Node nd -> {top with top_decl_desc = Node (sort_node_locals nd)}
60
      | _ -> top
61
    )
62
    prog
63
    
53 64
(* Local Variables: *)
54 65
(* compile-command:"make -C .." *)
55 66
(* End: *)

Also available in: Unified diff