Module logicng

Class PBSWC

  • All Implemented Interfaces:
    PBEncoding

    public final class PBSWC
    extends Object
    implements PBEncoding
    A sequential weight counter for the encoding of pseudo-Boolean constraints in CNF.
    Since:
    1.0
    Version:
    2.0.0
    • Method Detail

      • encode

        public List<Formula> encode​(LNGVector<Literal> lits,
                                    LNGIntVector coeffs,
                                    int rhs,
                                    List<Formula> result)
        Description copied from interface: PBEncoding
        Encodes a pseudo-Boolean constraint and returns its CNF encoding.
        Specified by:
        encode in interface PBEncoding
        Parameters:
        lits - the literals of the constraint
        coeffs - the coefficients of the constraint
        rhs - the right-hand side of the constraint
        result - the current result CNF
        Returns:
        the CNF encoding of the constraint