Documentation

Std.Tactic.BVDecide.Bitblast.BoolExpr.Circuit

This module contains the logic to turn a BoolExpr Nat into an AIG with maximum subterm sharing, through the use of a cache that re-uses sub-circuits if possible.

@[specialize #[]]
def Std.Tactic.BVDecide.ofBoolExprCached {β : Type} [Hashable β] [DecidableEq β] {α : Type} (expr : BoolExpr α) (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] :

Turn a BoolExpr into an Entrypoint.

Equations
Instances For
    @[specialize #[]]
    def Std.Tactic.BVDecide.ofBoolExprCached.go {β : Type} [Hashable β] [DecidableEq β] {α : Type} (aig : Sat.AIG β) (expr : BoolExpr α) (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] :
    aig.ExtendingEntrypoint
    Equations
    Instances For
      theorem Std.Tactic.BVDecide.ofBoolExprCached.go_le_size {α β : Type} [Hashable β] [DecidableEq β] (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] (expr : BoolExpr α) (aig : Sat.AIG β) :
      aig.decls.size (go aig expr atomHandler).val.aig.decls.size
      theorem Std.Tactic.BVDecide.ofBoolExprCached.go_decl_eq {α β : Type} [Hashable β] [DecidableEq β] (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] {expr : BoolExpr α} (idx : Nat) (aig : Sat.AIG β) (h : idx < aig.decls.size) (hbounds : idx < (go aig expr atomHandler).val.aig.decls.size) :
      (go aig expr atomHandler).val.aig.decls[idx] = aig.decls[idx]
      theorem Std.Tactic.BVDecide.ofBoolExprCached.go_isPrefix_aig {α β : Type} [Hashable β] [DecidableEq β] (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] {expr : BoolExpr α} {aig : Sat.AIG β} :
      Sat.AIG.IsPrefix aig.decls (go aig expr atomHandler).val.aig.decls
      theorem Std.Tactic.BVDecide.ofBoolExprCached.go_denote_mem_prefix {α β : Type} [Hashable β] [DecidableEq β] (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] {assign : βBool} {aig : Sat.AIG β} {expr : BoolExpr α} {start : Nat} {hstart : start < aig.decls.size} :
      assign, { aig := (go aig expr atomHandler).val.aig, ref := { gate := start, hgate := } } = assign, { aig := aig, ref := { gate := start, hgate := hstart } }
      @[simp]
      theorem Std.Tactic.BVDecide.ofBoolExprCached.go_denote_entry {α β : Type} [Hashable β] [DecidableEq β] (atomHandler : Sat.AIG βαSat.AIG.Entrypoint β) [Sat.AIG.LawfulOperator β (fun (x : Sat.AIG β) => α) atomHandler] {assign : βBool} {expr : BoolExpr α} (entry : Sat.AIG.Entrypoint β) {h : entry.ref.gate < (go entry.aig expr atomHandler).val.aig.decls.size} :
      assign, { aig := (go entry.aig expr atomHandler).val.aig, ref := { gate := entry.ref.gate, hgate := h } } = assign, entry