Class BottomUpOptimizer<TTree, TTreeNodeType, TWildcardFactory>
Defines a bottom-up optimizer for TTree trees.
Inheritance
Inherited Members
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class BottomUpOptimizer<TTree, TTreeNodeType, TWildcardFactory> : BottomUpRewriter<TTree, TTreeNodeType, TTree, TWildcardFactory> where TTree : ITree<TTreeNodeType> where TWildcardFactory : IWildcardFactory<TTree>, new()
Type Parameters
Name | Description |
---|---|
TTree | Type of the source trees. Needs to implement ITree<TTree>. |
TTreeNodeType | Node type of the source trees. |
TWildcardFactory | Wildcard factory type for source tree wildcard nodes. |
Constructors
BottomUpOptimizer()
Creates a new bottom-up optimizer instance with no initial rewrite rule definitions. Collection initializer syntax can be used for the Leaves, Rules, and Fallbacks properties.
Declaration
public BottomUpOptimizer()
BottomUpOptimizer(IEqualityComparer<TTree>, IEqualityComparer<TTreeNodeType>)
Creates a new bottom up rewriter instance with no initial rewrite rule definitions. Collection initializer syntax can be used for the Leaves, Rules, and Fallbacks properties.
Declaration
public BottomUpOptimizer(IEqualityComparer<TTree> sourceTreeComparer, IEqualityComparer<TTreeNodeType> sourceNodeComparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEqualityComparer<TTree> | sourceTreeComparer | Equality comparer used to compare source trees in order to detect forward progress during optimization. |
System.Collections.Generic.IEqualityComparer<TTreeNodeType> | sourceNodeComparer | Equality comparer used to compare source tree nodes during construction of the rule table and during tree matching. |
Methods
Optimize(TTree)
Optimizes the given tree by repeatedly applying rewrite rules.
Declaration
public TTree Optimize(TTree tree)
Parameters
Type | Name | Description |
---|---|---|
TTree | tree | Tree to optimize. |
Returns
Type | Description |
---|---|
TTree | Optimized tree. |