I'm working on a constraint solver for finite set theory known as {log} ('setlog'). For some reasons {log} formulas allow integer constraints. So far {log} rests on CLP(FD) for solving those constraints. However, we need more; in particular, we need to get rid of binding a finite domain for all integer variables. In other words, we need some CLP system making a more abstract reasoning over the integers.
We are trying CLP(Q,R). It comes with this bb_inf/4 predicate which can search for integer solutions of systems of linear equalities and disequalities. This would be fine but it's not complete. For example it fails to find the right answer for the following system:
3*X + 5*Y + 6*Z = 6
X + 3*Y - 2*Z = 5
where X, Y and Z are integer variables. This system has no integer solutions, although it has an infinite number of rational/real solutions. On the other hand, CLP(Q,R) finds the correct answer for this system (which is equal to the one above except that 7 goes instead of 6 in the first equation):
3*X + 5*Y + 6*Z = 7
X + 3*Y - 2*Z = 5
this system has infinitely many integer solutions.
Then, we wonder whether there are CLP systems implementing:
some linear integer programming algorithm to solve systems of linear equalities and disequalities; and/or
some method to solve systems of linear Diophantine equations
All the best, Maxi
X #> 0
givesX in 1..sup
. – falseX #> Y, Y #> X
in SWI isX#=<Y+ -1,Y#=<X+ -1
when it should befalse
. It only answers false if you bind X or Y to a finite domain:X #> Y, Y #> X, X in 1..10
. That is you can't prove thatX #> Y, Y #> X
is false for all integers. – Maximiliano CristiaX > Y, Y < X
: it is possible to make this fail, but it's a design and performance decision to abstain. After all, always remember: CLPZ permits to formulate undecidable queries. – false