Package daikon.diff
Class ConsequentExtractorVisitor
- Object
-
- DepthFirstVisitor
-
- ConsequentExtractorVisitor
-
- All Implemented Interfaces:
Visitor
public class ConsequentExtractorVisitor extends DepthFirstVisitor
ConsequentExtractorVisitor is a visitor that takes in RootNode tree used by the other visitors in Diff and only modifies the first inv tree out of the pair of two inv trees (the second tree is never read or modified).The goal is to take the right hand side of any implication and extract it for later use. The implementation completely replaces the previous inv tree with the a new inv tree. The new inv tree contains only the extracted consequents of the original inv tree.
-
-
Constructor Summary
Constructors Constructor Description ConsequentExtractorVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
shouldPrint(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns true if the pair of invariants should be printed, depending on their type, relationship, and printability.void
visit(InvNode node)
The idea is to check if the node is an Implication Invariant.void
visit(PptNode node)
-
Methods inherited from class DepthFirstVisitor
visit
-
-
-
-
Constructor Detail
-
ConsequentExtractorVisitor
public ConsequentExtractorVisitor()
-
-
Method Detail
-
visit
public void visit(PptNode node)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(InvNode node)
The idea is to check if the node is an Implication Invariant. If not, immediately remove the invariant. Otherwise, extract the Consequent, remove the Implication, and then add the consequent to the list.- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
shouldPrint
protected boolean shouldPrint(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns true if the pair of invariants should be printed, depending on their type, relationship, and printability.
-
-