Theorem: AIG.denote_mkConst_cached (LeanSAT/AIG/CachedLemmas.lean)

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
⊢ aig.cache.find? (Decl.const b) = some hit →
    ⟦{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }, assign⟧ = ⟦aig.mkConst b, assign⟧
Tactic:
have := hit.hvalid
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
this : aig.decls[hit.idx] = Decl.const b
⊢ aig.cache.find? (Decl.const b) = some hit →
    ⟦{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }, assign⟧ = ⟦aig.mkConst b, assign⟧

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
this : aig.decls[hit.idx] = Decl.const b
⊢ aig.cache.find? (Decl.const b) = some hit →
    ⟦{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }, assign⟧ = ⟦aig.mkConst b, assign⟧
Tactic:
simp only [denote_mkConst]
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
this : aig.decls[hit.idx] = Decl.const b
⊢ aig.cache.find? (Decl.const b) = some hit → ⟦{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }, assign⟧ = b

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
this : aig.decls[hit.idx] = Decl.const b
⊢ aig.cache.find? (Decl.const b) = some hit → ⟦{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }, assign⟧ = b
Tactic:
unfold denote denote.go
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
this : aig.decls[hit.idx] = Decl.const b
⊢ aig.cache.find? (Decl.const b) = some hit →
    (match elem :
        { aig := aig,
                ref :=
                  { gate := hit.idx,
                    hgate := ⋯ } }.aig.decls[{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.ref.gate] with
      | Decl.const b_1 => b_1
      | Decl.atom v => assign v
      | Decl.gate lhs rhs linv rinv =>
        let_fun this := ⋯;
        let lval := denote.go lhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        let rval := denote.go rhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        xor lval linv && xor rval rinv) =
      b

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
b : Bool
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.const b)
this : aig.decls[hit.idx] = Decl.const b
⊢ aig.cache.find? (Decl.const b) = some hit →
    (match elem :
        { aig := aig,
                ref :=
                  { gate := hit.idx,
                    hgate := ⋯ } }.aig.decls[{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.ref.gate] with
      | Decl.const b_1 => b_1
      | Decl.atom v => assign v
      | Decl.gate lhs rhs linv rinv =>
        let_fun this := ⋯;
        let lval := denote.go lhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        let rval := denote.go rhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        xor lval linv && xor rval rinv) =
      b
Tactic:
split <;> simp_all
State after:
no goals