Interface Relevance
- All Superinterfaces:
Predicate<VariationNode<?,,?>> Source
- All Known Implementing Classes:
Configure,ConfigureSpec,Search,Trace,TraceSup
Abstract definition of relevance predicates as defined in Section 3 in our SPLC'23 paper - Views on Edits to Variational Software.
A relevance predicate decides which nodes within a variation tree are interesting for,
and hence should be included in, a view on that variation tree.
Thus, a relevance predicate is a predicate on nodes in a variation trees.
Moreover, this interface provides methods to access a predicates metadata for debugging
and (de-)serialization.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault <TreeNode extends VariationNode<TreeNode,?>>
voidcomputeViewNodes(TreeNode v, Consumer<TreeNode> markRelevant) Delegates tocomputeViewNodesCheckAll(Relevance, VariationNode, Consumer)with this relevance as the first parameter.static <TreeNode extends VariationNode<TreeNode,?>>
voidcomputeViewNodesCheckAll(Relevance rho, TreeNode v, Consumer<TreeNode> markRelevant) Marks all nodes that should be contained within a view on the given tree.static StringDefault implementation forObject.toString()that can be reused by implementing classes.Methods inherited from interface org.variantsync.diffdetective.util.Source
fullExplanation, functionExplanation, getRootSource, getSourceArguments, getSourceExplanation, getSources, shallowExplanation
-
Method Details
-
computeViewNodes
default <TreeNode extends VariationNode<TreeNode,?>> void computeViewNodes(TreeNode v, Consumer<TreeNode> markRelevant) Delegates tocomputeViewNodesCheckAll(Relevance, VariationNode, Consumer)with this relevance as the first parameter. -
computeViewNodesCheckAll
static <TreeNode extends VariationNode<TreeNode,?>> void computeViewNodesCheckAll(Relevance rho, TreeNode v, Consumer<TreeNode> markRelevant) Marks all nodes that should be contained within a view on the given tree. In particular, this function checks each node in the given tree v on relevance. For each node that is deemed relevant by the given relevance predicate rho, that node and all its ancestors are marked as relevant by invoking the given callback markRelevant. The callback may be invoked multiple times on the same node. This function tests the relevance predicate on all nodes separately and performs no optimizations.- Type Parameters:
TreeNode- The type of the nodes within the given tree.- Parameters:
rho- The relevance predicate to test on all nodes.v- The root node the tree to test for relevance.markRelevant- Callback that is invoked on each tree node that is deemed relevant.
-
toString
Default implementation forObject.toString()that can be reused by implementing classes. The produced string will look like a function call.- Parameters:
relevance- The relevance predicate to turn into a string.- Returns:
Source.getSourceArguments()+ "(" +Source.getSourceExplanation()+ ")"
-