Hello Jacob,
sorry for the long delay of my response.
Meanwhile, I implemented the underlying core model of my application and the time to implement the "constraint" part on top of it comes closer. As stated earlier, I'm going to implement some kind of "object-oriented CSP", which could be seen as the mathematical/logical foundation of my application. Let me shortly explain what I mean by "OO-CSP":
Say we have two classes:
class A{
int x;
int y;
}
class B
{
int z;
}
For these classes there are some constraints defined, e.g.:
C1: A.x < 5;
C2: feasible-tuples(A(x,y), {(1, 2), (3, 4), (5, 6), (7, 8)})
C3: A.y = B.z;
Now, the task of the solver effectively is to find values for the classes' variables in a manner that all constraints imposed on these two classes are satisfied when the classes are instantiated using these values. Consequently, solutions for the given CSP include:
{ {A(1,2), B(2)}, {A(3,4), B(4)} } or, equivalently but written more CSP like as tuples of (x, y, z): { (1, 2, 2), (3, 4, 4) }
Furthermore, I want to employ this OO-CSP approach incrementally, that is, combined with user interaction: the application presents the user an interactive form, containing dropdowns for each variable A.x, A.y and B.z. The dropdowns contain only values that are part of the solution spaces/the variable's domain: A.x = {1, 3}, A.y = {2, 4}, B.z = {2, 4}. Now, if the user selects value "4" for B.z, there is only one possible solution remaining and thus, also the other dropdowns should automatically be selected correctly: A.x = {3}, A.y = {4} and B.z = {4}.
Of course, this is just the beginning. Both, the constraints can get more complex (e.g. C.c = A.x * A.y, C.c < 10) and the class structure (the "domain model") can get much more elaborated (think inheritance, nested objects, aka. associations, arrays, sets, maps etc. - for some of these I'm still not sure how to translate these into a CSP though).
So, this is the overall use case. I'd be quite interested what you think about this and if you have any tips at hand for me implementing this (I just found a single paper on OO-CSP, somewhere read about Hierarchical CSP and dynamic CSP... do you know any technique applicable in my context)? Have you doubts whether it is possible at all translating this into a regular CSP and solving this with JSR-331?
Well, and to get back to the topic on "feasible tuples"/the table constraint: in the use case above one could image that there might be a class A whose exact instances might be loaded from a database, that is, the constraint C2 is populated with database rows, and the solver should constraint the solutions to those tuples found in the database.
I'm really looking forward to here from you (and others of course!). It would be great if you could share some ideas on how to implement this (the table constraint as well as the OO-Approach in general). If you'd be interested I could keep you up to date with my findings about OO-CSP?
Thanks in advance and best regards,
Vivian