Package daikon.inv.ternary.threeScalar
Class ThreeScalar
- Object
-
- Invariant
-
- TernaryInvariant
-
- ThreeScalar
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
FunctionBinary
,LinearTernary
public abstract class ThreeScalar extends TernaryInvariant
Abstract base class for invariants over three numeric variables. An example isz = ax + by + c
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class Invariant
Invariant.ClassVarnameComparator, Invariant.ClassVarnameFormulaComparator, Invariant.InvariantComparatorForPrinting, Invariant.Match
-
-
Field Summary
-
Fields inherited from class Invariant
CONFIDENCE_JUSTIFIED, CONFIDENCE_NEVER, CONFIDENCE_UNJUSTIFIED, debug, debugFlow, debugGuarding, debugIsObvious, debugIsWorthPrinting, debugPrint, debugPrintEquality, dkconfig_confidence_limit, dkconfig_fuzzy_ratio, dkconfig_simplify_define_predicates, falsified, invariantEnabledDefault, isGuardingPredicate, min_mod_non_missing_samples, ppt, PROBABILITY_JUSTIFIED, PROBABILITY_NEVER, PROBABILITY_UNJUSTIFIED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ThreeScalar()
protected
ThreeScalar(PptSlice ppt)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description InvariantStatus
add(@Interned Object val1, @Interned Object val2, @Interned Object val3, int mod_index, int count)
abstract InvariantStatus
add_modified(long v1, long v2, long v3, int count)
Similar tocheck_modified(long, long, long, int)
except that it can change the state of the invariant if necessary.InvariantStatus
add_unmodified(long v1, long v2, long v3, int count)
By default, do nothing if the value hasn't been seen yet.InvariantStatus
check(@Interned Object val1, @Interned Object val2, @Interned Object val3, int mod_index, int count)
abstract InvariantStatus
check_modified(long v1, long v2, long v3, int count)
Presents a sample to the invariant.InvariantStatus
check_unmodified(long v1, long v2, long v3, int count)
boolean
valid_types(VarInfo[] vis)
Returns whether or not the specified types are valid.VarInfo
var1()
VarInfo
var2()
VarInfo
var3()
-
Methods inherited from class TernaryInvariant
resurrect_done
-
Methods inherited from class Invariant
add_sample, asInvClass, checkRep, clear_falsified, clone, clone_and_permute, computeConfidence, conf_is_ge, confidence_and, confidence_and, confidence_or, createGuardedInvariant, createGuardingPredicate, enabled, enoughSamples, falsify, find, format, format_classname, format_too_few_samples, format_unimplemented, format_using, formatFuzzy, get_comparability, get_ni_suppressions, getConfidence, getGuardingList, getGuardingList, hasUninterestingConstant, instantiate, instantiate_dyn, instantiate_ok, is_false, is_ni_suppressed, isActive, isAllPrestate, isEqualityComparison, isExact, isExclusiveFormula, isObvious, isObviousDynamically, isObviousDynamically, isObviousDynamically_SomeInEquality, isObviousDynamically_SomeInEqualityHelper, isObviousStatically, isObviousStatically, isObviousStatically_AllInEquality, isObviousStatically_SomeInEquality, isObviousStatically_SomeInEqualityHelper, isReflexive, isSameFormula, isSameInvariant, isValidEscExpression, isValidExpression, isWorthPrinting, justified, log, log, logDetail, logOn, match, merge, mergeFormulasOk, permute, prob_and, prob_and, prob_is_ge, prob_or, repCheck, repr, repr_prob, resurrect, simplify_format_double, simplify_format_long, simplify_format_string, state_match, toString, toString, transfer, usesVar, usesVar, usesVarDerived, varNames
-
-
-
-
Constructor Detail
-
ThreeScalar
protected ThreeScalar(PptSlice ppt)
-
ThreeScalar
protected ThreeScalar()
-
-
Method Detail
-
valid_types
public final boolean valid_types(VarInfo[] vis)
Returns whether or not the specified types are valid.- Specified by:
valid_types
in classInvariant
- See Also:
Invariant.instantiate_ok(VarInfo[])
-
check
public InvariantStatus check(@Interned Object val1, @Interned Object val2, @Interned Object val3, int mod_index, int count)
- Specified by:
check
in classTernaryInvariant
-
add
public InvariantStatus add(@Interned Object val1, @Interned Object val2, @Interned Object val3, int mod_index, int count)
- Specified by:
add
in classTernaryInvariant
-
check_modified
public abstract InvariantStatus check_modified(long v1, long v2, long v3, int count)
Presents a sample to the invariant. Returns whether the sample is consistent with the invariant. Does not change the state of the invariant.- Parameters:
count
- how many identical samples were observed in a row. For example, three calls to check_modified with a count parameter of 1 is equivalent to one call to check_modified with a count parameter of 3.- Returns:
- whether or not the sample is consistent with the invariant
-
check_unmodified
public InvariantStatus check_unmodified(long v1, long v2, long v3, int count)
-
add_modified
public abstract InvariantStatus add_modified(long v1, long v2, long v3, int count)
Similar tocheck_modified(long, long, long, int)
except that it can change the state of the invariant if necessary. If the invariant doesn't have any state, then the implementation should simply callcheck_modified(long, long, long, int)
. This method need not check for falsification; that is done by the caller.
-
add_unmodified
public InvariantStatus add_unmodified(long v1, long v2, long v3, int count)
By default, do nothing if the value hasn't been seen yet. Subclasses can override this.
-
-