mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-15 02:01:39 +03:00
37f9dc4c4f
Fixes #78.
7 lines
285 B
Plaintext
7 lines
285 B
Plaintext
unique : {a,b} (fin a, fin b, a>=1) => [a][b] -> Bit
|
|
unique xs = [ exist x (i+1) | x <- xs | i <- [0..(a-1)] ] == 0
|
|
where exist : [b] -> [width a] -> Bit
|
|
exist x i = if(i>=`a) then False
|
|
else if(x==(xs@i)) then True
|
|
else exist x (i+1)
|