cryptol/tests/issues/issue130.cry
Trevor Elliott 28fdd44100 Fix #140
The Smtlib solver was translating Fin constraints to True, as it didn't know
how to handle them.  They should have been skipped, and returned back as
unsolved goals instead.
2014-12-11 15:12:14 -08:00

11 lines
238 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} (fin n) => [n+1] -> Bit
property parOK x = par x == parity x