Skip to content

Commit 4e58800

Browse files
committed
comments
1 parent 9c616e7 commit 4e58800

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

DatapathVerification/CSA.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ def vector_sum {w n : Nat} (v : Vector (BitVec w) n) : BitVec w :=
9898
theorem extract_drop {w n x : Nat} (v : Vector (BitVec w) (n)) (h : x < n) :
9999
(v.extract x)[0] = v[x] := by simp
100100

101-
-- Main correctness theorem for N:2 compressor chain.
101+
/-- Main correctness theorem for N:2 compressor chain.
102+
For a vector of BitVectors, the compressor chain reduces it to a pair (s,t)
103+
such that the sum of all elements in the vector equals s + t <<< 1. -/
102104
theorem chain_correct {w n : Nat} (v : Vector (BitVec w) n) :
103105
let ⟨s, t⟩ := chain v
104106
vector_sum v = s + t <<< 1 := by
@@ -117,7 +119,7 @@ theorem chain_correct {w n : Nat} (v : Vector (BitVec w) n) :
117119
simp
118120
| 2 =>
119121
simp [chain, vector_sum, carrySave]
120-
erw [extract_drop (h := by omega), extract_drop (h := by omega)]
122+
repeat erw [extract_drop (h := by omega)]
121123
rw [carrySaveAdder]
122124
grind
123125
| n + 3 =>

0 commit comments

Comments
 (0)