1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
use crate::ir::{Expr, Program}; use crate::ops::OpSpec; use crate::ops::rule::condition_op; impl PatternCountGte { /// Declarative operation specification. pub const SPEC: OpSpec = condition_op::spec(OP_ID, Self::program); /// Build the canonical IR program. /// /// # Examples /// /// ``` /// use vyre::ops::rule::pattern_count_gte::PatternCountGte; /// /// assert!(!PatternCountGte::program().entry().is_empty()); /// ``` #[must_use] pub fn program() -> Program { condition_op::condition_program(|| Expr::ge(condition_op::pattern_count(), condition_op::threshold())) } } /// Stable operation id for inclusive pattern count checks. pub const OP_ID: &str = "rule.pattern_count_gte"; /// Pattern count greater-than-or-equal condition operation. #[derive(Debug, Clone, Copy, Default)] pub struct PatternCountGte;