|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectInvariant
Equality
public final class Equality
Keeps track of sets of variables that are equal. Other invariants are instantiated for only one member of the Equality set, the leader. If variables x, y, and z are members of the Equality set and x is chosen as the leader, then the Equality will internally convert into binary comparison invariants that print as x == y and x == z.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Invariant |
|---|
Invariant.ClassVarnameComparator, Invariant.ClassVarnameFormulaComparator, Invariant.InvariantComparatorForPrinting, Invariant.Match |
| Field Summary | |
|---|---|
static Logger |
debug
|
static Logger |
debugPostProcess
|
| Constructor Summary | |
|---|---|
Equality(Collection<VarInfo> variables,
PptSlice ppt)
|
|
| Method Summary | |
|---|---|
List<VarInfo> |
add(ValueTuple vt,
int count)
|
double |
computeConfidence()
Always return JUSTIFIED because we aggregate Comparison invariants that are all justified to the confidence_limit threshold. |
String |
format_daikon()
|
String |
format_esc()
|
String |
format_java_family(OutputFormat format)
|
String |
format_java()
|
String |
format_simplify()
|
String |
format_using(OutputFormat format)
|
Set<VarInfo> |
getVars()
Returns the variables in their index order. |
boolean |
hasNonCanonicalVariable()
|
boolean |
isSameFormula(Invariant other)
|
VarInfo |
leader()
Return the canonical VarInfo of this. |
int |
numSamples()
|
void |
pivot()
Switch the leader of this invariant, if possible, to a more canonical VarInfo: a VarInfo that is not isDerived() is better than one that is; one that is not isDerivedParamAndUninteresting() is better than one that is; and other things being equal, choose the least complex name. |
void |
postProcess()
Convert Equality invariants into normal IntEqual type for filtering, printing, etc. |
void |
repCheck()
Check the rep invariants of this. |
String |
repr()
For printing invariants, there are two interfaces: repr gives a low-level representation (repr_prop also prints the confidence), and format gives a high-level representation for user output. |
protected Invariant |
resurrect_done(int[] permutation)
Called on the new invariant just before resurrect() returns it to allow subclasses to fix any information they might have cached from the old Ppt and VarInfos. |
void |
setSamples(int sample_cnt)
|
String |
shortString()
|
int |
size()
Returns the number of variables in the set. |
String |
toString()
|
| Methods inherited from class Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Logger debug
public static final Logger debugPostProcess
| Constructor Detail |
|---|
public Equality(Collection<VarInfo> variables,
PptSlice ppt)
variables - Variables which are equivalent, with the canonical
one first. Elements must be of type VarInfo.| Method Detail |
|---|
public void setSamples(int sample_cnt)
public int numSamples()
public int size()
public Set<VarInfo> getVars()
public VarInfo leader()
public boolean hasNonCanonicalVariable()
public double computeConfidence()
computeConfidence in class InvariantInvariant.getConfidence()public String repr()
Invariant
repr in class Invariantpublic String format_using(OutputFormat format)
format_using in class Invariantpublic String format_daikon()
public String format_java()
public String format_esc()
public String format_simplify()
public String shortString()
public String format_java_family(OutputFormat format)
public String toString()
toString in class Invariant
public List<VarInfo> add(ValueTuple vt,
int count)
protected Invariant resurrect_done(int[] permutation)
Invariant
resurrect_done in class Invariantpublic boolean isSameFormula(Invariant other)
isSameFormula in class Invariantpublic void postProcess()
public void pivot()
public void repCheck()
Invariant
repCheck in class Invariant
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||