MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / test_shift_left_right

Method test_shift_left_right

tests/test_z3_ported.py:709–714  ·  view source on GitHub ↗

(x << 2) >> 2 masks top bits (logical shift).

(self, kernel)

Source from the content-addressed store, hash-verified

707 assert prove(claim)
708
709 def test_shift_left_right(self, kernel):
710 """(x << 2) >> 2 masks top bits (logical shift)."""
711 x = BitVec("x", 8)
712 # Logical shift: LShR(x << 2, 2) == x & 0x3F
713 claim = ForAll([x], LShR(x << 2, 2) == (x & BitVecVal(0x3F, 8)))
714 assert prove(claim)
715
716 def test_rotate_left_right_inverse(self, kernel):
717 """RotateRight(RotateLeft(x, 3), 3) == x."""

Callers

nothing calls this directly

Calls 5

BitVecFunction · 0.90
ForAllFunction · 0.90
LShRFunction · 0.90
BitVecValFunction · 0.90
proveFunction · 0.90

Tested by

no test coverage detected