Package daikon.diff
Class XorInvariantsVisitor
- Object
-
- DepthFirstVisitor
-
- PrintAllVisitor
-
- PrintDifferingInvariantsVisitor
-
- XorInvariantsVisitor
-
- All Implemented Interfaces:
Visitor
public class XorInvariantsVisitor extends PrintDifferingInvariantsVisitor
XorInvariantsVisitor is a visitor that performs a standard Diff on two PptMaps, that is, finds the set of Invariants in the XOR set of two PptMaps. However, while those XOR Invariants were the end product of standard diff, this visitor is useful when the XOR set is a means to an end, since you get back a data structure containing the XOR set.Currently, this visitor actually modifies the first of the two PptMaps. This might be an undesirable design call, but creating a PptMap from scratch is difficult given the constraining creational pattern in place.
-
-
Field Summary
-
Fields inherited from class PrintDifferingInvariantsVisitor
debug
-
Fields inherited from class PrintAllVisitor
HUMAN_OUTPUT, lineSep
-
-
Constructor Summary
Constructors Constructor Description XorInvariantsVisitor(PrintStream ps, boolean verbose, boolean printEmptyPpts)
Create an instance of XorInvariantsVisitor.
-
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)
Prints a pair of invariants.void
visit(PptNode node)
Prints the pair of program points, and all the invariants contained within them.-
Methods inherited from class PrintAllVisitor
bufPrint, bufPrintln, bufPrintln, printHumanOutput, printInvariant
-
Methods inherited from class DepthFirstVisitor
visit
-
-
-
-
Constructor Detail
-
XorInvariantsVisitor
public XorInvariantsVisitor(PrintStream ps, boolean verbose, boolean printEmptyPpts)
Create an instance of XorInvariantsVisitor.
-
-
Method Detail
-
visit
public void visit(PptNode node)
Description copied from class:PrintAllVisitor
Prints the pair of program points, and all the invariants contained within them.- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classPrintAllVisitor
-
visit
public void visit(InvNode node)
Description copied from class:PrintAllVisitor
Prints a pair of invariants. Includes the type of the invariants and their relationship.- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classPrintDifferingInvariantsVisitor
-
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.- Overrides:
shouldPrint
in classPrintDifferingInvariantsVisitor
-
-