Skip to content

Bitwise logic operators for CNF-related types#618

Merged
chrjabs merged 2 commits intomainfrom
push-nqwwvskpqzko
Mar 11, 2026
Merged

Bitwise logic operators for CNF-related types#618
chrjabs merged 2 commits intomainfrom
push-nqwwvskpqzko

Conversation

@chrjabs
Copy link
Owner

@chrjabs chrjabs commented Mar 11, 2026

Description of the Contribution

Inspired by #613, this implements not (! or -), or (|), and and (&) operators for Var, Lit, Clause, Cnf, and SatInstance as applicable while staying within CNF.
If we support general formulas in the future, the remaining operators can be implemented.

PR Checklist

  • I read and agree to CONTRIBUTING.md
  • I have formatted my code with rustfmt / cargo fmt --all
  • Commits are named following conventional commits
  • I have added documentation for new features
  • The test suite still passes on this PR
  • I have added tests for new features / tests that would have caught the bug this PR fixes (please explain if not)
  • If this PR contains breaking changes, it is against the next-major branch, not against main

@github-actions github-actions bot added encodings Related to encodings python-api labels Mar 11, 2026
@chrjabs chrjabs changed the title Push nqwwvskpqzko Bitwise logic operators for CNF-related types Mar 11, 2026
chrjabs added 2 commits March 11, 2026 12:40
This allows using `Var::vidx32` and `Var::new_unchecked`, as well as
`Lit::lidx32` and `Lit::from_lidx` instead of the bitwise operations for
advanced usage.
Also frees up the operator trait implementations to be used for more
convinient encoding implementations.
@chrjabs chrjabs force-pushed the push-nqwwvskpqzko branch from a8c9ff1 to 310029b Compare March 11, 2026 10:40
@chrjabs chrjabs merged commit 310029b into main Mar 11, 2026
18 checks passed
@chrjabs chrjabs deleted the push-nqwwvskpqzko branch March 11, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

encodings Related to encodings python-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant