Package daikon.derive.unary
Class UnaryDerivation
- Object
-
- Derivation
-
- UnaryDerivation
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
SequenceInitial
,SequenceInitialFloat
,SequenceLength
,SequenceMax
,SequenceMin
,SequenceSum
,StringLength
public abstract class UnaryDerivation extends Derivation
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description VarInfo
base
-
Fields inherited from class Derivation
debug, dkconfig_disable_derived_variables, missing_array_bounds
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UnaryDerivation(VarInfo vi)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description VarInfo
base()
boolean
canBeMissing()
SeeVarInfo.canBeMissing
.UnaryDerivation
clone()
ValueAndModified
computeValueAndModified(ValueTuple vt)
Returns a pair of: the derived value and whether the variable counts as modified.protected abstract ValueAndModified
computeValueAndModifiedImpl(ValueTuple vt)
Actual implementation once mods are handled.int
derivedDepth()
Returns how many levels of derivation this Derivation is based on.VarInfo
getBase(int i)
Returns thei
th VarInfo this was derived from.VarInfo[]
getBases()
Returns array of the VarInfos this was derived from.boolean
isDerivedFromNonCanonical()
protected boolean
isParam()
Derivation
switchVars(VarInfo[] old_vars, VarInfo[] new_vars)
-
Methods inherited from class Derivation
complexity, csharp_name, esc_name, get_array_var, get_lower_bound, get_upper_bound, getVarInfo, inside_csharp_name, inside_esc_name, inside_jml_name, is_prestate_version, isSameFormula, jml_name, makeVarInfo, makeVarInfo_common_setup, missingOutOfBounds, shift_str, simplify_name
-
-
-
-
Constructor Detail
-
UnaryDerivation
protected UnaryDerivation(VarInfo vi)
-
-
Method Detail
-
clone
@SideEffectFree public UnaryDerivation clone(@GuardSatisfied UnaryDerivation this)
-
switchVars
public Derivation switchVars(VarInfo[] old_vars, VarInfo[] new_vars)
- Specified by:
switchVars
in classDerivation
-
computeValueAndModified
public ValueAndModified computeValueAndModified(ValueTuple vt)
Description copied from class:Derivation
Returns a pair of: the derived value and whether the variable counts as modified.- Specified by:
computeValueAndModified
in classDerivation
- Parameters:
vt
- the set of values in a program point that will be used to derive the value- Returns:
- a pair of: the derived value and whether the variable counts as modified
-
computeValueAndModifiedImpl
protected abstract ValueAndModified computeValueAndModifiedImpl(ValueTuple vt)
Actual implementation once mods are handled.
-
getBases
@SideEffectFree public VarInfo[] getBases()
Description copied from class:Derivation
Returns array of the VarInfos this was derived from.- Specified by:
getBases
in classDerivation
- Returns:
- array of the VarInfos this was derived from
-
getBase
@Pure public VarInfo getBase(int i)
Description copied from class:Derivation
Returns thei
th VarInfo this was derived from.- Specified by:
getBase
in classDerivation
- Parameters:
i
- index into the array of Varinfos this was derived from- Returns:
- the
i
th VarInfo this was derived from
-
isParam
@Pure protected boolean isParam()
- Specified by:
isParam
in classDerivation
-
isDerivedFromNonCanonical
@Pure public boolean isDerivedFromNonCanonical()
- Specified by:
isDerivedFromNonCanonical
in classDerivation
-
derivedDepth
public int derivedDepth()
Description copied from class:Derivation
Returns how many levels of derivation this Derivation is based on. The depth counts this as well as the depths of its bases.- Specified by:
derivedDepth
in classDerivation
-
canBeMissing
public boolean canBeMissing()
Description copied from class:Derivation
SeeVarInfo.canBeMissing
.- Specified by:
canBeMissing
in classDerivation
- See Also:
VarInfo.canBeMissing
-
-