theorem
HackersDelight.Ch2Basics.or_ule_add
{x : BitVec 32}
{y : BitVec 32}
(h : HackersDelight.Ch2Basics.AdditionNoOverflows? x y)
:
Equations
- HackersDelight.Ch2Basics.instHXorBool_sSA = { hXor := xor }
Instances For
Equations
- HackersDelight.Ch2Basics.last32Bits x = BitVec.ofNat 32 x.toNat
Instances For
Equations
- HackersDelight.Ch2Basics.first32Bits x = BitVec.ofNat 32 (x >>> 32).toNat
Instances For
theorem
HackersDelight.Ch2Basics.unsigned_mul_overflow_iff_mul_neq_zero
{x : BitVec 64}
{y : BitVec 64}
:
theorem
HackersDelight.Ch2Basics.signed_mul_overflow_iff_mul_neq_mul_RightShift
{x : BitVec 64}
{y : BitVec 64}
:
theorem
HackersDelight.Ch2Basics.mul_div_neq_imp_unsigned_mul_overflow
{x : BitVec 32}
{y : BitVec 32}
{z : BitVec 32}
(h : y.toNat ≠ 0)
:
x * y / z ≠ x → HackersDelight.Ch2Basics.UnsignedMultiplicationOverflows? x y
Equations
Instances For
def
HackersDelight.Ch2Basics.numberOfLeadingZeros.countLeadingZeros
{w : ℕ}
(x : BitVec w)
(i : ℕ)
(count : ℕ)
:
Equations
- One or more equations did not get rendered due to their size.
- HackersDelight.Ch2Basics.numberOfLeadingZeros.countLeadingZeros x Nat.zero count = count
Instances For
theorem
HackersDelight.Ch2Basics.div_overflow_iff_neq_and_ult_LeftShift
{x : BitVec 64}
{y : BitVec 32}
:
HackersDelight.Ch2Basics.SignedDivisionOverflows?? x (BitVec.zeroExtend 64 y) ↔ y ≠ 0 ∧ x < BitVec.zeroExtend 64 y <<< 32
theorem
HackersDelight.Ch2Basics.div_overflow_iff_neq_and_RightShift_lt
{x : BitVec 64}
{y : BitVec 64}
{y : BitVec 32}
:
HackersDelight.Ch2Basics.SignedDivisionOverflows?? x (BitVec.zeroExtend 64 y) ↔ y ≠ 0 ∧ x >>> 32 < BitVec.zeroExtend 64 y
Equations
- HackersDelight.Ch2Basics.leBitmask x y = if y ≤ x then -1#w else 0#w
Instances For
theorem
HackersDelight.Ch2Basics.signed_max_xor_and_bitmask_xor
{x : BitVec 32}
{y : BitVec 32}
:
HackersDelight.Ch2Basics.signedMaxBitVec x y = (x ^^^ y) &&& HackersDelight.Ch2Basics.leBitmask x y ^^^ y
theorem
HackersDelight.Ch2Basics.signed_min_xor_and_bitmask_xor
{x : BitVec 32}
{y : BitVec 32}
:
HackersDelight.Ch2Basics.signedMinBitVec x y = (x ^^^ y) &&& HackersDelight.Ch2Basics.leBitmask y x ^^^ y
Equations
- HackersDelight.Ch2Basics.carryBitmask x y = if BitVec.carry w x (~~~y) false = true then -1#w else 0#w
Instances For
theorem
HackersDelight.Ch2Basics.unsigned_max_eq_sub_sub_and_carry
{x : BitVec 32}
{y : BitVec 32}
:
theorem
HackersDelight.Ch2Basics.unsigned_min_eq_add_sub_and_carry
{x : BitVec 32}
{y : BitVec 32}
:
theorem
HackersDelight.Ch2Basics.lt_sdoz_or_neg_sdoz
{x : BitVec 32}
{y : BitVec 32}
:
(x >ₛ y) = true ↔ (HackersDelight.Ch2Basics.signedDifferenceOrZero x y ||| -HackersDelight.Ch2Basics.signedDifferenceOrZero x y).msb = true
theorem
HackersDelight.Ch2Basics.carry_iff_udoz_not_or_neg_udoz_not
{x : BitVec 32}
{y : BitVec 32}
{w : ℕ}
: