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

Bug multiple sat/1 combined with weighted_maximum/3 #15

Open
ghost opened this issue Mar 4, 2021 · 0 comments
Open

Bug multiple sat/1 combined with weighted_maximum/3 #15

ghost opened this issue Mar 4, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2021

Should weighted_maximum/3 work together with multiple sat/1
constraints. I get the following result:

/* SWI-Prolog (threaded, 64 bits, version 8.3.20) */
̀?- sat(~(Y*X)), sat(Z=:=Y), weighted_maximum([7,2,5],[X,Y,Z],W).
false.

But was rather expecting:

?- sat(~(Y*X)), sat(Z=:=Y), weighted_maximum([7,2,5],[X,Y,Z],W).
Y = 1, X = 0, Z = 1, W = 7 ;
Y = 0, X = 1, Z = 0, W = 7
@ghost ghost changed the title Bug in CLP(B) when multiple sat/1 combined with weighted_maximum/3 Bug multiple sat/1 combined with weighted_maximum/3 Mar 4, 2021
triska added a commit to triska/scryer-prolog that referenced this issue Mar 5, 2021
Many thanks to @jburse for reporting this issue:

    triska/clpz#15

Example:

    ?- sat(~(Y*X)), sat(Z=:=Y), weighted_maximum([7,2,5],[X,Y,Z],W).
       W = 7, Y = 0, X = 1, Z = 0
    ;  W = 7, Y = 1, X = 0, Z = 1
    ;  false.
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

0 participants