Open triska opened 8 years ago
Another case where stronger propagation should be possible (tested on SWI's CLP(FD), I'm assuming those cases hold for CLP(Z)):
?- X in 0..sup, Y in inf.. -1, X^I #= Y.
X in 0..sup,
X^I#=Y,
Y in inf.. -1
X
is positive and Y
is not, therefore it should fail.
This is particularely noticeable when there is only one unknown:
?- 2^I #= -4.
2^I#= -4. % should fail without needing labeling
The same thing happens when X
is negative:
?- (-2)^I #= -4.
-2^I#= -4
(Though it can be less obvious to fail when possible in the general case because of odd powers yielding negative numbers)
@JCumin : Still not using clpz?
@UWN I only have a recreational use for Prolog, as such I don't feel like it is worth investing money into a SICStus license (whether it be paid by me or anyone else). Moreover, SICStus top-level did not really make a great impression on me.
@JCumin - so you did not even take the offer?? For the top level, I do agree - but at least it has better naming of variables.
@UWN No I did not. I would feel bad having someone spend a significant amount of money for how little I use Prolog. Moreover my main project needs to be runnable on a free distribution, so I wouldn't work on porting it to SICStus anyway.
Enhance propagation in the following cases, if possible:
and:
Suggested by @JCumin. These cases must be checked carefully.