Package daikon.inv.binary
Class BinaryInvariant
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
SequenceFloat
,SequenceScalar
,SequenceString
,TwoFloat
,TwoScalar
,TwoSequence
,TwoSequenceFloat
,TwoSequenceString
,TwoString
public abstract class BinaryInvariant extends Invariant
Provides a class that defines the functions that must exist for each two variable invariant.- 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
checkedMergeOverridden, 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
BinaryInvariant()
protected
BinaryInvariant(PptSlice ppt)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract InvariantStatus
add(@Interned Object val1, @Interned Object val2, int mod_index, int count)
InvariantStatus
add_unordered(@Interned Object val1, @Interned Object val2, int mod_index, int count)
Applies the variables in the correct order.abstract InvariantStatus
check(@Interned Object val1, @Interned Object val2, int mod_index, int count)
InvariantStatus
check_unordered(@Interned Object val1, @Interned Object val2, int mod_index, int count)
Checks the specified values in the correct order.protected @Nullable Invariant
find(Class<? extends Invariant> cls, VarInfo v1, VarInfo v2)
Searches for the specified binary invariant (by class) in the specified slice.boolean
get_swap()
Returns the swap setting for invariants that support a swap boolean to handle different permutations.boolean
is_symmetric()
Returns true if the binary function is symmetric (x,y ⇒ y,x).-
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, resurrect_done, simplify_format_double, simplify_format_long, simplify_format_string, state_match, toString, toString, transfer, usesVar, usesVar, usesVarDerived, valid_types, varNames
-
-
-
-
Constructor Detail
-
BinaryInvariant
protected BinaryInvariant(PptSlice ppt)
-
BinaryInvariant
protected BinaryInvariant()
-
-
Method Detail
-
check
public abstract InvariantStatus check(@Interned Object val1, @Interned Object val2, int mod_index, int count)
-
add
public abstract InvariantStatus add(@Interned Object val1, @Interned Object val2, int mod_index, int count)
-
add_unordered
public InvariantStatus add_unordered(@Interned Object val1, @Interned Object val2, int mod_index, int count)
Applies the variables in the correct order. If the second variable is an array and the first variable is not, the order of the values is reversed (so that the array is always the first argument).
-
check_unordered
public InvariantStatus check_unordered( BinaryInvariant this, @Interned Object val1, @Interned Object val2, int mod_index, int count)
Checks the specified values in the correct order. If the second value is an array and the first value is not, the order of the values is reversed (so that the array is always the first argument).The values are checked rather than the variables because this is sometimes called on prototype invariants.
-
is_symmetric
@Pure public boolean is_symmetric()
Returns true if the binary function is symmetric (x,y ⇒ y,x). Subclasses that are symmetric should override.
-
get_swap
public boolean get_swap()
Returns the swap setting for invariants that support a swap boolean to handle different permutations. This version should never be called.
-
-