daikon.inv.binary.sequenceScalar
Class SequenceScalar

Object
  extended by Invariant
      extended by BinaryInvariant
          extended by SequenceScalar
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Member, SeqIntEqual, SeqIntGreaterEqual, SeqIntGreaterThan, SeqIntLessEqual, SeqIntLessThan

public abstract class SequenceScalar
extends BinaryInvariant

Abstract base class for comparing long sequences to long variables. Note that the sequence must always be passed in first.

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, isGuardingPredicate, min_mod_non_missing_samples, ppt, PROBABILITY_JUSTIFIED, PROBABILITY_NEVER, PROBABILITY_UNJUSTIFIED
 
Constructor Summary
protected SequenceScalar()
           
protected SequenceScalar(PptSlice ppt)
           
 
Method Summary
abstract  InvariantStatus add_modified(long[] v1, long v2, int count)
          This method need not check for falsified; that is done by the caller.
 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)
           
 boolean is_symmetric()
          Since the order is determined from the vars and the sequence is always first, this is essentially symmetric.
protected  Invariant resurrect_done_swapped()
          Since the order is determined from the vars and the sequence is always first, no permute is necesesary.
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)
          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.
protected  int scl_index()
           
 VarInfo sclvar()
           
 VarInfo sclvar(VarInfo[] vis)
          Return the scalar variable in the tuple whose VarInfos are corresponds to this.ppt.var_infos.
protected  boolean seq_first()
           
protected  int seq_index()
           
 VarInfo seqvar()
           
 VarInfo seqvar(VarInfo[] vis)
          Return the sequence variable in the tuple whose VarInfos are corresponds to this.ppt.var_infos.
 boolean valid_types(VarInfo[] vis)
          Returns whether or not the specified types are valid.
 
Methods inherited from class BinaryInvariant
add_unordered, check_unordered, find, get_swap
 
Methods inherited from class Invariant
add_sample, asInvClass, clear_falsified, clone_and_permute, clone, computeConfidence, conf_is_ge, confidence_and, confidence_and, confidence_or, createGuardedInvariant, createGuardingPredicate, enabled, enoughSamples, falsify, find, format_too_few_samples, format_unimplemented, format_using, format, formatFuzzy, get_comparability, get_ni_suppressions, getConfidence, getGuardingList, getGuardingList, hasUninterestingConstant, instantiate_dyn, instantiate_ok, instantiate, is_false, is_ni_suppressed, isActive, isAllPrestate, isExact, isExclusiveFormula, isInteresting, isObvious, isObviousDynamically_SomeInEquality, isObviousDynamically_SomeInEqualityHelper, isObviousDynamically, isObviousDynamically, isObviousStatically_AllInEquality, isObviousStatically_SomeInEquality, isObviousStatically_SomeInEqualityHelper, isObviousStatically, isObviousStatically, 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_prob, repr, resurrect, simplify_format_double, simplify_format_long, simplify_format_string, state_match, toString, toString, transfer, usesVar, usesVar, usesVarDerived, varNames
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceScalar

protected SequenceScalar(PptSlice ppt)

SequenceScalar

protected SequenceScalar()
Method Detail

valid_types

public boolean valid_types(VarInfo[] vis)
Returns whether or not the specified types are valid. All subclasses accept a scalar in one parameter and an array over the same scalar type in the other

Overrides:
valid_types in class Invariant
See Also:
Invariant.instantiate_ok(VarInfo[])

resurrect_done_swapped

protected Invariant resurrect_done_swapped()
Since the order is determined from the vars and the sequence is always first, no permute is necesesary. Subclasses can override if necessary


is_symmetric

public boolean is_symmetric()
Since the order is determined from the vars and the sequence is always first, this is essentially symmetric. Subclasses can override if necessary

Overrides:
is_symmetric in class BinaryInvariant

resurrect_done

protected Invariant resurrect_done(int[] permutation)
Description copied from class: Invariant
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.

Specified by:
resurrect_done in class Invariant

resurrect_done_unswapped

protected Invariant resurrect_done_unswapped()
Subclasses can override in the rare cases they need to fix things even when not swapped.


seq_first

protected final boolean seq_first()

seq_index

protected final int seq_index()

scl_index

protected final int scl_index()

seqvar

public VarInfo seqvar()

sclvar

public VarInfo sclvar()

seqvar

public VarInfo seqvar(VarInfo[] vis)
Return the sequence variable in the tuple whose VarInfos are corresponds to this.ppt.var_infos.


sclvar

public VarInfo sclvar(VarInfo[] vis)
Return the scalar variable in the tuple whose VarInfos are corresponds to this.ppt.var_infos.


check

public InvariantStatus check(Object val1,
                             Object val2,
                             int mod_index,
                             int count)
Specified by:
check in class BinaryInvariant

add

public InvariantStatus add(Object val1,
                           Object val2,
                           int mod_index,
                           int count)
Specified by:
add in class BinaryInvariant

check_modified

public abstract InvariantStatus check_modified(long[] v1,
                                               long v2,
                                               int count)

check_unmodified

public InvariantStatus check_unmodified(long[] v1,
                                        long v2,
                                        int count)

add_modified

public abstract InvariantStatus add_modified(long[] v1,
                                             long v2,
                                             int count)
This method need not check for falsified; that is done by the caller.


add_unmodified

public InvariantStatus add_unmodified(long[] v1,
                                      long v2,
                                      int count)
By default, do nothing if the value hasn't been seen yet. Subclasses can override this.