Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stronger propagation for exponentiation #5

Open
triska opened this issue Oct 24, 2016 · 5 comments
Open

Stronger propagation for exponentiation #5

triska opened this issue Oct 24, 2016 · 5 comments

Comments

@triska
Copy link
Owner

triska commented Oct 24, 2016

Enhance propagation in the following cases, if possible:

?-  X^Y #= 0.
X^Y#=0.

and:

?- X in 0..100, 2^I #= X.
X in 0..100,
2^I#=X.

Suggested by @JCumin. These cases must be checked carefully.

@JCumin
Copy link

JCumin commented Apr 6, 2017

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)

@UWN
Copy link

UWN commented Apr 6, 2017

@JCumin : Still not using clpz?

@JCumin
Copy link

JCumin commented Apr 7, 2017

@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.

@UWN
Copy link

UWN commented Apr 7, 2017

@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.

@JCumin
Copy link

JCumin commented Apr 7, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants