heptagon/test/good/foldi.ept

12 lines
209 B
Plaintext
Raw Normal View History

2010-07-26 09:34:29 +02:00
const n:int=42
fun f(a:bool; i:int; acc_in : bool) returns (acc_out : bool)
let
acc_out = if i = 0 then false else (a & acc_in);
tel
fun g(a: bool^n) returns (o:bool)
let
o = foldi f <<n>>(a, true);
tel