Package daikon.diff
Class DetailedStatisticsVisitor
- Object
-
- DepthFirstVisitor
-
- DetailedStatisticsVisitor
-
- All Implemented Interfaces:
Visitor
public class DetailedStatisticsVisitor extends DepthFirstVisitor
Computes statistics about the differences between the sets of invariants. The statistics can be printed as a human-readable table or a tab-separated list suitable for further processing.
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
ARITY_LABELS
A string representations for each arity.static Logger
debug
static int
NUM_ARITIES
The number of arities for invariants; equivalently, 1 more than the max arity.static int
NUM_RELATIONSHIPS
static int
REL_DIFF_JUST1_JUST2
static int
REL_DIFF_JUST1_UNJUST2
static int
REL_DIFF_UNJUST1_JUST2
static int
REL_DIFF_UNJUST1_UNJUST2
static int
REL_MISS_JUST1
static int
REL_MISS_JUST2
static int
REL_MISS_UNJUST1
static int
REL_MISS_UNJUST2
static int
REL_SAME_JUST1_JUST2
static int
REL_SAME_JUST1_UNJUST2
static int
REL_SAME_UNJUST1_JUST2
static int
REL_SAME_UNJUST1_UNJUST2
static String[]
RELATIONSHIP_LABELS
-
Constructor Summary
Constructors Constructor Description DetailedStatisticsVisitor(boolean continuousJustification)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
determineArity(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns the arity of the invariant pair.static int
determineRelationship(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns the relationship between the two invariants.String
format()
Returns a human-readable table of its data.double
freq(int arity, int relationship)
Returns the frequency of pairs of invariants we have seen with this arity and relationship.String
repr()
Returns a tab-separated listing of its data, suitable for post-processing.void
visit(InvNode node)
-
Methods inherited from class DepthFirstVisitor
visit, visit
-
-
-
-
Field Detail
-
NUM_ARITIES
public static final int NUM_ARITIES
The number of arities for invariants; equivalently, 1 more than the max arity.- See Also:
- Constant Field Values
-
ARITY_LABELS
public static final String[] ARITY_LABELS
A string representations for each arity. Length = NUM_ARITIES.
-
NUM_RELATIONSHIPS
public static final int NUM_RELATIONSHIPS
- See Also:
- Constant Field Values
-
REL_SAME_JUST1_JUST2
public static final int REL_SAME_JUST1_JUST2
- See Also:
- Constant Field Values
-
REL_SAME_JUST1_UNJUST2
public static final int REL_SAME_JUST1_UNJUST2
- See Also:
- Constant Field Values
-
REL_SAME_UNJUST1_JUST2
public static final int REL_SAME_UNJUST1_JUST2
- See Also:
- Constant Field Values
-
REL_SAME_UNJUST1_UNJUST2
public static final int REL_SAME_UNJUST1_UNJUST2
- See Also:
- Constant Field Values
-
REL_DIFF_JUST1_JUST2
public static final int REL_DIFF_JUST1_JUST2
- See Also:
- Constant Field Values
-
REL_DIFF_JUST1_UNJUST2
public static final int REL_DIFF_JUST1_UNJUST2
- See Also:
- Constant Field Values
-
REL_DIFF_UNJUST1_JUST2
public static final int REL_DIFF_UNJUST1_JUST2
- See Also:
- Constant Field Values
-
REL_DIFF_UNJUST1_UNJUST2
public static final int REL_DIFF_UNJUST1_UNJUST2
- See Also:
- Constant Field Values
-
REL_MISS_JUST1
public static final int REL_MISS_JUST1
- See Also:
- Constant Field Values
-
REL_MISS_UNJUST1
public static final int REL_MISS_UNJUST1
- See Also:
- Constant Field Values
-
REL_MISS_JUST2
public static final int REL_MISS_JUST2
- See Also:
- Constant Field Values
-
REL_MISS_UNJUST2
public static final int REL_MISS_UNJUST2
- See Also:
- Constant Field Values
-
RELATIONSHIP_LABELS
public static final String[] RELATIONSHIP_LABELS
-
-
Constructor Detail
-
DetailedStatisticsVisitor
public DetailedStatisticsVisitor(boolean continuousJustification)
-
-
Method Detail
-
visit
public void visit(InvNode node)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
determineArity
public static int determineArity(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns the arity of the invariant pair.
-
determineRelationship
public static int determineRelationship(@Nullable Invariant inv1, @Nullable Invariant inv2)
Returns the relationship between the two invariants. There are twelve possible relationships, described at the beginning of this file.
-
repr
public String repr()
Returns a tab-separated listing of its data, suitable for post-processing.
-
freq
public double freq(int arity, int relationship)
Returns the frequency of pairs of invariants we have seen with this arity and relationship. May be a non-integer, since we may be treating justification as a continuous value.
-
-