Class AstMetrics
- Namespace
- LogicalOptimizer
- Assembly
- LogicalOptimizer.Core.dll
Size and shape metrics over expression trees. Cost model: an n-ary And/Or node counts as ONE node (and one operator) regardless of its operand count — the flat list is a single connective, not a chain of binary ones.
public static class AstMetrics
- Inheritance
-
AstMetrics
- Inherited Members
Methods
CountLiterals(AstNode)
Number of variable occurrences (constants excluded)
public static int CountLiterals(AstNode node)
Parameters
nodeAstNode
Returns
CountNodes(AstNode)
Total node count; an n-ary node counts as 1 plus its operands.
public static int CountNodes(AstNode node)
Parameters
nodeAstNode
Returns
CountOperators(AstNode)
Operator count; an n-ary connective counts as one operator.
public static int CountOperators(AstNode node)
Parameters
nodeAstNode
Returns
GetDepth(AstNode)
Tree depth; an n-ary node contributes one level over its deepest operand.
public static int GetDepth(AstNode node)
Parameters
nodeAstNode