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

Literals aren't nicely clausified #191

Open
user202729 opened this issue Feb 6, 2025 · 1 comment
Open

Literals aren't nicely clausified #191

user202729 opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@user202729
Copy link

Consider the following:

from pysat.formula import *
from pysat import solvers
x = Atom("x")
solver = solvers.Glucose3()
solver.append_formula(list(x @ PYSAT_TRUE))

It raises the error

TypeError: bad operand type for unary +: 'NoneType'

Looks like .name is None for the constant PYSAT_TRUE. I suppose the fix would require special case handling True and False in various components (actually calling .simplified() on the formula before adding mostly works, as in

solver.append_formula(list((x @ PYSAT_TRUE).simplified()))

)

@alexeyignatiev
Copy link
Collaborator

This looks like a bug and it requires fixing. Let me think about this when I get time!

@alexeyignatiev alexeyignatiev added the bug Something isn't working label Feb 9, 2025
@alexeyignatiev alexeyignatiev self-assigned this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants