Skip to content

Add Iterators as acceptable arguments to functions #7620

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

Merged
merged 1 commit into from
Apr 12, 2025

Conversation

aquacash5
Copy link
Contributor

Allow users to use generator expressions as arguments to z3 objects.

I think it makes the syntax a little cleaner. Removes a lot of those square brackets.

Examples:

s = Solver()

X = [[Int(f"{row} {col}") for col in range(9)] for row in range(9)]

s.add(Distinct(row) for row in X)
# vs
s.add([Distinct(row) for row in X])

@NikolajBjorner NikolajBjorner merged commit 5ad79f2 into Z3Prover:master Apr 12, 2025
1 check passed
@aquacash5 aquacash5 deleted the generator-args branch April 12, 2025 19:11
arbipher pushed a commit to arbipher/z3 that referenced this pull request Apr 17, 2025
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

Successfully merging this pull request may close these issues.

2 participants