Project

General

Profile

« Previous | Next » 

Revision e164da10

Added by LĂ©lio Brun over 2 years ago

fix live variable calculation for spec: take variables occuring in clocks into account

View differences:

src/lustre_live.ml
30 30
  | _ ->
31 31
    s
32 32

  
33
let occur_carrier s ckr =
34
  let open Clocks in
35
  match (carrier_repr ckr).carrier_desc with
36
  | Carry_const x -> add x s
37
  | _ -> s
38

  
39
let rec occur_clock s ck =
40
  let open Clocks in
41
  match (repr ck).cdesc with
42
  | Carrow (c1, c2) -> occur_clock (occur_clock s c1) c2
43
  | Ctuple cs -> List.fold_left occur_clock s cs
44
  | Con (ck, cr, _)
45
  | Ccarrying (cr, ck) -> occur_clock (occur_carrier s cr) ck
46
  | _ -> s
47

  
33 48
let rec occur_expr s e =
49
  let s = occur_clock s e.expr_clock in
34 50
  match e.expr_desc with
35 51
  | Expr_ident x ->
36 52
    add x s

Also available in: Unified diff