MCPcopy Create free account
hub / github.com/Rust-API/Rust-API-Bypass-Checker / negate

Method negate

src/analysis/numerical/linear_constraint.rs:398–411  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

396 }
397
398 pub fn negate(&self) -> Self {
399 if self.is_tautology() {
400 Self::new_false()
401 } else if self.is_contradiction() {
402 Self::new_true()
403 } else {
404 match self {
405 LinearConstraint::Equality(expr) => Self::Inequality(expr.clone()),
406 LinearConstraint::Inequality(expr) => Self::Equality(expr.clone()),
407 LinearConstraint::LessEq(expr) => Self::LessThan(-expr.clone()),
408 LinearConstraint::LessThan(expr) => Self::LessEq(-expr.clone()),
409 }
410 }
411 }
412}
413
414impl From<LinearConstraint> for LinearConstraintSystem {

Callers 1

try_fromMethod · 0.80

Calls 2

is_tautologyMethod · 0.80
is_contradictionMethod · 0.80

Tested by

no test coverage detected