We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5df00af commit e780c2fCopy full SHA for e780c2f
1 file changed
DatapathVerification/CSA.lean
@@ -86,6 +86,7 @@ def chain {w n : Nat} (v : Vector (BitVec w) n) : CSAResult w :=
86
theorem b1_add_b2_eq_add_zero {w : Nat} (b1 b2 : BitVec w) : b1 + b2 = b1 + b2 + 0 := by
87
simp only [BitVec.ofNat_eq_ofNat, BitVec.add_zero]
88
89
+-- Sum all elements of a vector of BitVectors.
90
def vector_sum {w n : Nat} (v : Vector (BitVec w) n) : BitVec w :=
91
match n with
92
| 0 => 0
@@ -100,6 +101,7 @@ theorem vector_sum_cast {w n m : Nat} (h : n = m) (v : Vector (BitVec w) n) :
100
101
subst h
102
rfl
103
104
+-- Main correctness theorem for N:2 compressor chain.
105
theorem chain_correct {w n : Nat} (v : Vector (BitVec w) n) :
106
let ⟨s, t⟩ := chain v
107
vector_sum v = s + t <<< 1 := by
0 commit comments