Module logicng

Class 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
    • Method Detail

      • encode

        public void encode​(MiniSatStyleSolver s,
                           LNGIntVector lits,
                           LNGIntVector coeffs,
                           int rhs)
        Encodes the pseudo-Boolean constraint
        Parameters:
        s - the solver
        lits - the literals of the constraint
        coeffs - the coefficients of the constraints
        rhs - 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 solver
        lits - the literals of the constraint
        coeffs - the coefficients of the constraint
        rhs - the right-hand size of the constraint
        assumptions - the current assumptions
        size - 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 solver
        rhs - the new right-hand side
      • updateInc

        public void updateInc​(MiniSatStyleSolver s,
                              int rhs)
        Incremental update of the SWC encoding.
        Parameters:
        s - the solver
        rhs - the new right-hand side