@@ -20,7 +20,7 @@ variable {α : Type} [Hashable α] [DecidableEq α]
20
20
namespace AIG
21
21
22
22
/--
23
- A circuit node declaration. These are not recursive but instead contain indices into an `AIG`.
23
+ A circuit node declaration. These are not recursive but instead contain indices into an `AIG`, with inputs indexed by `α` .
24
24
-/
25
25
inductive Decl (α : Type ) where
26
26
/--
@@ -95,8 +95,7 @@ structure CacheHit (decls : Array (Decl α)) (decl : Decl α) where
95
95
hvalid : decls[idx]'hbound = decl
96
96
97
97
/--
98
- All indices, found in a `Cache` that is valid with respect to some `decls`, are within bounds of
99
- `decls`.
98
+ For a `c : Cache α decls`, any index `idx` that is a cache hit for some `decl` is within bounds of `decls` (i.e. `idx < decls.size`).
100
99
-/
101
100
theorem Cache.get?_bounds {decls : Array (Decl α)} {idx : Nat} (c : Cache α decls) (decl : Decl α)
102
101
(hfound : c.val[decl]? = some idx) :
@@ -186,7 +185,7 @@ opaque Cache.get? (cache : Cache α decls) (decl : Decl α) : Option (CacheHit d
186
185
| none => none
187
186
188
187
/--
189
- An `Array Decl` is a Direct Acyclic Graph (DAG) if this holds.
188
+ An `Array Decl` is a Direct Acyclic Graph (DAG) if a gate at index `i` only points to nodes with index lower than `i`.
190
189
-/
191
190
def IsDag (α : Type ) (decls : Array (Decl α)) : Prop :=
192
191
∀ i lhs rhs linv rinv (h : i < decls.size),
@@ -366,7 +365,7 @@ scoped syntax "⟦" term ", " term "⟧" : term
366
365
scoped syntax "⟦" term ", " term ", " term "⟧" : term
367
366
368
367
macro_rules
369
- | `(⟦$entry, $assign⟧) => `(denote $assign $entry )
368
+ | `(⟦$entry, $assign⟧) => `(denote $assign $entry)
370
369
| `(⟦$aig, $ref, $assign⟧) => `(denote $assign (Entrypoint.mk $aig $ref))
371
370
372
371
@[app_unexpander AIG.denote]
@@ -376,6 +375,9 @@ def unexpandDenote : Lean.PrettyPrinter.Unexpander
376
375
| `($(_) $entry $assign) => `(⟦$entry, $assign⟧)
377
376
| _ => throw ()
378
377
378
+ /--
379
+ The denotation of the sub-DAG in the `aig` at node `start` is false for all assignments.
380
+ -/
379
381
def UnsatAt (aig : AIG α) (start : Nat) (h : start < aig.decls.size) : Prop :=
380
382
∀ assign, ⟦aig, ⟨start, h⟩, assign⟧ = false
381
383
0 commit comments