cryptol/tests/regression/r01.cry

11 lines
363 B
Plaintext
Raw Normal View History

2014-04-18 02:34:25 +04:00
any : {n, a} (fin n) => (a -> Bit) -> [n]a -> Bit
any f xs = [ f x | x <- xs ] != zero
all : {n, a} (fin n) => (a -> Bit) -> [n]a -> Bit
all f xs = [ f x | x <- xs ] == ~zero
// all ltTen [0 .. 9] where ltTen x = x < 10
// all ltTen [0 .. 10] where ltTen x = x < 10
// any ltTen [100 .. 10] where ltTen x = x < 10
// any ltTen [100 .. 9] where ltTen x = x < 10