|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectInvariant
TernaryInvariant
ThreeScalar
LinearTernary
public class LinearTernary
Represents a Linear invariant over three long scalars x, y, and z, of the form ax + by + cz + d = 0. The constants a, b, c, and d are mutually relatively prime, and the constant a is always positive.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Invariant |
|---|
Invariant.ClassVarnameComparator, Invariant.ClassVarnameFormulaComparator, Invariant.InvariantComparatorForPrinting, Invariant.Match |
| Field Summary | |
|---|---|
LinearTernaryCore |
core
|
static boolean |
debugLinearTernary
|
static boolean |
dkconfig_enabled
Boolean. |
| Constructor Summary | |
|---|---|
protected |
LinearTernary()
|
protected |
LinearTernary(PptSlice ppt)
|
| Method Summary | |
|---|---|
InvariantStatus |
add_modified(long x,
long y,
long z,
int count)
This method need not check for falsified; that is done by the caller. |
InvariantStatus |
check_modified(long x,
long y,
long z,
int count)
|
LinearTernary |
clone()
Do nothing special, Overridden to remove exception from declaration |
protected double |
computeConfidence()
This method computes the confidence that this invariant occurred by chance. |
boolean |
enabled()
returns whether or not this invariant is enabled |
boolean |
enoughSamples()
|
static LinearTernary |
find(PptSlice ppt)
|
static Vector<LinearTernary> |
findAll(VarInfo vi)
|
String |
format_using(OutputFormat format)
|
static LinearTernary |
get_proto()
Returns the prototype invariant for LinearTernary |
LinearTernary |
instantiate_dyn(PptSlice slice)
Instantiate the invariant on the specified slice |
boolean |
instantiate_ok(VarInfo[] vis)
LinearTernary is only valid on non-constant integral types |
boolean |
isActive()
Returns whether or not the invariant is currently active. |
boolean |
isExact()
Subclasses should override. |
boolean |
isExclusiveFormula(Invariant other)
|
DiscardInfo |
isObviousDynamically(VarInfo[] vis)
Return non-null if this invariant is necessarily true from a fact that can be determined dynamically (after checking data) -- for the given varInfos rather than the varInfos of this. |
boolean |
isSameFormula(Invariant other)
|
Invariant |
merge(List<Invariant> invs,
PptSlice parent_ppt)
Merge the invariants in invs to form a new invariant. |
boolean |
mergeFormulasOk()
Returns whether or not it is possible to merge invariants of the same class but with different formulas when combining invariants from lower ppts to build invariants at upper program points. |
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. |
InvariantStatus |
setup(LinearBinary lb,
VarInfo con_var,
long con_val)
|
InvariantStatus |
setup(OneOfScalar oo,
VarInfo v1,
long con1,
VarInfo v2,
long con2)
|
| Methods inherited from class ThreeScalar |
|---|
add_unmodified, add, check_unmodified, check, valid_types, var1, var2, var3 |
| Methods inherited from class Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean dkconfig_enabled
public static final boolean debugLinearTernary
public LinearTernaryCore core
| Constructor Detail |
|---|
protected LinearTernary(PptSlice ppt)
protected LinearTernary()
| Method Detail |
|---|
public static LinearTernary get_proto()
public boolean enabled()
enabled in class Invariantpublic boolean instantiate_ok(VarInfo[] vis)
instantiate_ok in class InvariantInvariant.valid_types(VarInfo[])public LinearTernary instantiate_dyn(PptSlice slice)
instantiate_dyn in class Invariantpublic LinearTernary clone()
Invariant
clone in class Invariantprotected Invariant resurrect_done(int[] permutation)
Invariant
resurrect_done in class TernaryInvariantpublic String repr()
Invariant
repr in class Invariantpublic String format_using(OutputFormat format)
format_using in class Invariantpublic boolean isActive()
Invariant
isActive in class Invariant
public InvariantStatus setup(LinearBinary lb,
VarInfo con_var,
long con_val)
public InvariantStatus setup(OneOfScalar oo,
VarInfo v1,
long con1,
VarInfo v2,
long con2)
public InvariantStatus check_modified(long x,
long y,
long z,
int count)
check_modified in class ThreeScalar
public InvariantStatus add_modified(long x,
long y,
long z,
int count)
ThreeScalar
add_modified in class ThreeScalarpublic boolean enoughSamples()
enoughSamples in class Invariantprotected double computeConfidence()
Invariant
computeConfidence in class InvariantInvariant.getConfidence()public boolean isExact()
Invariant
isExact in class Invariantpublic DiscardInfo isObviousDynamically(VarInfo[] vis)
Invariant
isObviousDynamically in class Invariantpublic boolean isSameFormula(Invariant other)
isSameFormula in class Invariantpublic boolean isExclusiveFormula(Invariant other)
isExclusiveFormula in class Invariantpublic static LinearTernary find(PptSlice ppt)
public static Vector<LinearTernary> findAll(VarInfo vi)
public boolean mergeFormulasOk()
Invariant
mergeFormulasOk in class Invariant
public Invariant merge(List<Invariant> invs,
PptSlice parent_ppt)
merge in class Invariantinvs - List of invariants to merge. They should all be
permuted to match the variable order in parent_ppt.parent_ppt - Slice that will contain the new invariant
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||