Test to watch sampling of returned stateful exps.
This commit is contained in:
parent
f76667e042
commit
fe1f02402b
4 changed files with 39 additions and 2 deletions
|
@ -188,7 +188,7 @@ struct
|
|||
acc
|
||||
end
|
||||
|
||||
(* Assumes normal form, all fby are solo rhs *)
|
||||
(* Assumes normal form, all fby are solo rhs or inside a when *)
|
||||
let node_memory_vars n =
|
||||
let rec eq funs acc ({ eq_lhs = pat; eq_rhs = e } as equ) =
|
||||
match pat, e.e_desc with
|
||||
|
|
|
@ -13,7 +13,7 @@ let
|
|||
cpt = size fby (if big_step then size else cpt - 1);
|
||||
y = merge big_step
|
||||
(true -> 0 -> !(pre (async lent(size))))
|
||||
(false -> 0 fby y when false(big_step));
|
||||
(false -> 0 fby y when false(big_step));
|
||||
z = do_stuff(1) - y;
|
||||
tel
|
||||
|
||||
|
|
20
test/good/sampling_stateful_output.ept
Normal file
20
test/good/sampling_stateful_output.ept
Normal file
|
@ -0,0 +1,20 @@
|
|||
node f(c :bool; x :int) returns (y :int)
|
||||
let
|
||||
y = (0 fby x) when c
|
||||
tel
|
||||
|
||||
node nn(x:int) returns (y:int)
|
||||
let
|
||||
y = 0 fby x
|
||||
tel
|
||||
|
||||
node ff(x:int) returns (y :int)
|
||||
let
|
||||
y = x + 1
|
||||
tel
|
||||
|
||||
node g(c :bool) returns (y,y2 :int)
|
||||
let
|
||||
y = nn(1) when c;
|
||||
y2 = ff(1) when c
|
||||
tel
|
17
test/tt.ept
Normal file
17
test/tt.ept
Normal file
|
@ -0,0 +1,17 @@
|
|||
node f(a : int) = (o : int)
|
||||
var x : int; c : bool;
|
||||
let
|
||||
c = true fby false fby c;
|
||||
x = 0 fby ((merge c a (x whenot c)) + 1);
|
||||
o = x when c
|
||||
tel
|
||||
|
||||
node g(a : int) = (o : int)
|
||||
var x1, x2:int; c1, c2: bool;
|
||||
let
|
||||
c1 = true fby false fby c1;
|
||||
c2 = true fby false fby c2;
|
||||
x1 = 0 fby ((merge c1 a (x1 whenot c1)) + 1);
|
||||
x2 = 0 fby ((merge c2 x1 (x2 whenot c2)) + 1);
|
||||
o = x2 when c2 when c1;
|
||||
tel
|
Loading…
Reference in a new issue