Skip to content

Conversation

@sashass1315
Copy link

The previous implementation of Boolean::conditional_enforce_equal returned Unsatisfiable whenever both operands were constant and unequal and the condition was not Constant(false). This violated EqGadget’s contract, which requires the constraint to be vacuously true when the condition is false, and it also diverged from other implementations in the codebase (e.g., FpVar) that encode conditional equality as (a - b) * condition == 0. This patch changes the logic to treat condition == Constant(false) as a no-op, to only error when condition == Constant(true) and the constants are unequal, and otherwise to enforce (a - b) * condition == 0 even in constant-constant cases by emitting the appropriate ±1 linear combination. This aligns the Boolean implementation with EqGadget semantics and the established pattern across field and vector implementations.

@sashass1315 sashass1315 requested a review from a team as a code owner November 23, 2025 18:21
@sashass1315 sashass1315 requested review from Pratyush, mmagician and z-tech and removed request for a team November 23, 2025 18:21
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