Package daikon.derive.binary
Class BinaryDerivation
- Object
-
- Derivation
-
- BinaryDerivation
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
SequenceFloatIntersection
,SequenceFloatSubscript
,SequenceFloatUnion
,SequenceScalarIntersection
,SequenceScalarSubscript
,SequenceScalarUnion
,SequencesConcat
,SequencesJoin
,SequencesJoinFloat
,SequencesPredicate
,SequencesPredicateFloat
,SequenceStringIntersection
,SequenceStringSubscript
,SequenceStringUnion
,SequenceSubsequence
public abstract class BinaryDerivation extends Derivation
Abstract class to represent a derived variable that came from two base variables.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description VarInfo
base1
Original variable 1.VarInfo
base2
Original variable 2.-
Fields inherited from class Derivation
debug, dkconfig_disable_derived_variables, missing_array_bounds
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BinaryDerivation(VarInfo vi1, VarInfo vi2)
Create a new BinaryDerivation from two varinfos.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canBeMissing()
SeeVarInfo.canBeMissing
.BinaryDerivation
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)
VarInfo
var1()
VarInfo
var2()
-
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
-
BinaryDerivation
protected BinaryDerivation(VarInfo vi1, VarInfo vi2)
Create a new BinaryDerivation from two varinfos.- Parameters:
vi1
- original variable 1vi2
- original variable 2
-
-
Method Detail
-
clone
@SideEffectFree public BinaryDerivation clone(@GuardSatisfied BinaryDerivation this)
-
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
-
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.
-
isParam
@Pure protected boolean isParam()
- Specified by:
isParam
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
-
isDerivedFromNonCanonical
@Pure public boolean isDerivedFromNonCanonical()
- Specified by:
isDerivedFromNonCanonical
in classDerivation
-
-