Declaration
public abstract ConstraintResult Process(
SolverState state
)
Summary
Constraint implementations must use methods such as
SolverState.MarkImpossible(int, int) or
SolverState.MustBe(int, int) to mark values that are known to be impossible given the incomplete grid
exposed by properties such as
SolverState.this[int].
Returns
Implementations must return null
if the constraint remains valid for the remainder of filling this
grid, or ConstraintReplace with a collection of constraints that this constraint shall be
replaced with (can be empty), or ConstraintViolation to indicate that this constraint is
already violated.
For example, in EqualSumsConstraint, since the sum is not initially known, the constraint
waits until one of its regions is filled and then uses this return value to replace itself with several
SumConstraints to ensure the other regions have the same sum.
The algorithm will automatically call this method again on all the new constraints for all cells already
placed in the grid. The constraints returned MUST NOT themselves return yet more constraints at that
point.