Package daikon.diff
Class MatchCountVisitor
- Object
-
- DepthFirstVisitor
-
- PrintAllVisitor
-
- MatchCountVisitor
-
- All Implemented Interfaces:
Visitor
public class MatchCountVisitor extends PrintAllVisitor
MatchCountVisitor is a visitor that almost does the opposite of PrintDifferingInvariantsVisitor. MatchCount prints invariant pairs if they are the same, and only if they are a part of a conditional ppt. The visitor also accumulates some state during its traversal for statistics, and can report the match precision.
-
-
Field Summary
-
Fields inherited from class PrintAllVisitor
HUMAN_OUTPUT, lineSep
-
-
Constructor Summary
Constructors Constructor Description MatchCountVisitor(PrintStream ps, boolean verbose, boolean printEmptyPpts)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calcPrecision()
double
calcRecall()
void
printFinal()
Prints the results of the correct set in a human-readable format.protected static boolean
shouldPrint(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns true if the pair of invariants should be printed.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
-
MatchCountVisitor
public MatchCountVisitor(PrintStream ps, boolean verbose, boolean printEmptyPpts)
-
-
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 classPrintAllVisitor
-
shouldPrint
@EnsuresNonNullIf(result=true, expression={"#1","#2"}) protected static boolean shouldPrint(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns true if the pair of invariants should be printed.
-
calcRecall
public double calcRecall()
-
calcPrecision
public double calcPrecision()
-
printFinal
public void printFinal()
Prints the results of the correct set in a human-readable format.
-
-