Class JvmForgetfulHeapAbstractState<StateT extends AbstractState<StateT>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.state.heap.JvmForgetfulHeapAbstractState<StateT>
-
- All Implemented Interfaces:
AbstractState<JvmHeapAbstractState<StateT>>
,JvmHeapAbstractState<StateT>
public class JvmForgetfulHeapAbstractState<StateT extends AbstractState<StateT>> extends java.lang.Object implements JvmHeapAbstractState<StateT>
This is a forgetful stub heap implementation. It does not change and always returns the default value.
-
-
Constructor Summary
Constructors Constructor Description JvmForgetfulHeapAbstractState(StateT defaultValue)
Create a forgetful heap abstract state returning the specified value for all queries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JvmForgetfulHeapAbstractState<StateT>
copy()
Creates a copy of itself.boolean
equals(java.lang.Object o)
<T> StateT
getArrayElementOrDefault(T array, StateT index, StateT defaultValue)
Returns anarray
element at the specifiedindex
or thedefaultValue
, if the element is unset.<T> StateT
getFieldOrDefault(T object, java.lang.String fqn, StateT defaultValue)
Returns a fieldfqn
from a referenceobject
.int
hashCode()
boolean
isLessOrEqual(JvmHeapAbstractState<StateT> abstractState)
Compares itself to theabstractState
(i.e., compare the states on the partial order provided by the domain of the analysis).JvmForgetfulHeapAbstractState<StateT>
join(JvmHeapAbstractState<StateT> abstractState)
Computes a join over itself and another abstract stateabstractState
(i.e., finds the least upper bound on the semilattice).StateT
newArray(java.lang.String type, java.util.List<StateT> dimensions, JvmCfaNode creationCite)
Creates a new array of a given class with the given dimension sizes at a specific program point and returns a reference to it.StateT
newObject(java.lang.String className, JvmCfaNode creationCite)
Creates a new object of a given class at a specific program point and returns a reference to it.<T> void
setArrayElement(T array, StateT index, StateT value)
Sets thearray
elementvalue
at the specifiedindex
.<T> void
setField(T object, java.lang.String fqn, StateT value)
Sets avalue
to a fieldfqn
of a referencedobject
.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
getPrecision, isLess
-
Methods inherited from interface proguard.analysis.cpa.jvm.state.heap.JvmHeapAbstractState
expand, newObject, reduce
-
-
-
-
Constructor Detail
-
JvmForgetfulHeapAbstractState
public JvmForgetfulHeapAbstractState(StateT defaultValue)
Create a forgetful heap abstract state returning the specified value for all queries.- Parameters:
defaultValue
- the value to be returned by memory accesses
-
-
Method Detail
-
getFieldOrDefault
public <T> StateT getFieldOrDefault(T object, java.lang.String fqn, StateT defaultValue)
Description copied from interface:JvmHeapAbstractState
Returns a fieldfqn
from a referenceobject
. If there is no abstract state representing the field, returns thedefaultValue
- Specified by:
getFieldOrDefault
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
setField
public <T> void setField(T object, java.lang.String fqn, StateT value)
Description copied from interface:JvmHeapAbstractState
Sets avalue
to a fieldfqn
of a referencedobject
.- Specified by:
setField
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
getArrayElementOrDefault
public <T> StateT getArrayElementOrDefault(T array, StateT index, StateT defaultValue)
Description copied from interface:JvmHeapAbstractState
Returns anarray
element at the specifiedindex
or thedefaultValue
, if the element is unset.- Specified by:
getArrayElementOrDefault
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
setArrayElement
public <T> void setArrayElement(T array, StateT index, StateT value)
Description copied from interface:JvmHeapAbstractState
Sets thearray
elementvalue
at the specifiedindex
.- Specified by:
setArrayElement
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
newObject
public StateT newObject(java.lang.String className, JvmCfaNode creationCite)
Description copied from interface:JvmHeapAbstractState
Creates a new object of a given class at a specific program point and returns a reference to it.- Specified by:
newObject
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
newArray
public StateT newArray(java.lang.String type, java.util.List<StateT> dimensions, JvmCfaNode creationCite)
Description copied from interface:JvmHeapAbstractState
Creates a new array of a given class with the given dimension sizes at a specific program point and returns a reference to it.- Specified by:
newArray
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
join
public JvmForgetfulHeapAbstractState<StateT> join(JvmHeapAbstractState<StateT> abstractState)
Description copied from interface:AbstractState
Computes a join over itself and another abstract stateabstractState
(i.e., finds the least upper bound on the semilattice).- Specified by:
join
in interfaceAbstractState<StateT extends AbstractState<StateT>>
-
isLessOrEqual
public boolean isLessOrEqual(JvmHeapAbstractState<StateT> abstractState)
Description copied from interface:AbstractState
Compares itself to theabstractState
(i.e., compare the states on the partial order provided by the domain of the analysis).- Specified by:
isLessOrEqual
in interfaceAbstractState<StateT extends AbstractState<StateT>>
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfaceAbstractState<StateT extends AbstractState<StateT>>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceAbstractState<StateT extends AbstractState<StateT>>
- Overrides:
hashCode
in classjava.lang.Object
-
copy
public JvmForgetfulHeapAbstractState<StateT> copy()
Description copied from interface:AbstractState
Creates a copy of itself.- Specified by:
copy
in interfaceAbstractState<StateT extends AbstractState<StateT>>
- Specified by:
copy
in interfaceJvmHeapAbstractState<StateT extends AbstractState<StateT>>
-
-