|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectInvariant
BinaryInvariant
TwoSequence
public abstract class TwoSequence
Base class for two variable long[] invariants. Provides a simpler mechanism for non-symmetric invariants to function over both permutations of their variables. Non-symmetric invariants must instantiate two objects (one for each argument order). This is tracked by the variable swap. They must always access their variables via the methods var1() and var2() which return the correct variable (based on the swap setting). No other work is necessary, all permuations and resurrection is handled here. Symmetric invariants should define symmetric() to return true or override resurrect_done_swapped to do nothing. Non-symmetric invariants that use converse operations (eg, less than and greater than) rather than argument swapping should override resurrect_done_swapped to return the correct class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Invariant |
|---|
Invariant.ClassVarnameComparator, Invariant.ClassVarnameFormulaComparator, Invariant.InvariantComparatorForPrinting, Invariant.Match |
| Field Summary | |
|---|---|
protected boolean |
swap
|
| Constructor Summary | |
|---|---|
protected |
TwoSequence()
|
protected |
TwoSequence(PptSlice ppt)
|
| Method Summary | |
|---|---|
InvariantStatus |
add_modified(long[] v1,
long[] v2,
int count)
Default implementation simply calls check. |
InvariantStatus |
add_unmodified(long[] v1,
long[] v2,
int count)
By default, do nothing if the value hasn't been seen yet. |
InvariantStatus |
add(Object val1,
Object val2,
int mod_index,
int count)
|
abstract InvariantStatus |
check_modified(long[] v1,
long[] v2,
int count)
|
InvariantStatus |
check_unmodified(long[] v1,
long[] v2,
int count)
|
InvariantStatus |
check(Object val1,
Object val2,
int mod_index,
int count)
|
protected double |
computeConfidence()
This method computes the confidence that this invariant occurred by chance. |
boolean |
get_swap()
Returns whether or not the variable order is currently swapped for this invariant. |
boolean |
isSameFormula(Invariant other)
Return true if both invariants are the same class and the order of the variables (swap) is the same. |
String |
repr()
Returns a representation of the class. |
protected Invariant |
resurrect_done_swapped()
Swaps the variables by inverting the state of swap. |
protected Invariant |
resurrect_done_unswapped()
Subclasses can override in the rare cases they need to fix things even when not swapped. |
protected Invariant |
resurrect_done(int[] permutation)
Checks to see if the variable order was swapped and calls the correct routine to handle it. |
boolean |
valid_types(VarInfo[] vis)
Returns whether or not the specified types are valid |
VarInfo |
var1()
Returns the first variable. |
VarInfo |
var1(VarInfo[] vis)
Returns the first variable from the specified vis. |
VarInfo |
var2()
Returns the first variable. |
VarInfo |
var2(VarInfo[] vis)
Returns the first variable in the specified vis. |
| Methods inherited from class BinaryInvariant |
|---|
add_unordered, check_unordered, find, is_symmetric |
| Methods inherited from class Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean swap
| Constructor Detail |
|---|
protected TwoSequence(PptSlice ppt)
protected TwoSequence()
| Method Detail |
|---|
public final boolean valid_types(VarInfo[] vis)
valid_types in class InvariantInvariant.instantiate_ok(VarInfo[])public boolean get_swap()
get_swap in class BinaryInvariantprotected Invariant resurrect_done(int[] permutation)
resurrect_done in class Invariantprotected Invariant resurrect_done_swapped()
protected Invariant resurrect_done_unswapped()
public VarInfo var1()
public VarInfo var2()
public VarInfo var1(VarInfo[] vis)
public VarInfo var2(VarInfo[] vis)
public InvariantStatus check(Object val1,
Object val2,
int mod_index,
int count)
check in class BinaryInvariant
public InvariantStatus add(Object val1,
Object val2,
int mod_index,
int count)
add in class BinaryInvariant
public abstract InvariantStatus check_modified(long[] v1,
long[] v2,
int count)
public InvariantStatus check_unmodified(long[] v1,
long[] v2,
int count)
public InvariantStatus add_modified(long[] v1,
long[] v2,
int count)
public InvariantStatus add_unmodified(long[] v1,
long[] v2,
int count)
public String repr()
repr in class Invariantpublic boolean isSameFormula(Invariant other)
isSameFormula in class Invariantprotected double computeConfidence()
Invariant
computeConfidence in class InvariantInvariant.getConfidence()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||