3.7.5. Aggregate

Denotes that, given two instances of a constraint, we can combine (i.e., aggregate) these two instances in order to obtain a third constraint, which has the same name as the first two constraints. The first two constraints are called the source constraints, while the implied constraint is called the target constraint. The i π‘‘β„Ž argument of the target constraint is obtained by combining the i π‘‘β„Ž arguments of the two source constraints. This is specified for each argument by one of the following options.

  • πš’πš: check that the corresponding arguments of the two source constraints are identical and take it as the argument of the target constraint; this option if often used for specifying that an argument corresponding to a parameter has to be the same in the two source constraints, as well as in the target constraint (i.e., the source and the target constraints share the same parameter).

  • +: add the corresponding arguments of the two source constraints.

  • *: multiply the corresponding arguments of the two source constraints.

  • ∧: make an and between the corresponding 0-1 arguments of the two source constraints.

  • ∨: make an or between the corresponding 0-1 arguments of the two source constraints.

  • min: take the minimum of the corresponding arguments of the two source constraints.

  • max: take the maximum of the corresponding arguments of the two source constraints.

  • πšžπš—πš’πš˜πš—: take the union, without removing duplicates, of the collections items of the corresponding arguments of the two source constraints.

  • πšœπšžπš—πš’πš˜πš—: take the union, and remove duplicates, of the collections items of the corresponding arguments of the two source constraints, where collections correspond to collection of ground values (i.e., parameters).

Finally, the aggregation may me be conditioned by a list of restrictions, each restriction corresponding to one of the restrictions described in SectionΒ 2.2.3. We call this conditional aggregation.

Most constraints for which aggregation applies correspond to constraints where one of the arguments is functionally determined by the other arguments. This is for instance the case for the πš–πšŠπš‘πš’πš–πšžπš–(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚) constraint which forces π™Όπ™°πš‡ to be equal to the maximum value assigned to the variables of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚. However some constraints, like the πšœπšŠπš–πšŽ constraint, for which aggregation applies, do not have any argument that is functionally determined by the other arguments.

We now present three examples of deductions that can be obtained by aggregating two source constraints.

  • πšŠπš–πš˜πš—πš(1,〈4,5,5,4,1βŒͺ,〈0,1βŒͺ) ∧ πšŠπš–πš˜πš—πš(3,〈1,1,9,0βŒͺ,〈0,1βŒͺ)β‡’ πšŠπš–πš˜πš—πš(4,〈4,5,5,4,1,1,1,9,0βŒͺ,〈0,1βŒͺ), where:

    1. The first argument of the target constraint, i.e.,Β 4, is equal to the sum of the first arguments of the two source constraints, i.e.,Β 1+3.

    2. The second argument of the target constraint, 〈4,5,5,4,1,1,1,9,0βŒͺ, is equal to the union (without removing duplicates) of the second arguments 〈4,5,5,4,1βŒͺ and 〈1,1,9,0βŒͺ of the two source constraints.

    3. The third arguments of the two source constraints are identical, i.e., 〈0,1βŒͺ, and the third argument of the target constraint.

  • πš–πšŠπš‘πš’πš–πšžπš–(5,〈3,0,5,2,5βŒͺ) ∧ πš–πšŠπš‘πš’πš–πšžπš–(9,〈1,1,9,0βŒͺ)β‡’ πš–πšŠπš‘πš’πš–πšžπš–(9,〈3,0,5,2,5,1,1,9,0βŒͺ), where:

    1. The first argument of the target constraint, i.e.,Β 9, is equal to the maximum value of the first arguments of the two source constraints, i.e.,Β max(5,9).

    2. The second argument of the target constraint, 〈3,0,5,2,5,1,1,9,0βŒͺ, is equal to the union (without removing duplicates) of the second arguments 〈3,0,5,2,5βŒͺ and 〈1,1,9,0βŒͺ of the two source constraints.

  • πšœπšŠπš–πšŽ(〈3,3,1βŒͺ,〈3,1,3βŒͺ) ∧ πšœπšŠπš–πšŽ(〈1,9,1,5,5βŒͺ,〈5,5,1,1,9βŒͺ)β‡’ πšœπšŠπš–πšŽ(〈3,3,1,1,9,1,5,5βŒͺ,〈3,1,3,5,5,1,1,9βŒͺ), where:

    1. The first argument of the target constraint, 〈3,3,1,1,9,1,5,5βŒͺ, is equal to the union (without removing duplicates) of the first arguments 〈3,3,1βŒͺ and 〈1,9,1,5,5βŒͺ of the two source constraints.

    2. The second argument of the target constraint, 〈3,1,3,5,5,1,1,9βŒͺ, is equal to the union (without removing duplicates) of the second arguments 〈3,1,3βŒͺ and 〈5,5,1,1,9βŒͺ of the two source constraints.