find_most_restrictive_predicate

Function find_most_restrictive_predicate 

Source
fn find_most_restrictive_predicate(
    predicates: &[Expr],
    find_greater: bool,
) -> Result<Option<Expr>>
Expand description

Finds the most restrictive predicate from a list based on literal values.

This function iterates through a list of predicates to identify the most restrictive one by comparing their literal values. For greater-than predicates, the highest value is most restrictive, while for less-than predicates, the lowest value is most restrictive.

§Arguments

  • predicates - A slice of Expr representing predicates to compare.
  • find_greater - A boolean indicating whether to find the highest value (true for >, >=) or the lowest value (false for <, <=).

§Returns

A Result containing an Option<Expr> with the most restrictive predicate, if any.