Documentation

Std.Tactic.BVDecide.Bitblast.BVExpr.Circuit.Lemmas.Operations.ShiftRight

This module contains the verification of the bitblasters for BitVec.shiftRight from Impl.Operations.ShiftRight.

theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftRightConst.go_get_aux {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (distance : Nat) (input : aig.RefVec w) (curr : Nat) (hcurr : curr ≤ w) (s : aig.RefVec curr) (idx : Nat) (hidx : idx < curr) (hfoo : aig.decls.size ≤ (go aig input distance curr hcurr s).aig.decls.size) :
(go aig input distance curr hcurr s).vec.get idx ⋯ = (s.get idx hidx).cast hfoo
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftRightConst.go_get {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (distance : Nat) (input : aig.RefVec w) (curr : Nat) (hcurr : curr ≤ w) (s : aig.RefVec curr) (idx : Nat) (hidx : idx < curr) :
(go aig input distance curr hcurr s).vec.get idx ⋯ = (s.get idx hidx).cast ⋯
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftRightConst.go_denote_mem_prefix {α : Type} [Hashable α] [DecidableEq α] {w : Nat} {assign : α → Bool} {inv : Bool} (aig : Sat.AIG α) (distance : Nat) (input : aig.RefVec w) (curr : Nat) (hcurr : curr ≤ w) (s : aig.RefVec curr) (start : Nat) (hstart : start < aig.decls.size) :
⟦assign, { aig := (go aig input distance curr hcurr s).aig, ref := { gate := start, invert := inv, hgate := ⋯ } }⟧ = ⟦assign, { aig := aig, ref := { gate := start, invert := inv, hgate := hstart } }⟧
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftRightConst.go_denote_eq {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (distance : Nat) (input : aig.RefVec w) (assign : α → Bool) (curr : Nat) (hcurr : curr ≤ w) (s : aig.RefVec curr) (idx : Nat) (hidx1 : idx < w) :
curr ≤ idx → ⟦assign, { aig := (go aig input distance curr hcurr s).aig, ref := (go aig input distance curr hcurr s).vec.get idx hidx1 }⟧ = if hidx : distance + idx < w then ⟦assign, { aig := aig, ref := input.get (distance + idx) hidx }⟧ else false
@[simp]
theorem Std.Tactic.BVDecide.BVExpr.bitblast.denote_blastShiftRightConst {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (target : aig.ShiftTarget w) (assign : α → Bool) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (blastShiftRightConst aig target).aig, ref := (blastShiftRightConst aig target).vec.get idx hidx }⟧ = if hidx : target.distance + idx < w then ⟦assign, { aig := aig, ref := target.vec.get (target.distance + idx) hidx }⟧ else false
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastArithShiftRightConst.go_get {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (distance : Nat) (input : aig.RefVec w) (curr : Nat) (hcurr : curr ≤ w) (s : aig.RefVec curr) (idx : Nat) (hidx : idx < curr) :
(go input distance curr hcurr s).get idx ⋯ = s.get idx hidx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastArithShiftRightConst.go_denote_eq {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (distance : Nat) (input : aig.RefVec w) (assign : α → Bool) (curr : Nat) (hcurr : curr ≤ w) (s : aig.RefVec curr) (idx : Nat) (hidx1 : idx < w) :
curr ≤ idx → ⟦assign, { aig := aig, ref := (go input distance curr hcurr s).get idx hidx1 }⟧ = if hidx : distance + idx < w then ⟦assign, { aig := aig, ref := input.get (distance + idx) hidx }⟧ else ⟦assign, { aig := aig, ref := input.get (w - 1) ⋯ }⟧
@[simp]
theorem Std.Tactic.BVDecide.BVExpr.bitblast.denote_blastArithShiftRightConst {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (target : aig.ShiftTarget w) (assign : α → Bool) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (blastArithShiftRightConst aig target).aig, ref := (blastArithShiftRightConst aig target).vec.get idx hidx }⟧ = if hidx : target.distance + idx < w then ⟦assign, { aig := aig, ref := target.vec.get (target.distance + idx) hidx }⟧ else ⟦assign, { aig := aig, ref := target.vec.get (w - 1) ⋯ }⟧
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftRight.twoPowShift_eq {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (target : TwoPowShiftTarget aig w) (lhs : BitVec w) (rhs : BitVec target.n) (assign : α → Bool) (hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦assign, { aig := aig, ref := target.lhs.get idx hidx }⟧ = lhs.getLsbD idx) (hright : ∀ (idx : Nat) (hidx : idx < target.n), ⟦assign, { aig := aig, ref := target.rhs.get idx hidx }⟧ = rhs.getLsbD idx) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (twoPowShift aig target).aig, ref := (twoPowShift aig target).vec.get idx hidx }⟧ = (lhs >>> (rhs &&& BitVec.twoPow target.n target.pow)).getLsbD idx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftRight.go_denote_eq {α : Type} [Hashable α] [DecidableEq α] {n w : Nat} (aig : Sat.AIG α) (distance : aig.RefVec n) (curr : Nat) (hcurr : curr ≤ n - 1) (acc : aig.RefVec w) (lhs : BitVec w) (rhs : BitVec n) (assign : α → Bool) (hacc : ∀ (idx : Nat) (hidx : idx < w), ⟦assign, { aig := aig, ref := acc.get idx hidx }⟧ = (lhs.ushiftRightRec rhs curr).getLsbD idx) (hright : ∀ (idx : Nat) (hidx : idx < n), ⟦assign, { aig := aig, ref := distance.get idx hidx }⟧ = rhs.getLsbD idx) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (go aig distance curr acc).aig, ref := (go aig distance curr acc).vec.get idx hidx }⟧ = (lhs.ushiftRightRec rhs (n - 1)).getLsbD idx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.denote_blastShiftRight {α : Type} [Hashable α] [DecidableEq α] {w0 : Nat} (aig : Sat.AIG α) (target : aig.ArbitraryShiftTarget w0) (lhs : BitVec w0) (rhs : BitVec target.n) (assign : α → Bool) (hleft : ∀ (idx : Nat) (hidx : idx < w0), ⟦assign, { aig := aig, ref := target.target.get idx hidx }⟧ = lhs.getLsbD idx) (hright : ∀ (idx : Nat) (hidx : idx < target.n), ⟦assign, { aig := aig, ref := target.distance.get idx hidx }⟧ = rhs.getLsbD idx) (idx : Nat) (hidx : idx < w0) :
⟦assign, { aig := (blastShiftRight aig target).aig, ref := (blastShiftRight aig target).vec.get idx hidx }⟧ = (lhs >>> rhs).getLsbD idx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastArithShiftRight.twoPowShift_eq {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (target : TwoPowShiftTarget aig w) (lhs : BitVec w) (rhs : BitVec target.n) (assign : α → Bool) (hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦assign, { aig := aig, ref := target.lhs.get idx hidx }⟧ = lhs.getLsbD idx) (hright : ∀ (idx : Nat) (hidx : idx < target.n), ⟦assign, { aig := aig, ref := target.rhs.get idx hidx }⟧ = rhs.getLsbD idx) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (twoPowShift aig target).aig, ref := (twoPowShift aig target).vec.get idx hidx }⟧ = (lhs.sshiftRight' (rhs &&& BitVec.twoPow target.n target.pow)).getLsbD idx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastArithShiftRight.go_denote_eq {α : Type} [Hashable α] [DecidableEq α] {n w : Nat} (aig : Sat.AIG α) (distance : aig.RefVec n) (curr : Nat) (hcurr : curr ≤ n - 1) (acc : aig.RefVec w) (lhs : BitVec w) (rhs : BitVec n) (assign : α → Bool) (hacc : ∀ (idx : Nat) (hidx : idx < w), ⟦assign, { aig := aig, ref := acc.get idx hidx }⟧ = (lhs.sshiftRightRec rhs curr).getLsbD idx) (hright : ∀ (idx : Nat) (hidx : idx < n), ⟦assign, { aig := aig, ref := distance.get idx hidx }⟧ = rhs.getLsbD idx) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (go aig distance curr acc).aig, ref := (go aig distance curr acc).vec.get idx hidx }⟧ = (lhs.sshiftRightRec rhs (n - 1)).getLsbD idx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.denote_blastArithShiftRight {α : Type} [Hashable α] [DecidableEq α] {w0 : Nat} (aig : Sat.AIG α) (target : aig.ArbitraryShiftTarget w0) (lhs : BitVec w0) (rhs : BitVec target.n) (assign : α → Bool) (hleft : ∀ (idx : Nat) (hidx : idx < w0), ⟦assign, { aig := aig, ref := target.target.get idx hidx }⟧ = lhs.getLsbD idx) (hright : ∀ (idx : Nat) (hidx : idx < target.n), ⟦assign, { aig := aig, ref := target.distance.get idx hidx }⟧ = rhs.getLsbD idx) (idx : Nat) (hidx : idx < w0) :
⟦assign, { aig := (blastArithShiftRight aig target).aig, ref := (blastArithShiftRight aig target).vec.get idx hidx }⟧ = (lhs.sshiftRight' rhs).getLsbD idx