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

Method add_constraint

src/analysis/numerical/interval_domain.rs:371–390  ·  view source on GitHub ↗
(&mut self, cst: &LinearConstraint)

Source from the content-addressed store, hash-verified

369 }
370
371 fn add_constraint(&mut self, cst: &LinearConstraint) {
372 if cst.is_contradiction() {
373 self.set_to_bottom();
374 return;
375 }
376 if cst.is_tautology() {
377 return;
378 }
379 match cst {
380 LinearConstraint::Equality(expr) => self.refine_equality(expr),
381 LinearConstraint::LessEq(expr) => self.refine_less_equal(expr),
382 LinearConstraint::LessThan(_) => {
383 let non_strict = cst.strict_to_non_strict();
384 if let LinearConstraint::LessEq(expr) = non_strict {
385 self.refine_less_equal(&expr);
386 }
387 }
388 LinearConstraint::Inequality(_) => {}
389 }
390 }
391
392 fn refine_equality(&mut self, expr: &LinearExpression) {
393 if let Some((path, low, high)) = interval_from_unary_expr(expr) {

Callers 1

add_constraintsMethod · 0.80

Calls 6

is_contradictionMethod · 0.80
set_to_bottomMethod · 0.80
is_tautologyMethod · 0.80
refine_equalityMethod · 0.80
refine_less_equalMethod · 0.80
strict_to_non_strictMethod · 0.80

Tested by

no test coverage detected