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

Answer-Sets missing with negated count-equals aggregate. #357

Open
AntoniusW opened this issue Jan 23, 2023 · 2 comments
Open

Answer-Sets missing with negated count-equals aggregate. #357

AntoniusW opened this issue Jan 23, 2023 · 2 comments
Assignees
Labels

Comments

@AntoniusW
Copy link
Collaborator

The following program unexpectedly has Alpha report 2 answer sets while there should be three.

:- not 1=#count{ na_1 : a; nb_1 : b; nc_1 : c }.
na_1 :- not a.
a :- not na_1.
nb_1 :- not b.
b :- not nb_1.
nc_1 :- not c.
c :- not nc_1.

Commandline: -n 0 -str [above program]
Output:

Answer set 1:
{ b, na_1, nc_1 }
Answer set 2:
{ c, na_1, nb_1 }
SATISFIABLE

Expected: a third answer set { a, nb_1, nc_1}.

@AntoniusW AntoniusW added the bug label Jan 23, 2023
@AntoniusW AntoniusW self-assigned this Jan 23, 2023
@AntoniusW
Copy link
Collaborator Author

Narrowed it down a bit to an aggregate using ground versus non-ground count-equals.

foo(1) :- 1=#count{ na_1 : a; nb_1 : b }.
:- not foo(1).
na_1 :- not a.
a :- not na_1.
nb_1 :- not b.
b :- not nb_1.

The program above erroneously yields 1 answer set, while the variant below yields the correct 2 answer sets. The major difference is 1=#count{..} versus X=#count{..}.

foo(X) :- X=#count{ na_1 : a; nb_1 : b }.
:- not foo(1).
na_1 :- not a.
a :- not na_1.
nb_1 :- not b.
b :- not nb_1.

@AntoniusW
Copy link
Collaborator Author

More testing with sometimes disappearing answer-sets revealed: bug seems to go away if justification is disabled.

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

No branches or pull requests

1 participant