Module logicng

Class 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 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: 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
        formula - the current result CNF
        Returns:
        the CNF encoding of the constraint