- java.lang.Object
-
- org.logicng.pseudobooleans.PBAdderNetworks
-
- All Implemented Interfaces:
PBEncoding
public final class PBAdderNetworks extends Object implements PBEncoding
The adder networks encoding for pseudo-Boolean constraints to CNF.- Since:
- 1.1
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description PBAdderNetworks(FormulaFactory f)Constructs a new pseudo-Boolean adder network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Formula>encode(LNGVector<Literal> lits, LNGIntVector coeffs, int rhs, List<Formula> formula)Encodes a pseudo-Boolean constraint and returns its CNF encoding.
-
-
-
Constructor Detail
-
PBAdderNetworks
public PBAdderNetworks(FormulaFactory f)
Constructs a new pseudo-Boolean adder network.- Parameters:
f- the formula factory
-
-
Method Detail
-
encode
public List<Formula> encode(LNGVector<Literal> lits, LNGIntVector coeffs, int rhs, List<Formula> formula)
Description copied from interface:PBEncodingEncodes a pseudo-Boolean constraint and returns its CNF encoding.- Specified by:
encodein interfacePBEncoding- Parameters:
lits- the literals of the constraintcoeffs- the coefficients of the constraintrhs- the right-hand side of the constraintformula- the current result CNF- Returns:
- the CNF encoding of the constraint
-
-