Public

Constraints.USUAL_CONSTRAINTSConstant
USUAL_CONSTRAINTS::Dict

Dictionary that contains all the usual constraints defined in Constraint.jl. It is based on XCSP3-core specifications available at https://arxiv.org/abs/2009.00514

Adding a new constraint is as simple as

@usual name p a sym₁ sym₂

where

  • name: constraint name
  • p: the length of the parameters (0 means no parameters)
  • a: the length of the arguments/variables (0 means any length is possible).
  • symᵢ: a sequence of symmetries (can be left empty)

Both a alone, or p and a together are optional.

Note that concept_name needs to be defined. Unless both error_name and icn_error_name are defined, a default error function will be computed. Please (re-)define error_name for a hand_made error function.

source
Constraints.ConstraintType
Constraint

Parametric stucture with the following fields.

  • concept: a Boolean function that, given an assignment x, outputs true if x satisfies the constraint, and false otherwise.
  • error: a positive function that works as preferences over invalid assignements. Return 0.0 if the constraint is satisfied, and a strictly positive real otherwise.
source
Constraints.argsMethod
args(c::Constraint)

Return the expected length restriction of the arguments in a constraint c. The value nothing indicates that any strictly positive number of value is accepted.

source
Constraints.conceptMethod
concept(c::Constraint)

Return the concept (function) of constraint c. concept(c::Constraint, x...; param = nothing) Apply the concept of c to values x and optionally param.

source
Constraints.error_fMethod
error_f(c::Constraint)

Return the error function of constraint c. error_f(c::Constraint, x; param = nothing) Apply the error function of c to values x and optionally param.

source
Constraints.params_lengthMethod
params_length(c::Constraint)

Return the expected length restriction of the arguments in a constraint c. The value nothing indicates that any strictly positive number of parameters is accepted.

source