- java.lang.Object
-
- org.logicng.solvers.maxsat.encodings.Encoding
-
- org.logicng.solvers.maxsat.encodings.SequentialWeightCounter
-
public class SequentialWeightCounter extends Encoding
A sequential weight counter for the encoding of pseudo-Boolean constraints in CNF.- Since:
- 1.0
- Version:
- 2.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected LNGIntVectorcoeffsIncprotected intcurrentLitBlockingprotected intcurrentPbRhsprotected LNGIntVectorlitsIncprotected LNGIntVectorpbOutlitsprotected LNGVector<LNGIntVector>seqAuxiliaryIncprotected LNGIntVectorunitCoeffsprotected LNGIntVectorunitLits
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(MiniSatStyleSolver s, LNGIntVector lits, LNGIntVector coeffs, int rhs)Encodes the pseudo-Boolean constraintvoidencode(MiniSatStyleSolver s, LNGIntVector lits, LNGIntVector coeffs, int rhs, LNGIntVector assumptions, int size)Incremental construction of the SWC encoding.StringtoString()voidupdate(MiniSatStyleSolver s, int rhs)Updates the 'rhs' of an already existent pseudo-Boolean encoding.voidupdateInc(MiniSatStyleSolver s, int rhs)Incremental update of the SWC encoding.
-
-
-
Field Detail
-
pbOutlits
protected final LNGIntVector pbOutlits
-
unitLits
protected final LNGIntVector unitLits
-
unitCoeffs
protected final LNGIntVector unitCoeffs
-
currentPbRhs
protected int currentPbRhs
-
currentLitBlocking
protected int currentLitBlocking
-
seqAuxiliaryInc
protected LNGVector<LNGIntVector> seqAuxiliaryInc
-
litsInc
protected LNGIntVector litsInc
-
coeffsInc
protected LNGIntVector coeffsInc
-
-
Method Detail
-
encode
public void encode(MiniSatStyleSolver s, LNGIntVector lits, LNGIntVector coeffs, int rhs)
Encodes the pseudo-Boolean constraint- Parameters:
s- the solverlits- the literals of the constraintcoeffs- the coefficients of the constraintsrhs- the right-hand side of the constraint
-
encode
public void encode(MiniSatStyleSolver s, LNGIntVector lits, LNGIntVector coeffs, int rhs, LNGIntVector assumptions, int size)
Incremental construction of the SWC encoding.- Parameters:
s- the solverlits- the literals of the constraintcoeffs- the coefficients of the constraintrhs- the right-hand size of the constraintassumptions- the current assumptionssize- the size
-
update
public void update(MiniSatStyleSolver s, int rhs)
Updates the 'rhs' of an already existent pseudo-Boolean encoding. This method allows for all learned clauses from previous iterations to be kept in the next iteration.- Parameters:
s- the solverrhs- the new right-hand side
-
updateInc
public void updateInc(MiniSatStyleSolver s, int rhs)
Incremental update of the SWC encoding.- Parameters:
s- the solverrhs- the new right-hand side
-
-