mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-09-11 22:17:18 +03:00
lg2 -> width
This commit is contained in:
parent
58bb7254da
commit
f12f7d82eb
@ -73,7 +73,7 @@ all : {n} (fin n) => [n] -> Bit
|
||||
all xs = xs == ~zero
|
||||
|
||||
// "population count" - how many bits are on
|
||||
popCount : {a,b} (fin a, b >= 1, b == (lg2 a)) => [a] -> [b]
|
||||
popCount : {a,b} (fin a, b >= 1, b == (width a)) => [a] -> [b]
|
||||
popCount bs = ic ! 0 where
|
||||
ic = [0] # [ if elt then prev + 1 else prev | elt <- bs | prev <- ic]
|
||||
|
||||
|
@ -12,7 +12,7 @@ type Board = [7][7]Bit
|
||||
all : {n} (fin n) => [n] -> Bit
|
||||
all xs = xs == ~zero
|
||||
|
||||
popCount : {a,b} (fin a, b >= 1, b == (lg2 a)) => [a] -> [b]
|
||||
popCount : {a,b} (fin a, b >= 1, b == (width a)) => [a] -> [b]
|
||||
popCount bs = ic ! 0 where
|
||||
ic = [0] # [ if elt then prev + 1 else prev | elt <- bs | prev <- ic]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user