Skip to content

Conversation

@qthibeault
Copy link
Contributor

@qthibeault qthibeault commented Oct 20, 2025

It is currently not possible to express a predicate of the form $Ax = b$ since using the conjunctive form $Ax \leq b \wedge Ax \geq b$ will incorrectly evaluate to 0.0 when the predicate is satisfied, rather than correctly returning $\infty$ if the predicate is true.

This feature introduces a field that can be set on a Predicate instance that indicates if the Boolean semantics should be used for evaluation instead of the continuous semantics.

using banquo::Predicate;
using banquo::predicate::Comparison;

let mut p = Predicate::default();
p.comparison = Comparison::EQ; // Set to boolean semantics

This change is propagated into the predicate! macro, allowing for the expression of boolean predicates without needing to interact with the field.

using banquo::predicate;

let p = predicate! { x = 3.0 };

Closes #4

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.

Potentially Wrong Output.

1 participant