let
bitv2nat b =
Bitv
.fold_right
(
fun
x acc
->
if
x
then
2 * acc + 1
else
2 * acc)
b 0