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

Weird itersolve behaviour #20

Closed
msoos opened this issue Mar 28, 2014 · 5 comments
Closed

Weird itersolve behaviour #20

msoos opened this issue Mar 28, 2014 · 5 comments
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@msoos
Copy link

msoos commented Mar 28, 2014

The return value of itersolve is very weird:

>>> from pycosat import itersolve
>>> list(itersolve([]))
[[]]
>>> list(itersolve([[]]))
[]

One of the problems is solveable, but has the only solution to it is the empty solution. The other one is UNSAT. It's weird as hell, though.

@asmeurer
Copy link
Contributor

Why is one unsatisfiable?

@msoos
Copy link
Author

msoos commented Mar 28, 2014

The second one contains the empty clause: []. The empty clause ("0\n" in CNF) is always unsatisfiable.

@asmeurer
Copy link
Contributor

Ah, I get it. One is and(), i.e., true, and the other is and(or()), i.e. and(false) = false.

@asmeurer
Copy link
Contributor

So the result of itersolve([[]]) is wrong. I think [[]] is correct as the empty solution, since that would be or(and()) = true. I guess technically [] could mean unsatisfiable, since it's or() = false. That would be better than returning a string IMO (#14).

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Mar 15, 2022
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label May 14, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label May 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

2 participants