Documentation

Std.Tactic.BVDecide.Normalize.BitVec

This module contains the BitVec simplifying part of the bv_normalize simp set.

theorem Std.Tactic.BVDecide.Normalize.BitVec.sdiv_udiv {w : Nat} (x y : BitVec w) :
x.sdiv y = if x.msb = true then if y.msb = true then -x / -y else -(-x / y) else if y.msb = true then -(x / -y) else x / y
theorem Std.Tactic.BVDecide.Normalize.BitVec.smod_umod {w : Nat} (x y : BitVec w) :
x.smod y = if x.msb = true then if y.msb = true then -(-x).umod (-y) else let u := (-x).umod y; if u = 0#w then u else y - u else if y.msb = true then let u := x.umod (-y); if u = 0#w then u else u + y else x.umod y
theorem Std.Tactic.BVDecide.Normalize.BitVec.smtSDiv_smtUDiv {w : Nat} (x y : BitVec w) :
x.smtSDiv y = if x.msb = true then if y.msb = true then (-x).smtUDiv (-y) else -(-x).smtUDiv y else if y.msb = true then -x.smtUDiv (-y) else x.smtUDiv y
theorem Std.Tactic.BVDecide.Normalize.BitVec.srem_umod {w : Nat} (x y : BitVec w) :
x.srem y = if x.msb = true then if y.msb = true then -(-x % -y) else -(-x % y) else if y.msb = true then x % -y else x % y
theorem Std.Tactic.BVDecide.Normalize.BitVec.getElem_eq_getLsbD {w : Nat} (a : BitVec w) (i : Nat) (h : i < w) :
a[i] = a.getLsbD i
theorem Std.Tactic.BVDecide.Normalize.BitVec.add_const_left {w : Nat} (a b c : BitVec w) :
a + (b + c) = a + b + c
theorem Std.Tactic.BVDecide.Normalize.BitVec.add_const_right {w : Nat} (a b c : BitVec w) :
a + (b + c) = a + c + b
theorem Std.Tactic.BVDecide.Normalize.BitVec.zero_ult' {w : Nat} (a : BitVec w) :
(0#w).ult a = (a != 0#w)
theorem Std.Tactic.BVDecide.Normalize.BitVec.udiv_ofNat_eq_of_lt (w : Nat) (x : BitVec w) (n k : Nat) (hk : 2 ^ k = n) (hlt : k < w) :
x / BitVec.ofNat w n = x >>> k

x / (BitVec.ofNat n) where n = 2^k is the same as shifting x right by k.