Added some main in tests

Goal: run as many nodes as possible
This commit is contained in:
Gwenal Delaval 2012-07-16 18:49:08 +02:00
parent 40cf503149
commit 891b1f3ffd
10 changed files with 112 additions and 10 deletions

View file

@ -30,4 +30,20 @@ let
unless (not r1) then IDLE0
end;
tel
tel
node main() returns (g0,g1:bool)
var r0,r1:bool;
let
r0 = false fby not r0;
r1 = false fby false fby true fby r1;
(g0,g1) = alloc(r0,r1);
tel
(* CHECK main_assert *)
node main_assert() returns (ok:bool)
var g0,g1:bool;
let
(g0,g1) = main();
ok = not (g0 & g1);
tel

View file

@ -43,7 +43,12 @@ let
tel
node main() returns (r :int)
node elt_trunc (a:int^m^m; i,j:int) returns (o : int)
let
o = a[>i<][>j<];
tel
node main() returns (i,j,r,o,o1 :int;t1:int^4)
var x,y : int^10; z,t : int^20; r1,r2 :int^3;
let
x = ten(3);
@ -51,9 +56,10 @@ let
(z,t) = concatenate(x,y);
(r1,r2) = slicing(x);
r = r1[>0<];
i = 0 -> pre if i > 13 then 0 else i + 1;
j = 0 -> pre if j > 23 then 0 else j + 1;
o = (upd_dyn(elt(x),j))[>i<] + (elt_dyn(y,i))[>1<];
t1 = [ constant(12,13) with [i] = 5];
o1 = elt_trunc((elt_dyn(ten(6),i))^m,1,j);
tel
node elt_trunc (a:int^m^m; i,j:int) returns (o : int)
let
o = a[>i<][>j<];
tel

View file

@ -17,3 +17,25 @@ var acc:int;
let
(o, acc) = mapfold<<n>> sumdup (a, 0);
tel
node main() returns (o:int^n)
var last t:int^n = 1^n;
let
automaton
state Prepare
var i,x1,x2:int;
do
i = 0 fby i + 1;
x1 = (last t).[i-2] default 0;
x2 = (last t).[i-1] default 1;
t = [ (last t) with [i] = x1 + x2 ];
o = p(t);
until i = 43 then Compute
state Compute
var i,j:int;
do
i = 0 fby if i > 43 then 0 else i + 1;
j = 0 fby if j > 1031 then 0 else j + 1;
o = p([ t with [i] = j ]);
end
tel

View file

@ -59,3 +59,16 @@ node itmapi(a:int^n) returns (o:int^n)
let
o = mapi <<n>> m<(a)>(a);
tel
node main() returns (t1,t2,t3,t4,t5,t6:int^n;x1:int)
var r:bool;
let
t1 = f();
t2 = g(t1);
x1 = h(t2);
t3 = p(t2);
t4 = k(t1,t3);
r = false fby false fby true fby r;
t5 = iter_reset(t4,r);
t6 = itmapi(t5);
tel

View file

@ -9,3 +9,15 @@ let
m = fold<<n,n2>> sum_acc (a, 0);
tel
node main() returns (m:int)
var x1,x2,x3,x4,x5,x6:int;t:int^2^3;
let
m = h<<2,3>>(t);
t = [[x1,x2],[x3,x4],[x5,x6]];
x1 = 0 fby if x1 > 53 then 0 else x1 + 2;
x2 = 0 fby if x2 > 15 then 0 else x2 + 1;
x3 = 0 fby if x3 > 42 then 0 else x3 + 3;
x4 = 0 fby if x4 > 17 then 0 else x4 + 6;
x5 = 0 fby if x5 > 87 then 0 else x5 + 4;
x6 = 0 fby if x6 > 47 then 0 else x6 + 2;
tel

View file

@ -5,10 +5,19 @@ tel
node plus_tab(a: int^2^10) returns (o:int^2^10)
let
o = a
o = [ a with [a[2][1]] = (a[2][0] + 1)^2 ]
tel
node g() returns (o:int^2^10^3^4)
let
o = map<<3,4>> plus_tab (2^2^10^3^4);
tel
tel
node main() returns (o:int^2^10^3)
var i:int;t:int^2^10^3^4;
let
i = 0 fby if i = 4 then 0 else i + 1;
o = t[>i<];
t = map<<3,4>> plus_tab ((g()) fby t)
tel

View file

@ -10,3 +10,11 @@ let
end;
o = merge b (true-> o2) (false -> false)
tel
node main() returns (o:bool)
var b:bool;
let
b = true fby true fby false fby b;
o = updown(b);
tel

View file

@ -3,3 +3,10 @@ let
y = (x :: .) when c;
tel
node main() returns (y:int)
var x:int;c:bool;
let
x = 0 fby x + 1;
c = true fby true fby false fby true fby c;
y = merge c (f(x,c)) 0;
tel

View file

@ -4,10 +4,12 @@ let
y = x when c;
tel
node main(x:int) returns (z:int)
var y,t : int; c : bool;
node main() returns (z:int)
var x,y,t : int; c : bool;
let
x = -5 fby x + 1;
y = 0 fby (y+1);
(t,c) = cross<<4>>(x);
z = merge c (true -> y + t) (false -> 0)
tel

View file

@ -2,3 +2,10 @@ node f(x:bool) returns (y:bool)
let
y = x when x
tel
node main() returns (y:bool)
var c:bool;
let
c = true fby true fby false fby c;
y = merge c (f(c)) false;
tel