pub struct ExprComplexity {Show 15 fields
pub total_nodes: usize,
pub depth: usize,
pub width: usize,
pub num_variables: usize,
pub num_constants: usize,
pub num_predicates: usize,
pub num_quantifiers: usize,
pub quantifier_depth: usize,
pub num_negations: usize,
pub num_connectives: usize,
pub num_arithmetic: usize,
pub num_set_ops: usize,
pub num_let_bindings: usize,
pub branching_factor: f64,
pub leaf_ratio: f64,
}Expand description
Comprehensive complexity metrics for a TLExpr tree.
Fields§
§total_nodes: usizeTotal AST nodes in the expression tree.
depth: usizeMaximum depth of the tree (root = depth 1).
width: usizeMaximum number of siblings at any single level.
num_variables: usizeNumber of distinct variable names across the tree.
num_constants: usizeNumber of constant / literal nodes.
num_predicates: usizeNumber of predicate application nodes.
num_quantifiers: usizeNumber of quantifier nodes (ForAll, Exists, soft, counting, etc.).
quantifier_depth: usizeMaximum nesting depth of quantifiers.
num_negations: usizeNumber of Not / FuzzyNot nodes.
num_connectives: usizeNumber of connective nodes (And, Or, Imply, Iff, TNorm, TCoNorm, etc.).
num_arithmetic: usizeNumber of arithmetic operation nodes.
num_set_ops: usizeNumber of set operation nodes.
num_let_bindings: usizeNumber of let / lambda / fixpoint binding nodes.
branching_factor: f64Average children per internal (non-leaf) node.
leaf_ratio: f64Ratio of leaf nodes to total nodes.
Implementations§
Source§impl ExprComplexity
impl ExprComplexity
Sourcepub fn score(&self) -> f64
pub fn score(&self) -> f64
A scalar “complexity score” summarising overall complexity (weighted sum).
Sourcepub fn is_simple(&self, threshold: f64) -> bool
pub fn is_simple(&self, threshold: f64) -> bool
Returns true when the scalar Self::score is below threshold.
Sourcepub fn format_table(&self) -> String
pub fn format_table(&self) -> String
Tabular representation of all metrics.
Trait Implementations§
Source§impl Clone for ExprComplexity
impl Clone for ExprComplexity
Source§fn clone(&self) -> ExprComplexity
fn clone(&self) -> ExprComplexity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more