Class Configure
java.lang.Object
org.variantsync.diffdetective.variation.tree.view.relevance.Configure
- All Implemented Interfaces:
Predicate<VariationNode<?,,?>> Source,Relevance
Relevance predicate that generates (partial) variants from variation trees.
This relevance predicate is the implementation of Equation 5 in our SPLC'23 paper.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a configuration from an assignment of variable names to boolean values.Configure(org.prop4j.Node configuration) Create a configuration relevance from a propositional formula that encodes selections and deselections of variables.Configure(FixTrueFalse.Formula configuration) Same asConfigure(Node)but with a formula that is witnessed to not contain true or false constants not at the root. -
Method Summary
Modifier and TypeMethodDescriptionprivate <TreeNode extends VariationNode<TreeNode,?>>
voidcomputeViewNodes(List<TreeNode> vs, Consumer<TreeNode> markRelevant) <TreeNode extends VariationNode<TreeNode,?>>
voidcomputeViewNodes(TreeNode v, Consumer<TreeNode> markRelevant) Delegates toRelevance.computeViewNodesCheckAll(Relevance, VariationNode, Consumer)with this relevance as the first parameter.private <TreeNode extends VariationNode<TreeNode,?>>
booleancomputeViewNodesOfElifChain(TreeNode v, Consumer<TreeNode> markRelevant) Returns a list of arguments required to understand this source.Returns a short, one line explanation or identifier of this source.booleantest(VariationNode<?, ?> v) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.variantsync.diffdetective.util.Source
fullExplanation, functionExplanation, getRootSource, getSources, shallowExplanation
-
Field Details
-
configuration
-
-
Constructor Details
-
Configure
Same asConfigure(Node)but with a formula that is witnessed to not contain true or false constants not at the root. Workaround for FeatureIDE bug FeatureIDE Issue 1333. -
Configure
public Configure(org.prop4j.Node configuration) Create a configuration relevance from a propositional formula that encodes selections and deselections of variables. Typically, the given formula should be in conjunctive normal form. The given configuration may be partial or complete.- Parameters:
configuration- A propositional formula that denotes selections and deselections.
-
Configure
Create a configuration from an assignment of variable names to boolean values. The given assignment may be complete or partial. Internally, a big conjunction of literals is created:⋀ f ∧ ⋀ ¬ f (f, true) ∈ assignment (f, false) ∈ assignmentAs an example, suppose the map contains the following entries:A ↦ true B ↦ false C ↦ true
then we construct a formula A ∧ (¬ B) ∧ C.
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<VariationNode<?,?>>
-
computeViewNodes
private <TreeNode extends VariationNode<TreeNode,?>> void computeViewNodes(List<TreeNode> vs, Consumer<TreeNode> markRelevant) -
computeViewNodes
public <TreeNode extends VariationNode<TreeNode,?>> void computeViewNodes(TreeNode v, Consumer<TreeNode> markRelevant) Description copied from interface:RelevanceDelegates toRelevance.computeViewNodesCheckAll(Relevance, VariationNode, Consumer)with this relevance as the first parameter.- Specified by:
computeViewNodesin interfaceRelevance
-
computeViewNodesOfElifChain
private <TreeNode extends VariationNode<TreeNode,?>> boolean computeViewNodesOfElifChain(TreeNode v, Consumer<TreeNode> markRelevant) - Returns:
- true if the given node was marked relevant
-
getSourceArguments
Description copied from interface:SourceReturns a list of arguments required to understand this source. Each argument in the result list should represent astringwithout newlines and will be formatted together withSource.getSourceExplanation()like"sourceExplanation(argument1, argument2)"bySource.shallowExplanation(). This method is only intended to access the arguments forprinting. In case access to the well-typed object is required, useSource.<T>findFirst(org.variantsync.diffdetective.util.Source,java.lang.Class<T>)orSource.<T>findAll(org.variantsync.diffdetective.util.Source,java.lang.Class<T>)and use the accessors of the underlying type.For ease of implementing
Source, the return value is a list ofObjects instead of a list ofStrings to allow code likeList.of(arg0, arg1, arg2)instead ofList.of(arg0.toString(), arg1.toString(), arg2.toString()). Users of this function should assume nothing from the returned objects except thatObject.toString()is well behaved.- Specified by:
getSourceArgumentsin interfaceSource- Returns:
- an empty list by default
- See Also:
-
getSourceExplanation
Description copied from interface:SourceReturns a short, one line explanation or identifier of this source. The result is used bySource.shallowExplanation()and is formatted together withSource.getSourceArguments()like"sourceExplanation(argument1, argument2)".- Specified by:
getSourceExplanationin interfaceSource
-
toString
-