úÎF°AG      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFIago Abal <iago.abal@gmail.com>NoneG An alias for .  Big-endian pseudo size-polymorphic bit-vectors. The size of a bit-vector. 0The value of a bit-vector, as a natural number.  An alias for .  An alias for . 2'$s complement value of a bit-vector. 7Create a bit-vector given a size and an integer value.  bitVec 4 3[4]3,This function also handles negative values.  bitVec 4 (-1)[4]15Create a mask of ones. Create a mask of zeros. >Test if the signed value of a bit-vector is a natural number. ?Test if the signed value of a bit-vector is a positive number. Fixed-size equality. In contrast with G , which is size-polymorphic, this equality 0 requires both bit-vectors to be of equal size.  [n]k ==. [m]kFalse [n]k ==. [n]kTrue Fixed-size inequality. The negated version of  .  Fixed-size  less-than.  Fixed-size less-than-or-equals.  Fixed-size  greater-than.  Fixed-size greater-than-or-equals. Fixed-size signed  less-than. Fixed-size signed less-than-or-equals. Fixed-size signed  greater-than. Fixed-size signed greater-than-or-equals. Bit indexing. u @. i stands for the i -th bit of u.  [4]2 @. 0False [4]2 @. 1True index i a == a @. iBit-string extraction.  u @@ (j,i) == fromBits (map (u @ .) [j,j-1..i]) [4]7 @@ (3,1)[3]3 extract j i a == a @@ (j,i)Reverse bit-indexing. .Index starting from the most significant bit.   u !. i == u @. (size u - i - 1) [3]3 !. 0FalseTake least significant bits. least m u == u @@ (m-1,0)Take most significant bits. most m u == u @@ (n-1,n-m)Most significant bit. msb u == u !. 0Least significant bit.  lsb u == u @. 0Most significant 1-bit. Pre: input must be non-zero.  msb1 [4]21 msb1 [4]42  Bit-vector H as an I. !2's complement signed division. "2'7s complement signed remainder (sign follows dividend). #2'6s complement signed remainder (sign follows divisor). $Ceiling logarithm base 2. Pre%: input bit-vector must be non-zero. %"Concatenation of two bit-vectors. &"Concatenation of two bit-vectors. 'Logical extension. zeroExtend 3 [1]1[4]1(Arithmetic extension. signExtend 2 [2]1[4]1signExtend 2 [2]3[4]15) %foldl_ f z (fromBits [un, ..., u1, u0] ) == ((((z `f` un) `f` ...) `f` u1) `f` u0) *foldl_ f e = fromBits . foldl f e . toBits* %foldr_ f z (fromBits [un, ..., u1, u0]) == un `f` (... `f` (u1 `f` (u0 `f` z))) *foldr_ f e = fromBits . foldr f e . toBits+ 'reverse_ == fromBits . reverse . toBits,Pre: if replicate_ n u then n > 0 must hold. 8replicate_ n == fromBits . concat . replicate n . toBits- Conjunction. and_ == foldr1 (.&.). Disjunction. or_ == foldr1 (.|.)/Split a bit-vector k times.  split 3 [4]15[[2]0,[2]3,[2]3]0Split a bit-vector into n-wide pieces. group_ 3 [4]15 [[3]1,[3]7]1#Concatenate a list of bit-vectors. join [[2]3,[2]2][4]142 An alias for J. 3Negated K. 4Negated L. 5Negated M. 6 Left shift. 7 Left shift. 8Logical right shift. 9Logical right shift. :Arithmetic right shift ; Rotate left. < Rotate left. =Rotate right. >Rotate right. ?'Create a bit-vector from a single bit. @4Create a bit-vector from a big-endian list of bits. fromBits [False, False, True][3]1A4Create a big-endian list of bits from a bit-vector.  toBits [4]11[True, False, True, True]B"Show a bit-vector in binary form. C!Show a bit-vector in octal form. D'Show a bit-vector in hexadecimal form. E+Greatest natural number representable with n bits. FCMinimum width of a bit-vector to represent a given integer number.  integerWith 43integerWith (-4)4TN  !"#$%&'()*+,-./0O123456789:;<=>?@ABPCDEFQRSTUVWXYZ_[\]^_`abcdefghijklmJMLKn  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFI  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFQN  !"#$%&'()*+,-./0O123456789:;<=>?@ABPCDEFQRSTUVWXYZo      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNLOPLQRLQSLQTLQUVWXYZ[\]^_`aLQbLQcLQdLQeLQfLQgLQhLQiLQjLQkLQlLQmLQnLQoLQpLQqLQrLQsLQtLQuvbv-0.2.2Data.BitVector BitVectorBVsizenatwidthuintintbitVeconeszerosisNatisPos==./=.<.<=.>.>=.sltslesgtsge@.index@@extract!.leastmostmsblsbmsb1signumIsdivsremsmodlg2#cat zeroExtend signExtendfoldl_foldr_reverse_ replicate_and_or_splitgroup_joinnot_nandnorxnor<<.shl>>.shrashr<<<.rol>>>.rorfromBoolfromBitstoBitsshowBinshowOctshowHexmaxNat integerWidthghc-prim GHC.Classes==baseGHC.NumsignumGHC.RealIntegral Data.Bits complement.&..|.xor splitIntegerhexChar$fBitsBV $fIntegralBV$fEnumBV$fRealBV$fNumBV$fOrdBV$fEqBV$fDataBV $fTypeableBV$fShowBVpopCountDefaulttestBitDefault bitDefaultpopCountrotateRrotateL unsafeShiftRshiftR unsafeShiftLshiftLisSignedbitSizetestBit complementBitclearBitsetBitbitrotateshiftBits