Skip to content

Commit

Permalink
Merge pull request kind2-mc#996 from daniel-larraz/fix-call-proj-ite
Browse files Browse the repository at this point in the history
Fix projection of call output in ITE condition
  • Loading branch information
daniel-larraz authored Jul 12, 2023
2 parents 405d6f4 + 5659ffa commit ed6fd42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/lustre/lustreArrayDependencies.ml
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ and process_expr ind_vars ctx ns proj indices expr =
(* Operators *)
| UnaryOp (_, _, e) -> r e
| BinaryOp (_, _, e1, e2) -> union_ (r e1) (r e2)
| TernaryOp (_, _, e1, e2, e3) ->
union_ (union_ (r e1) (r e2)) (r e3)
| TernaryOp (_, Ite, e1, e2, e3) ->
let r_e1 = process_expr ind_vars ctx ns 0 indices e1 in
union_ (union_ (r_e1) (r e2)) (r e3)
| TernaryOp (_, With, _, _, _) -> assert false
| NArityOp (_, _, es) ->
es |> (List.map r) |> (List.fold_left union_ empty_)
| ConvOp (_, _, e) -> r e
Expand Down
3 changes: 2 additions & 1 deletion tests/regression/success/group_expr_01.lus
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ let
z2 = x + 2;
tel

node N(c:bool) returns (x1,x2,y1,y2,y3,z1,z2:int);
node N(c:bool) returns (w1,w2,x1,x2,y1,y2,y3,z1,z2:int);
let
y1, y2, y3 = if c then (1,(2,3)) else (4,(5,6));
z1, z2 = (M(c), M(not c));
x1, x2 = R(M(c));
w1, w2 = if M(c)=7 then R(0) else R(1);
tel

0 comments on commit ed6fd42

Please sign in to comment.