Skip to content

API Reference

paramita module

PbConstraint

A Pseudo-Boolean (PB) constraint.

A PB constraint represents a linear constraint over Boolean literals. It consists of a set of literals, an optional weight associated with each literal, a comparison operator, and a bound.

If no weights are provided, every literal is assumed to have weight 1, resulting in an unweighted cardinality constraint.

A PB constraint has the general form:

\[ \sum_i w_i \cdot l_i \;\mathrm{op}\; b \]

where:

  • \(l_i\) are Boolean literals,
  • \(w_i\) are integer weights (defaulting to 1 when omitted),
  • \(\mathrm{op}\) is one of the comparison operators defined by OP,
  • \(b\) is the bound.

OP

Bases: Enum

Comparison operators for PB constraints.

Defines the relation between the weighted sum of literals and the bound.

  • LT: Less than.
  • LTE: Less than or equal to.
  • GT: Greater than.
  • GTE: Greater than or equal to.
  • EQ: Equal to.