Revision e47138b8
Added by Pierre-Loïc Garoche over 3 years ago
src/optimize_prog.ml | ||
---|---|---|
9 | 9 |
(* *) |
10 | 10 |
(********************************************************************) |
11 | 11 |
|
12 |
open Lustre_types |
|
12 | 13 |
open Corelang |
13 |
open LustreSpec
|
|
14 |
(* open LustreSpec *)
|
|
14 | 15 |
|
15 | 16 |
(* Consts unfoooolding *) |
16 | 17 |
let is_const i consts = |
... | ... | |
45 | 46 |
let eq_unfold_consts consts eq = |
46 | 47 |
{ eq with eq_rhs = expr_unfold_consts consts eq.eq_rhs } |
47 | 48 |
|
48 |
let node_unfold_consts consts node = |
|
49 |
{ node with node_stmts = List.map (fun eq -> Eq (eq_unfold_consts consts eq)) (get_node_eqs node) } |
|
49 |
let node_unfold_consts consts node = |
|
50 |
let eqs, automata = get_node_eqs node in |
|
51 |
assert (automata = []); |
|
52 |
{ node with node_stmts = List.map (fun eq -> Eq (eq_unfold_consts consts eq)) eqs } |
|
50 | 53 |
|
51 | 54 |
let prog_unfold_consts prog = |
52 | 55 |
let consts = List.map const_of_top (get_consts prog) in |
... | ... | |
92 | 95 |
{ eq with eq_rhs = expr_distribute_when eq.eq_rhs } |
93 | 96 |
|
94 | 97 |
let node_distribute_when node = |
95 |
{ node with node_stmts = List.map (fun eq -> Eq (eq_distribute_when eq)) (get_node_eqs node) } |
|
98 |
let eqs, automata = get_node_eqs node in |
|
99 |
assert (automata = []); |
|
100 |
{ node with node_stmts = List.map (fun eq -> Eq (eq_distribute_when eq)) eqs } |
|
96 | 101 |
|
97 | 102 |
let prog_distribute_when prog = |
98 | 103 |
List.map ( |
Also available in: Unified diff
reactivating the unfolding of constants