heptagon/test/good/array_iterators2.ept
Gwenal Delaval 891b1f3ffd Added some main in tests
Goal: run as many nodes as possible
2012-07-16 18:49:08 +02:00

24 lines
569 B
Plaintext

node sum_acc (a, acc_in:int) returns (acc_out:int)
let
acc_out = acc_in + a;
tel
node h<<n, n2 :int>>(a:int^n^n2) returns (m:int)
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