mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-17 13:01:31 +03:00
11 lines
227 B
Plaintext
11 lines
227 B
Plaintext
parity xs = ys!0
|
|
where ys = [False] # [y ^ x | x <- xs | y <- ys ]
|
|
|
|
foldl1 f xs = ys!0
|
|
where ys = [xs@0] # [ f y x | y <- ys | x <- tail xs ]
|
|
|
|
par = foldl1 (^)
|
|
|
|
parOK : {n} [n+1] -> Bit
|
|
property parOK x = par x == parity x
|