Pseudo-Boolean constraints #
A pseudo-Boolean constraint ∑ᵢ aᵢ ℓᵢ ≥ d has natural coefficients aᵢ on literals ℓᵢ and a
natural degree d; a literal counts 1 when true and 0 when false
(Cslib.Logic.PL.PBConstr). This is the normalized form in which the VeriPB proof checker
Bogaerts, Gocht, McCreesh and Nordström stores constraints.
The definitions here are computable and written with structural recursion on lists, so that the
kernel can evaluate them.
A constraint is normalized (Cslib.Logic.PL.PBConstr.normalize) through its linear form: the
literal ¬x is 1 - x, so the constraint is ∑ᵥ cᵥ xᵥ ≥ D with integer cᵥ and D
(Cslib.Logic.PL.PBConstr.toLinear); terms on the same variable are merged and terms with
coefficient 0 dropped, and the result is turned back into literals with positive coefficients,
the degree rising by the coefficients of the negative literals and clamped at 0. Normalization
changes no satisfying assignment (Cslib.Logic.PL.PBConstr.holds_normalize) and introduces no
variable (Cslib.Logic.PL.PBConstr.mem_vars_of_mem_vars_normalize).
The rules of the cutting-planes fragment of VeriPB Gocht and Nordström are
sound (Cslib.Logic.PL.PBConstr.Holds.add, …): addition, multiplication by a natural, division by
a positive natural with every coefficient and the degree rounded up, saturation of every
coefficient at the degree, weakening (dropping a variable and lowering the degree by its
coefficients), and the literal axioms ℓ ≥ 0. The negation of ∑ aᵢ ℓᵢ ≥ d is
∑ aᵢ ¬ℓᵢ ≥ ∑ aᵢ - d + 1 (Cslib.Logic.PL.PBConstr.holds_negate).
Main definitions #
Cslib.Logic.PL.PBConstr,Cslib.Logic.PL.PBConstr.Holds: constraints and their satisfaction.Cslib.Logic.PL.PBConstr.normalize: the normal form.Cslib.Logic.PL.PBConstr.vars: the variables of the terms of a constraint.Cslib.Logic.PL.PBConstr.add,Cslib.Logic.PL.PBConstr.mul,Cslib.Logic.PL.PBConstr.div,Cslib.Logic.PL.PBConstr.saturate,Cslib.Logic.PL.PBConstr.weaken,Cslib.Logic.PL.PBConstr.litAxiom,Cslib.Logic.PL.PBConstr.negate: the rules.Cslib.Logic.PL.PBConstr.IsContradiction: a constraint whose coefficients sum to less than its degree, which no assignment satisfies.Cslib.Logic.PL.Clause.toPB: a clause as the constraint∑ ℓ ≥ 1over its distinct literals.
References #
Semantics #
The linear form #
Normalization #
The normal form: merge the terms on each variable, drop zero coefficients, and move the
constants of negative literals into the degree, clamped at 0.
The variables of the terms of a constraint.
The rules #
Addition: the sum of two constraints, normalized.
Multiplication by a natural k, normalized.
Division by k: normalize, then round every coefficient and the degree up.
Saturation: normalize, then cap every coefficient at the degree.
Weakening on the variable v: normalize, drop the terms on v, and lower the degree by
their coefficients.
The negation of the normal form of ∑ aᵢ ℓᵢ ≥ d: ∑ aᵢ ¬ℓᵢ ≥ ∑ aᵢ - d + 1.
A constraint whose coefficients sum to less than its degree: no assignment satisfies it.
Instances For
Soundness of the rules #
Clauses #
A clause as the constraint ∑ ℓ ≥ 1 over its distinct literals.