Project

General

Profile

Revision 0038002e src/optimize_prog.ml

View differences:

src/optimize_prog.ml
1 1
open Corelang
2
open LustreSpec
2 3

  
3 4
(* Consts unfoooolding *)
4 5
let is_const i consts = 
......
28 29
  | Expr_pre e' -> Expr_pre (unfold e')
29 30
  | Expr_when (e', i, l)-> Expr_when (unfold e', i, l)
30 31
  | Expr_merge (i, hl) -> Expr_merge (i, List.map (fun (t, h) -> (t, unfold h)) hl)
31
  | Expr_appl (i, e', i') -> Expr_appl (i, unfold e', i')
32
  | Expr_uclock (e', i) -> Expr_uclock (unfold e', i) 
33
  | Expr_dclock (e', i) -> Expr_dclock (unfold e', i)
34
  | Expr_phclock _ -> e  
32
  | Expr_appl (i, e', i') -> Expr_appl (i, unfold e', i')  
35 33

  
36 34
let eq_unfold_consts consts eq =
37 35
  { eq with eq_rhs = expr_unfold_consts consts eq.eq_rhs }
......
74 72
    | Expr_when (e', i, l)-> distrib ((i, l)::stack) e'
75 73
    | Expr_merge (i, hl) -> { expr with expr_desc = Expr_merge (i, List.map (fun (t, h) -> (t, distrib stack h)) hl) }
76 74
    | Expr_appl (id, e', i') -> { expr with expr_desc = Expr_appl (id, distrib stack e', i')}
77
    | _ -> assert false
78 75
  in distrib [] expr
79 76

  
80 77
let eq_distribute_when eq =

Also available in: Unified diff