V
- type of the abstract value that is trackedS
- the store type used in the analysispublic class TransferInput<V extends AbstractValue<V>,S extends Store<S>> extends Object implements org.plumelib.util.UniqueId
TransferInput
is used as the input type of the individual transfer functions of a ForwardTransferFunction
or a BackwardTransferFunction
. It also contains a reference to
the node for which the transfer function will be applied.
A TransferInput
contains one or two stores. If two stores are present, one belongs to
'then', and the other to 'else'.
Modifier and Type | Field and Description |
---|---|
protected Analysis<V,S,?> |
analysis
The corresponding analysis class to get intermediate flow results.
|
protected S |
elseStore
The 'else' result store (or
null if none is present). |
protected @Nullable Node |
node
The corresponding node.
|
protected S |
store
|
protected S |
thenStore
The 'then' result store (or
null if none is present). |
Modifier | Constructor and Description |
---|---|
|
TransferInput(@Nullable Node n,
Analysis<V,S,?> analysis,
S s)
Create a
TransferInput , given a store and a node-value mapping. |
|
TransferInput(@Nullable Node n,
Analysis<V,S,?> analysis,
S s1,
S s2)
Create a
TransferInput , given two stores and a node-value mapping. |
|
TransferInput(Node n,
Analysis<V,S,?> analysis,
TransferResult<V,S> to)
Create a
TransferInput , given a TransferResult and a node-value mapping. |
protected |
TransferInput(TransferInput<V,S> from)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsTwoStores()
Returns
true if and only if this transfer input contains two stores that are
potentially not equal. |
TransferInput<V,S> |
copy()
Returns an exact copy of this store.
|
boolean |
equals(@Nullable Object o) |
S |
getElseStore()
Returns the result store produced if the
Node this result belongs to evaluates to
false . |
@Nullable Node |
getNode()
Returns the
Node for this TransferInput . |
S |
getRegularStore()
Returns the regular result store produced if no exception is thrown by the
Node
corresponding to this transfer function result. |
S |
getThenStore()
Returns the result store produced if the
Node this result belongs to evaluates to
true . |
long |
getUid() |
V |
getValueOfSubNode(Node n)
Returns the abstract value of node
n , which is required to be a 'sub-node' (that is,
a direct or indirect child) of the node this transfer input is associated with. |
int |
hashCode() |
TransferInput<V,S> |
leastUpperBound(TransferInput<V,S> other)
Compute the least upper bound of two stores.
|
String |
toString() |
protected final S extends Store<S> thenStore
null
if none is present). See invariant at store
.protected final S extends Store<S> elseStore
null
if none is present). See invariant at store
.public TransferInput(Node n, Analysis<V,S,?> analysis, TransferResult<V,S> to)
TransferInput
, given a TransferResult
and a node-value mapping.
Aliasing: The stores returned by any methods of to
will be stored
internally and are not allowed to be used elsewhere. Full control of them is transferred to
this object.
The node-value mapping nodeValues
is provided by the analysis and is only read
from within this TransferInput
.
public TransferInput(@Nullable Node n, Analysis<V,S,?> analysis, S s)
TransferInput
, given a store and a node-value mapping.
Aliasing: The store s
will be stored internally and is not allowed to be
used elsewhere. Full control over s
is transferred to this object.
The node-value mapping nodeValues
is provided by the analysis and is only read
from within this TransferInput
.
public TransferInput(@Nullable Node n, Analysis<V,S,?> analysis, S s1, S s2)
TransferInput
, given two stores and a node-value mapping.
Aliasing: The two stores s1
and s2
will be stored internally and
are not allowed to be used elsewhere. Full control of them is transferred to this object.
protected TransferInput(TransferInput<V,S> from)
from
- a TransferInput
to copypublic long getUid(@UnknownInitialization TransferInput<V extends AbstractValue<V>,S extends Store<S>> this)
getUid
in interface org.plumelib.util.UniqueId
public @Nullable Node getNode()
Node
for this TransferInput
.Node
for this TransferInput
public V getValueOfSubNode(Node n)
n
, which is required to be a 'sub-node' (that is,
a direct or indirect child) of the node this transfer input is associated with. Furthermore,
n
cannot be a l-value node. Returns null
if no value is available.n
- a noden
, or null
if no value is availablepublic S getRegularStore()
Node
corresponding to this transfer function result.Node
corresponding to this transfer function resultpublic S getThenStore()
Node
this result belongs to evaluates to
true
.Node
this result belongs to evaluates to
true
public S getElseStore()
Node
this result belongs to evaluates to
false
.Node
this result belongs to evaluates to
false
public boolean containsTwoStores()
true
if and only if this transfer input contains two stores that are
potentially not equal. Note that the result true
does not imply that getRegularStore
cannot be called (or vice versa for false
). Rather, it indicates
that getThenStore
or getElseStore
can be used to give more precise results.
Otherwise, if the result is false
, then all three methods getRegularStore
,
getThenStore
, and getElseStore
return equivalent stores.true
if and only if this transfer input contains two stores that are
potentially not equalpublic TransferInput<V,S> copy()
public TransferInput<V,S> leastUpperBound(TransferInput<V,S> other)
Important: This method must fulfill the same contract as leastUpperBound
of Store
.
other
- a transfer inputother