Skip to content

Conversation

@cprudhom
Copy link
Member

These changes include the following:

  • Change to the default strategy for XCSP3
  • Conditional transformation of expressions into constraints in extensions and detection of some classic expressions (see #embody() method)
  • Implementation of a cache for the XCSP3 parser
  • addition of a configurable RoundRobin strategy
  • improvement and correction of DomOverWDeg and its variants
  • improvement of structures for CompactTable
  • creation of a class dedicated to preprocessing algorithms
  • addition of flexibility in ParallelPortfolio
  • other improvements and bug fixes

cprudhom and others added 30 commits March 13, 2025 13:45
The degree of the XCSP variable should be different from 0 to be really created in the choco model.
…ation" of a failure is too big (=all variables)
+add model and decision path to AbstractStrategy
Can be used to map double to Identity-based objects
@cprudhom cprudhom added this to the 5.0.0 milestone Aug 19, 2025
@cprudhom cprudhom self-assigned this Aug 19, 2025
@cprudhom cprudhom added bug feature java Pull requests that update java code labels Aug 19, 2025
* @param vars array of integer variables
* @param except array of values that can be excluded from the allDifferent constraint
*/
default void allDifferentExceptDec2(IntVar[] vars, int[] except) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename as "allDifferentExceptGCCDec" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why GCC?
allDifferentExceptManyDec ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the decomposition is based on GCC, so I would understand it as a "GCC based decomposition"
but I admit that reading "ExceptGCC" might be confusing, so perhaps allDifferentExceptDecGCC would be better.
We can also stay with the allDifferentExceptDec2

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about "allDifferentExceptDecBasedOnGCC" ? Or "allDifferentExceptDecByGCC" ?

return IntEventType.DECUPP.getMask();
}
return IntEventType.INCLOW.getMask();
return IntEventType.INSTANTIATE.getMask();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change made to trigger the setPassive ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly

*
* @author Charles Prud'homme
*/
public final class IntDomainSticky implements IntValueSelector, Function<IntVar, OptionalInt>, IVariableMonitor<IntVar> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used in round robin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be. I'll change that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it is already usable in RoundRobin

… to MiniSat#doReduceDB().

This is done by storing separately failure clauses and prohibiting-solution ones in MiniSat#learnts
…ents generated by propagateSat() can be lost because of `onPropagatorExecution` not placed correctly

+ fix typo in IntCircularQueue#toString
…d of CT

+ add new option 'maxSizeInMBToUseCompactTable' in Settings
+ STR2+ now manages tuples without ISet (IStateInt + int[] instead)
+ correction of few propagators which were incorrect
+ correction of false literal declaration (init of MiniSat)
+ correction of assertion message and showReason
/**
* Indicates if all literals but one are false in the clause.
* By implication, the remaining literal is the asserting literal.
* By contract, the literal at index 0 is the asserting literal and should not be considered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the combination of "literal at index 0 ... should not be considered" and "allFalseButOne" confusing.
My first understanding is that were are checking that all literals but one are false, starting from position 1, whereas the code check that they are all false. If the code is correct, I would rephrase the doc :
"By contract, the literal at index 0 is the asserting literal and always true."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your first understanding is correct: we are checking that all literals but one are false, starting from position 1.
The loop starts at 1 (not 0) and if a literal is not false, the loop is broken and false is returned.

Then, the contract is not that the literal at 0 is always true.
In its current usage (for assertion only), it should be undefined, otherwise there is a problem somewhere (indeed, the current cannot explain an event that already occurs).

Note that if this method is called somewhere else in the code, the assertion can be wrong, though, since it must be true only when a literal is satisfied or falsified.

Its easier (from a conception perspective) to keep the method in the Clause class, but I agree that it can be renamed for clarity.

* @param vars array of integer variables
* @param except array of values that can be excluded from the allDifferent constraint
*/
default void allDifferentExceptDec2(IntVar[] vars, int[] except) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about "allDifferentExceptDecBasedOnGCC" ? Or "allDifferentExceptDecByGCC" ?

Comment on lines +245 to +246
* If a task is optional, it can be performed with a duration of 0 and the other mandatory tasks can overlap it.
* Otherwise, the task must be performed and cannot be overlapped by any other task even if it has a duration of 0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not clear to me. I don't see, from the code, where the optionality of a task does intervene ? And shouldn't the optional tasks that are performed be considered as mandatory tasks ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the MiniZinc definition (for which this decomposition has been written) a task with 0-duration is considered as optional, and can be overlapped.
But, if strict is set to true, a 0-duration task cannot be overlapped.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this is clearer for the definition and I agree on the documentation.

I still would precise that optionality is treated as the possibility of the task to have a null-duration (as it is the only criteria taken into account in the code wrt optionality of tasks)

int u = Y.getUB();
if (l >= 0) {
absY.updateLowerBound(l, this, lcg() ? Reason.r(Y.getMinLit()) : Reason.undef());
absY.updateUpperBound(u, this, lcg() ? Reason.r(Y.getMinLit(), Y.getMaxLit()) : Reason.undef());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there Y.getMinLit() in the explanation ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because l (Y.getLB()) is >=0, which could happen due to filtering of Y lower bound.

Consider the case where Y = [-10, 5], then |Y| = [0,10]
If an event set Y to [2,5], then |Y| = [2,5] and the modification of |Y| upper bound is due to the current upper bound of Y and the fact the lower bound of Y changes (to a value >= 0)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected the explanation to therefore be Reason.r(Y.getLELit(-1), Y.getMaxLit()) but it would only work for enumerated-domains' variables. Maybe we could rely on the getNegGeqLit and getNegLeqLit functions I used in PropagatorCumulative (by making them static functions in Reason ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature java Pull requests that update java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants