fjsj
fjsj

Reputation: 11240

Java Constraints Library (JCL) problem: how to represent addition?

I have to solve a CSP logic problem using Java Constraints Library. For now I've managed to represent some constraints of the problem, most of them are based on "equals" and "not equals" binary constraints. My doubt is, how to represent an addition based constraint? Example:

Now the constraint:

Observation: these variables represent money, so they can be added.

Upvotes: 0

Views: 751

Answers (1)

fjsj
fjsj

Reputation: 11240

Since Java Constraint Library uses only unary or binary constraints, we have to do Binarization of Constraints in order to represent n-ary constraints. We can also inherit existing relations classes in the library and define new compatible relations.


EDIT: as of 2020, the JCL library link is dead, here's the original paper for that library: https://www.aaai.org/Papers/Workshops/1997/WS-97-05/WS97-05-004.pdf

Upvotes: 1

Related Questions