1- import Std.Sat.AIG.Basic
2- import Std.Sat.AIG.Cached
3- import Std.Sat.AIG.CachedGates
4- import Std.Sat.AIG.CachedLemmas
5- import Std.Sat.AIG.CachedGatesLemmas
1+ module
62
7- namespace Valaig.Aig
3+ public import Std.Sat.AIG.Basic
4+ public import Std.Sat.AIG.Cached
5+ public import Std.Sat.AIG.CachedGates
6+ public import Std.Sat.AIG.CachedLemmas
7+ public import Std.Sat.AIG.CachedGatesLemmas
8+
9+ public section
10+ namespace Valaig.Aig.Std
811
912open Std.Sat AIG
1013
@@ -25,14 +28,14 @@ theorem mkAtom_size (aig : AIG α) (var : α) :
2528 simp only [mkAtom_eq_decls_push, Array.size_push]
2629
2730/--
28- `AIG.mkAtom` returns a reference to the next element in the underlying AIG
31+ `AIG.mkAtom` returns a reference to the next element in the underlying AIG.
2932-/
3033theorem mkAtom_ref_eq_decls_size (aig : AIG α) (var : α) :
3134 (aig.mkAtom var).ref.gate = aig.decls.size := by
3235 simp only [mkAtom]
3336
3437/--
35- - `AIG.mkGate` only potentially appends gates, not atoms/constants
38+ `AIG.mkGate` only potentially appends gates, not atoms/constants.
3639-/
3740theorem mkGate_matches_gate (aig : AIG α) {input : aig.BinaryInput} {idx : Nat}
3841 {hlow : idx ≥ aig.decls.size} {hhigh : idx < (aig.mkGate input).aig.decls.size} :
@@ -44,7 +47,7 @@ theorem mkGate_matches_gate (aig : AIG α) {input : aig.BinaryInput} {idx : Nat}
4447 exact Nat.eq_of_le_of_lt_succ hlow hhigh
4548 simp [←hres, heq]
4649
47- theorem mkGateCached.go_matches_gate (aig : AIG α) {input : aig.BinaryInput} {idx : Nat}
50+ private theorem mkGateCached.go_matches_gate (aig : AIG α) {input : aig.BinaryInput} {idx : Nat}
4851 {hlow : idx ≥ aig.decls.size} {hhigh : idx < (mkGateCached.go aig input).aig.decls.size} :
4952 ∃ (lhs rhs : Fanin), (mkGateCached.go aig input).aig.decls[idx] = .gate lhs rhs := by
5053 generalize hres : (mkGateCached.go aig input).aig.decls = res at *
@@ -56,7 +59,7 @@ theorem mkGateCached.go_matches_gate (aig : AIG α) {input : aig.BinaryInput} {i
5659 · grind only [Array.getElem_push]
5760
5861/--
59- - `AIG.mkGateCached` only potentially appends gates, not atoms/constants
62+ `AIG.mkGateCached` only potentially appends gates, not atoms/constants.
6063-/
6164theorem mkGateCached_matches_gate (aig : AIG α) {input : aig.BinaryInput} {idx : Nat}
6265 {hlow : idx ≥ aig.decls.size} {hhigh : idx < (aig.mkGateCached input).aig.decls.size} :
@@ -65,11 +68,11 @@ theorem mkGateCached_matches_gate (aig : AIG α) {input : aig.BinaryInput} {idx
6568 split <;> apply mkGateCached.go_matches_gate <;> trivial
6669
6770/--
68- - `AIG.mkAndCached` only potentially appends gates, not atoms/constants
71+ `AIG.mkAndCached` only potentially appends gates, not atoms/constants.
6972-/
7073theorem mkAndCached_matches_gate (idx : Nat) (aig : AIG α) (input : aig.BinaryInput)
7174 {hlow : idx ≥ aig.decls.size} {hhigh : idx < (aig.mkAndCached input).aig.decls.size} :
7275 ∃ (lhs rhs : Fanin), (aig.mkAndCached input).aig.decls[idx] = .gate lhs rhs := by
7376 simp_all only [mkAndCached, mkGateCached_matches_gate]
7477
75- end Valaig.Aig
78+ end Valaig.Aig.Std
0 commit comments