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

z3py: printing AtLeast constraint skips threshold #7105

Closed
fsomenzi opened this issue Jan 30, 2024 · 0 comments
Closed

z3py: printing AtLeast constraint skips threshold #7105

fsomenzi opened this issue Jan 30, 2024 · 0 comments

Comments

@fsomenzi
Copy link

I came across the following small glitch. Running this code with 4.12.5:

from z3 import *
expr = AtMost(a, b, c, 1)
print(expr)
print(expr.sexpr())
print(simplify(expr))
print(simplify(expr).sexpr())

produces

AtMost((a, b, c), 1)
((_ at-most 1) a b c)
at-least(Not(a), Not(b), Not(c))
((_ at-least 2) (not a) (not b) (not c))

The two sexpr confirm that Z3 understands and simplifies the constraint correctly. The first output line (AtLeast((a,b,c),1)) uses syntax that is not supported by the API, which wants AtLeast(a,b,c,1) instead. The third line, uses a name (at-least) that is not in the API and does not print the threshold.

These are clearly not show stoppers, but I thought you'd want to know. Also, in the header comment of AtLeast in z3py.py, it says "Create an at-most Pseudo-Boolean constraint."

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

1 participant