Documentation

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

This module contains the verification of the bitblasters for BitVec.shiftLeft from Impl.Operations.ShiftLeft.

@[irreducible]
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftLeftConst.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.blastShiftLeftConst.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.blastShiftLeftConst.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 } }⟧
@[irreducible]
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftLeftConst.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 : idx < distance then false else ⟦assign, { aig := aig, ref := input.get (idx - distance) ⋯ }⟧
@[simp]
theorem Std.Tactic.BVDecide.BVExpr.bitblast.denote_blastShiftLeftConst {α : Type} [Hashable α] [DecidableEq α] {w : Nat} (aig : Sat.AIG α) (target : aig.ShiftTarget w) (assign : α → Bool) (idx : Nat) (hidx : idx < w) :
⟦assign, { aig := (blastShiftLeftConst aig target).aig, ref := (blastShiftLeftConst aig target).vec.get idx hidx }⟧ = if hidx : idx < target.distance then false else ⟦assign, { aig := aig, ref := target.vec.get (idx - target.distance) ⋯ }⟧
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftLeft.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
@[irreducible]
theorem Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftLeft.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.shiftLeftRec 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.shiftLeftRec rhs (n - 1)).getLsbD idx
theorem Std.Tactic.BVDecide.BVExpr.bitblast.denote_blastShiftLeft {α : 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 := (blastShiftLeft aig target).aig, ref := (blastShiftLeft aig target).vec.get idx hidx }⟧ = (lhs <<< rhs).getLsbD idx