Documentation
¶
Index ¶
- type BDD
- func (b *BDD) AddRef(f NodeID) NodeID
- func (b *BDD) AllSat(f NodeID, handler func(assign []bool))
- func (b *BDD) And(f, g NodeID) NodeID
- func (b *BDD) AnodeCount(roots []NodeID) int
- func (b *BDD) AppAll(f, g NodeID, op OpCode, vars []int32) NodeID
- func (b *BDD) AppAllBDD(f, g NodeID, op OpCode, varset NodeID) NodeID
- func (b *BDD) AppEx(f, g NodeID, op OpCode, vars []int32) NodeID
- func (b *BDD) AppExBDD(f, g NodeID, op OpCode, varset NodeID) NodeID
- func (b *BDD) AppUni(l, r NodeID, varset NodeID, op OpCode) NodeID
- func (b *BDD) Apply(f, g NodeID, op OpCode) NodeID
- func (b *BDD) BuildCube(vars []int32, positive []bool) NodeID
- func (b *BDD) Compose(f NodeID, v int32, g NodeID) NodeID
- func (b *BDD) Constrain(f, c NodeID) NodeID
- func (b *BDD) DelRef(f NodeID)
- func (b *BDD) Diff(f, g NodeID) NodeID
- func (b *BDD) Done()
- func (b *BDD) Equiv(f, g NodeID) NodeID
- func (b *BDD) ExistSet(f, varset NodeID) NodeID
- func (b *BDD) Exists(f NodeID, v int32) NodeID
- func (b *BDD) ExistsAll(f NodeID, vars []int32) NodeID
- func (b *BDD) ExtVarNum(n int32) int32
- func (b *BDD) ForAll(f NodeID, v int32) NodeID
- func (b *BDD) ForAllSet(f, varset NodeID) NodeID
- func (b *BDD) ForAllVars(f NodeID, vars []int32) NodeID
- func (b *BDD) FprintDot(file *os.File, f NodeID)
- func (b *BDD) FullSatOne(f NodeID) []bool
- func (b *BDD) FullSatOneBDD(f NodeID) NodeID
- func (b *BDD) High(f NodeID) NodeID
- func (b *BDD) IBuildCube(value int, width int, vars []int32) NodeID
- func (b *BDD) ITE(f, g, h NodeID) NodeID
- func (b *BDD) Implies(f, g NodeID) NodeID
- func (b *BDD) InvImp(f, g NodeID) NodeID
- func (b *BDD) IsRunning() bool
- func (b *BDD) Less(f, g NodeID) NodeID
- func (b *BDD) Load(r io.Reader) (NodeID, error)
- func (b *BDD) Low(f NodeID) NodeID
- func (b *BDD) MakeSet(vars []int32) NodeID
- func (b *BDD) Nand(f, g NodeID) NodeID
- func (b *BDD) NewPair() *Pair
- func (b *BDD) Nithvar(v int32) NodeID
- func (b *BDD) NodeCount() int
- func (b *BDD) Nor(f, g NodeID) NodeID
- func (b *BDD) Not(f NodeID) NodeID
- func (b *BDD) Or(f, g NodeID) NodeID
- func (b *BDD) PathCount(f NodeID) float64
- func (b *BDD) PrintDot(f NodeID)
- func (b *BDD) PrintTable(f NodeID) string
- func (b *BDD) RefCount(f NodeID) int32
- func (b *BDD) RelProd(f, g NodeID, vars []int32) NodeID
- func (b *BDD) RelProdBDD(f, g NodeID, varset NodeID) NodeID
- func (b *BDD) Replace(f NodeID, p *Pair) NodeID
- func (b *BDD) Restrict(f NodeID, v int32, value bool) NodeID
- func (b *BDD) RestrictBDD(f, c NodeID) NodeID
- func (b *BDD) SatCountDouble(f NodeID) float64
- func (b *BDD) SatCountLn(f NodeID) float64
- func (b *BDD) SatCountLnSet(f NodeID, vars []int32) float64
- func (b *BDD) SatCountSet(f NodeID, vars []int32) uint64
- func (b *BDD) SatOne(f NodeID) NodeID
- func (b *BDD) SatOneSet(f, varset NodeID, pol bool) NodeID
- func (b *BDD) SatisfyCount(f NodeID) uint64
- func (b *BDD) SatisfyOne(f NodeID) []bool
- func (b *BDD) Save(w io.Writer, f NodeID) error
- func (b *BDD) ScanSet(f NodeID) []int32
- func (b *BDD) SetCacheRatio(ratio int)
- func (b *BDD) SetVarNum(num int32)
- func (bd *BDD) Sift()
- func (b *BDD) Simplify(f, d NodeID) NodeID
- func (b *BDD) Stats() Stats
- func (b *BDD) Support(f NodeID) []int32
- func (b *BDD) SupportBDD(f NodeID) NodeID
- func (b *BDD) SwapVar(v1, v2 int32) func(oldIdx NodeID) NodeID
- func (b *BDD) ToCNF(f NodeID) string
- func (b *BDD) ToDNF(f NodeID) string
- func (b *BDD) ToFormula(f NodeID) string
- func (b *BDD) Unique(f, varset NodeID) NodeID
- func (b *BDD) Var(v int32) NodeID
- func (b *BDD) VarCount() int32
- func (b *BDD) VarOf(f NodeID) int32
- func (b *BDD) VarProfile(f NodeID) []int32
- func (b *BDD) VecCompose(f NodeID, p *Pair) NodeID
- func (b *BDD) Xor(f, g NodeID) NodeID
- type NodeID
- type OpCode
- type Pair
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BDD ¶
type BDD struct {
// contains filtered or unexported fields
}
BDD is a manager for Binary Decision Diagrams.
func (*BDD) AddRef ¶
AddRef increments the external reference count on f. Nodes with positive reference counts are automatically remapped during SwapVar/Sift. Matches buddy bdd_addref (kernel.c:1115).
func (*BDD) AnodeCount ¶
AnodeCount counts distinct nodes across an array of BDDs. Shared nodes are counted only once. Matches buddy bdd_anodecount (bddop.c:2653). CC=4.
func (*BDD) DelRef ¶
DelRef decrements the external reference count on f. Matches buddy bdd_delref (kernel.c:1141).
func (*BDD) Done ¶
func (b *BDD) Done()
Done releases all resources held by the BDD. After Done, the BDD must not be used. Matches buddy bdd_done (bdd.h:231).
func (*BDD) ExtVarNum ¶
ExtVarNum adds n new variables and returns the index of the first new variable. Matches buddy bdd_extvarnum (bdd.h:233). CC=2.
func (*BDD) FullSatOne ¶
func (*BDD) FullSatOneBDD ¶
FullSatOneBDD returns a minterm BDD that implies f, with a variable at every level. Matches buddy bdd_fullsatone (bddop.c:2285). CC=4.
func (*BDD) IBuildCube ¶
IBuildCube builds a cube from an integer bitmask. The width low-order bits of value encode the polarity of vars[0..width-1]: bit=1 → positive literal, bit=0 → negated literal. The MSB corresponds to vars[0], LSB to vars[width-1]. Matches buddy bdd_ibuildcube (bddop.c:357). CC=3.
func (*BDD) IsRunning ¶
IsRunning reports whether the BDD is initialized and ready for use. Matches buddy bdd_isrunning (bdd.h:234).
func (*BDD) Load ¶
Load reads a BDD from r in buddy-compatible format. Returns the root NodeID. The BDD's variable ordering is updated. CC=8.
func (*BDD) PrintTable ¶
func (*BDD) RestrictBDD ¶
func (*BDD) SatCountDouble ¶
SatCountDouble returns the number of satisfying assignments as float64. Matches buddy bdd_satcount (bddop.c:2460).
func (*BDD) SatCountLn ¶
func (*BDD) SatisfyCount ¶
func (*BDD) SatisfyOne ¶
func (*BDD) Save ¶
Save writes a BDD to w in buddy-compatible format. Terminals are written as "0 0 <value>\n". Non-terminals write the node count, variable ordering, then each node in DFS post-order (children before parent). CC=5.
func (*BDD) SetCacheRatio ¶
SetCacheRatio sets the operator cache size relative to the node table. The cache is resized to len(nodes) * ratio, clamped to [1024, 262144]. Matches buddy bdd_setcacheratio (bddop.c:276). CC=4.
func (*BDD) SetVarNum ¶
SetVarNum changes the number of variables. If num > current, new variables are added with identity level mapping. If num < current, variables beyond num are removed. Matches buddy bdd_setvarnum (bdd.h:232). CC=7.
func (*BDD) SupportBDD ¶
SupportBDD returns the support of f as a BDD variable set. Matches buddy bdd_support (bddop.c:2053).
func (*BDD) VarProfile ¶
type NodeID ¶
type NodeID int32
NodeID is a handle to a BDD node. Terminal nodes are False (0) and True (1). Non-terminal nodes have indices >= 2.
type OpCode ¶
type OpCode int32
OpCode is a binary operator code for Apply, AppEx, AppAll, AppUni, and RelProd.