v2.17.0
New Constraints
InverseConstraint— enforcesf[i]==j ↔ invf[j-1]==i+1(MiniZincinverse); with two-pass pairwise arc-consistency propagationAmongConstraint— counts variables whose value falls in a setSand compares to a bound (MiniZincamong); generalisesCountConstraintfrom one value to a set
New Propagators (Propagatable)
All new propagators are registered in PropagationFixpointSolver and LocalSolver via the FixpointConsistency.of(Constraint.class) pattern — adding a new propagator to either chain is now a one-line change.
LinearConstraint— weighted-sum bounds propagation (handles negative coefficients)CountConstraint— classifies variables as definite/possible/impossible; prunes when quota is filled (EQ/LEQ) or must be reached (EQ/GEQ)InverseConstraint— arc consistency betweenfandinvfarraysAmongConstraint— same definite/possible/impossible logic asCountConstraintbut over a set of valuesAtLeastNConstraint— forces possibly-true booleans totruewhen exactly enough remainAtMostNConstraint— forces possibly-true booleans tofalsewhen the quota is filledCumulativeConstraint— moved from a separate decorator into the combined fixpoint loop so it interacts with AC3, AllDiff GAC, and other propagators
API Additions
EnumDomain.of(E first, E... rest)— varargs factory for restricted enum domainsCSP.Builder.inverseConstraint(f, invf)andCSP.Builder.amongConstraint(vars, values, op, n)
Infrastructure
ConstraintConsistency@FunctionalInterface— common contract for all propagation passesFixpointConsistency.of(Class)— replaces the seven deleted per-type consistency classes (SumConsistency,AllDiffConsistency, etc.) and theConsistencyFixpointutility; filters by constraint type and runs to fixpointBinaryDecomposableinterface — replaces theOptional-basedgetAsBinaryConstraints()onNaryConstraint- Deleted vestigial solver decorators:
ArcConsistentSolver,AllDiffConsistentSolver,CumulativeConsistentSolver - Integration tests:
TaskAssignmentInverseTest,MealPlanningTest
Installation
<dependency>
<groupId>io.github.rcrida</groupId>
<artifactId>jcsp</artifactId>
<version>2.17.0</version>
</dependency>