Skip to content

Enable additional SymbolicBit reductions#231

Merged
mnemonikr merged 5 commits intomainfrom
bit-reduction
Dec 11, 2025
Merged

Enable additional SymbolicBit reductions#231
mnemonikr merged 5 commits intomainfrom
bit-reduction

Conversation

@mnemonikr
Copy link
Owner

@mnemonikr mnemonikr commented Dec 11, 2025

The SymbolicBit internally has pointers, though the bit itself is not a pointer. This meant x.clone() ^ x would in general not evaluate to false, because the cloned value is a distinct object.

To remedy this the BitAnd operator (the fundamental operation underlying all others) has been updated to check for x & x as well as x & !x. Note that this only checks whether the immediate arguments are either the same pointer or the same symbolic variable. It does not do attempt to check whether the circuit is identical.

Confirmed x ^ x now evaluates to false even when x is a complex object.

This required bumping the MSRV to 1.88 that's when certain patterns of if-let chains were stabilized: rust-lang/rust#53667

@mnemonikr mnemonikr merged commit 1cde657 into main Dec 11, 2025
2 checks passed
@mnemonikr mnemonikr deleted the bit-reduction branch December 11, 2025 02:45
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.

1 participant