daikon.diff
Class DetailedStatisticsVisitor

Object
  extended by DepthFirstVisitor
      extended by 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
static Logger debug
           
static int NUM_RELATIONSHIPS
           
static int NUM_TYPES
           
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
           
static int TYPE_BINARY
           
static String[] TYPE_LABELS
           
static int TYPE_NULLARY_INTERESTING
           
static int TYPE_NULLARY_UNINTERESTING
           
static int TYPE_TERNARY
           
static int TYPE_UNARY_INTERESTING
           
static int TYPE_UNARY_UNINTERESTING
           
 
Constructor Summary
DetailedStatisticsVisitor(boolean continuousJustification)
           
 
Method Summary
static int determineRelationship(Invariant inv1, Invariant inv2)
          Returns the relationship between the two invariants.
static int determineType(Invariant inv1, Invariant inv2)
          Returns the type of the invariant pair.
 String format()
          Returns a human-readable table of its data.
 double freq(int type, int relationship)
          Returns the frequency of pairs of invariants we have seen with this type 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
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final Logger debug

NUM_TYPES

public static final int NUM_TYPES
See Also:
Constant Field Values

TYPE_NULLARY_INTERESTING

public static final int TYPE_NULLARY_INTERESTING
See Also:
Constant Field Values

TYPE_NULLARY_UNINTERESTING

public static final int TYPE_NULLARY_UNINTERESTING
See Also:
Constant Field Values

TYPE_UNARY_INTERESTING

public static final int TYPE_UNARY_INTERESTING
See Also:
Constant Field Values

TYPE_UNARY_UNINTERESTING

public static final int TYPE_UNARY_UNINTERESTING
See Also:
Constant Field Values

TYPE_BINARY

public static final int TYPE_BINARY
See Also:
Constant Field Values

TYPE_TERNARY

public static final int TYPE_TERNARY
See Also:
Constant Field Values

TYPE_LABELS

public static final String[] TYPE_LABELS

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 interface Visitor
Overrides:
visit in class DepthFirstVisitor

determineType

public static int determineType(Invariant inv1,
                                Invariant inv2)
Returns the type of the invariant pair. The type consists of the number of variables (0,1,2,3) and whether the pair is interesting or not. A pair is interesting if at least one invariant is interesting.


determineRelationship

public static int determineRelationship(Invariant inv1,
                                        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.


format

public String format()
Returns a human-readable table of its data.


freq

public double freq(int type,
                   int relationship)
Returns the frequency of pairs of invariants we have seen with this type and relationship. May be a non-integer, since we may be treating justification as a continuous value.