Class MainTree
java.lang.Object
org.variantsync.boosting.datastructure.MainTree
- All Implemented Interfaces:
Serializable
The MainTree represents the AST resulting from merging several product ASTs.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMainTree
(AbstractAST tree) Initializes a MainTree object with the given AbstractAST tree. -
Method Summary
Modifier and TypeMethodDescriptionorg.logicng.formulas.Formula
getMapping
(ProductPosition position) Retrieves the mapping formula associated with a given product position.getProductPositions
(ASTNode node) Retrieves the set of ProductPositions associated with the given ASTNode.getTree()
Retrieves the AbstractAST tree associated with this MainTree.Merges the Abstract Syntax Tree (AST) of the given product into the of this main AST (main tree) and returns the set of all nodes in the resulting main tree corresponding to the nodes of this AST.
-
Constructor Details
-
MainTree
Initializes a MainTree object with the given AbstractAST tree.- Parameters:
tree
- the AbstractAST tree to be set for this MainTree
-
-
Method Details
-
unite
Merges the Abstract Syntax Tree (AST) of the given product into the of this main AST (main tree) and returns the set of all nodes in the resulting main tree corresponding to the nodes of this AST.- Parameters:
variant
- The product containing the main tree to merge this AST into.- Returns:
- The set of all nodes in the resulting main tree corresponding to the nodes of this AST.
-
getMapping
Retrieves the mapping formula associated with a given product position.- Parameters:
position
- The product position for which to retrieve the mapping formula- Returns:
- The mapping formula associated with the given product position
- Throws:
NullPointerException
- if the inversePositionMap is not initialized
-
getProductPositions
Retrieves the set of ProductPositions associated with the given ASTNode.- Parameters:
node
- the ASTNode for which to retrieve the ProductPositions- Returns:
- a Set of ProductPositions associated with the given ASTNode
-
getTree
Retrieves the AbstractAST tree associated with this MainTree.- Returns:
- the AbstractAST tree associated with this object
-