Skip to content

Commit e780c2f

Browse files
committed
add comments
1 parent 5df00af commit e780c2f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

DatapathVerification/CSA.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def chain {w n : Nat} (v : Vector (BitVec w) n) : CSAResult w :=
8686
theorem b1_add_b2_eq_add_zero {w : Nat} (b1 b2 : BitVec w) : b1 + b2 = b1 + b2 + 0 := by
8787
simp only [BitVec.ofNat_eq_ofNat, BitVec.add_zero]
8888

89+
-- Sum all elements of a vector of BitVectors.
8990
def vector_sum {w n : Nat} (v : Vector (BitVec w) n) : BitVec w :=
9091
match n with
9192
| 0 => 0
@@ -100,6 +101,7 @@ theorem vector_sum_cast {w n m : Nat} (h : n = m) (v : Vector (BitVec w) n) :
100101
subst h
101102
rfl
102103

104+
-- Main correctness theorem for N:2 compressor chain.
103105
theorem chain_correct {w n : Nat} (v : Vector (BitVec w) n) :
104106
let ⟨s, t⟩ := chain v
105107
vector_sum v = s + t <<< 1 := by

0 commit comments

Comments
 (0)