|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectInvariant
BinaryInvariant
TwoScalar
NumericInt
public abstract class NumericInt
Baseclass for binary numeric invariants. Each specific invariant is implemented in a subclass (typically, in this file). The subclass must provide the methods instantiate(), check(), and format(). Symmetric functions should define is_symmetric() to return true.
| Nested Class Summary | |
|---|---|
static class |
NumericInt.BitwiseAndZero
Represents the BitwiseAnd == 0 invariant between two long scalars; that is, x and y have no bits in common. |
static class |
NumericInt.BitwiseComplement
Represents the bitwise complement invariant between two long scalars. |
static class |
NumericInt.BitwiseSubset
Represents the bitwise subset invariant between two long scalars; that is, the bits of y are a subset of the bits of x. |
static class |
NumericInt.Divides
Represents the divides without remainder invariant between two long scalars. |
static class |
NumericInt.ShiftZero
Represents the ShiftZero invariant between two long scalars; that is, x right-shifted by y is always zero. |
static class |
NumericInt.Square
Represents the square invariant between two long scalars. |
static class |
NumericInt.ZeroTrack
Represents the zero tracks invariant between two long scalars; that is, when x is zero, y is also zero. |
| Nested classes/interfaces inherited from class Invariant |
|---|
Invariant.ClassVarnameComparator, Invariant.ClassVarnameFormulaComparator, Invariant.InvariantComparatorForPrinting, Invariant.Match |
| Field Summary | |
|---|---|
protected static NISuppressor |
var1_eq_0
|
protected static NISuppressor |
var1_eq_1
|
protected static NISuppressor |
var1_eq_minus_1
|
protected static NISuppressor |
var1_eq_var2
|
protected static NISuppressor |
var1_ge_0
|
protected static NISuppressor |
var1_le_var2
|
protected static NISuppressor |
var1_ne_0
|
protected static NISuppressor |
var2_eq_0
|
protected static NISuppressor |
var2_eq_1
|
protected static NISuppressor |
var2_eq_minus_1
|
protected static NISuppressor |
var2_eq_var1
|
protected static NISuppressor |
var2_ge_0
|
protected static NISuppressor |
var2_ne_0
|
protected static NISuppressor |
var2_valid_shift
|
| Fields inherited from class TwoScalar |
|---|
swap |
| Constructor Summary | |
|---|---|
protected |
NumericInt(boolean swap)
|
protected |
NumericInt(PptSlice ppt,
boolean swap)
|
| Method Summary | |
|---|---|
InvariantStatus |
check_modified(long x,
long y,
int count)
Calls the function specific equal check and returns the correct status. |
abstract boolean |
eq_check(long x,
long y)
Returns true if x and y don't invalidate the invariant. |
String |
format_using(OutputFormat format)
Returns a string in the specified format that describes the invariant. |
abstract String |
get_format_str(OutputFormat format)
Return a format string for the specified output format. |
static List<Invariant> |
get_proto_all()
|
boolean |
instantiate_ok(VarInfo[] vis)
Returns true if it is ok to instantiate a numeric invariant over the specified slice. |
DiscardInfo |
is_subscript(VarInfo[] vis)
Checks to see if 'x[a] op y[b]' where 'x[] op y[]' and 'a == b'. |
boolean |
isExact()
Subclasses should override. |
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. |
InvDef[][] |
obvious_checks(VarInfo[] vis)
Returns an array of arrays of antecedents. |
String |
repr()
Returns a representation of the class. |
| Methods inherited from class TwoScalar |
|---|
add_modified, add_unmodified, add, check_unmodified, check, computeConfidence, get_swap, isSameFormula, resurrect_done_swapped, resurrect_done_unswapped, resurrect_done, valid_types, var1, var1, var2, var2 |
| 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 static NISuppressor var1_eq_0
protected static NISuppressor var2_eq_0
protected static NISuppressor var1_ge_0
protected static NISuppressor var2_ge_0
protected static NISuppressor var1_eq_1
protected static NISuppressor var2_eq_1
protected static NISuppressor var1_eq_minus_1
protected static NISuppressor var2_eq_minus_1
protected static NISuppressor var1_ne_0
protected static NISuppressor var2_ne_0
protected static NISuppressor var1_le_var2
protected static NISuppressor var1_eq_var2
protected static NISuppressor var2_eq_var1
protected static NISuppressor var2_valid_shift
| Constructor Detail |
|---|
protected NumericInt(PptSlice ppt,
boolean swap)
protected NumericInt(boolean swap)
| Method Detail |
|---|
public boolean instantiate_ok(VarInfo[] vis)
instantiate_ok in class InvariantInvariant.valid_types(VarInfo[])public boolean isExact()
Invariant
isExact in class Invariantpublic String repr()
TwoScalar
repr in class TwoScalarpublic String format_using(OutputFormat format)
format_using in class Invariant
public InvariantStatus check_modified(long x,
long y,
int count)
check_modified in class TwoScalarpublic DiscardInfo is_subscript(VarInfo[] vis)
public DiscardInfo isObviousDynamically(VarInfo[] vis)
Invariant
isObviousDynamically in class Invariantpublic abstract String get_format_str(OutputFormat format)
public abstract boolean eq_check(long x,
long y)
public InvDef[][] obvious_checks(VarInfo[] vis)
public static List<Invariant> get_proto_all()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||