Class MainTree

java.lang.Object
org.variantsync.boosting.datastructure.MainTree
All Implemented Interfaces:
Serializable

public class MainTree extends Object implements Serializable
The MainTree represents the AST resulting from merging several product ASTs.
See Also:
  • Constructor Details

    • MainTree

      public MainTree(AbstractAST tree)
      Initializes a MainTree object with the given AbstractAST tree.
      Parameters:
      tree - the AbstractAST tree to be set for this MainTree
  • Method Details

    • unite

      public CustomHashSet<ASTNode> unite(Variant variant)
      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

      public org.logicng.formulas.Formula getMapping(ProductPosition position)
      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

      public Set<ProductPosition> getProductPositions(ASTNode node)
      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

      public AbstractAST getTree()
      Retrieves the AbstractAST tree associated with this MainTree.
      Returns:
      the AbstractAST tree associated with this object