Package it.unive.lisa.analysis
Class SimpleAbstractState<H extends it.unive.lisa.analysis.heap.HeapDomain<H>,V extends it.unive.lisa.analysis.value.ValueDomain<V>,T extends it.unive.lisa.analysis.type.TypeDomain<T>>
- java.lang.Object
-
- it.unive.lisa.analysis.SimpleAbstractState<H,V,T>
-
- Type Parameters:
H- the type ofHeapDomainembedded in this stateV- the type ofValueDomainembedded in this stateT- the type ofTypeDomainembedded in this state
- All Implemented Interfaces:
it.unive.lisa.analysis.AbstractState<SimpleAbstractState<H,V,T>>,it.unive.lisa.analysis.BaseLattice<SimpleAbstractState<H,V,T>>,it.unive.lisa.analysis.heap.MemoryOracle,it.unive.lisa.analysis.Lattice<SimpleAbstractState<H,V,T>>,it.unive.lisa.analysis.ScopedObject<SimpleAbstractState<H,V,T>>,it.unive.lisa.analysis.SemanticDomain<SimpleAbstractState<H,V,T>,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>,it.unive.lisa.analysis.SemanticOracle,it.unive.lisa.analysis.type.TypeOracle,it.unive.lisa.analysis.value.ValueOracle,it.unive.lisa.util.representation.StructuredObject
public class SimpleAbstractState<H extends it.unive.lisa.analysis.heap.HeapDomain<H>,V extends it.unive.lisa.analysis.value.ValueDomain<V>,T extends it.unive.lisa.analysis.type.TypeDomain<T>> extends java.lang.Object implements it.unive.lisa.analysis.BaseLattice<SimpleAbstractState<H,V,T>>, it.unive.lisa.analysis.AbstractState<SimpleAbstractState<H,V,T>>
An abstract state of the analysis, composed by a heap state modeling the memory layout, a value state modeling values of program variables and memory locations, and a type state that can give types to expressions knowing the ones of variables.
The interaction between heap and value/type domains follows the one defined in this paper.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHEAP_REPRESENTATION_KEYThe key that should be used to store the instance ofHeapDomaininside theStructuredRepresentationreturned byrepresentation().static java.lang.StringTYPE_REPRESENTATION_KEYThe key that should be used to store the instance ofTypeDomaininside theStructuredRepresentationreturned byrepresentation().static java.lang.StringVALUE_REPRESENTATION_KEYThe key that should be used to store the instance ofValueDomaininside theStructuredRepresentationreturned byrepresentation().
-
Constructor Summary
Constructors Constructor Description SimpleAbstractState(H heapState, V valueState, T typeState)Builds a new abstract state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description it.unive.lisa.analysis.lattices.Satisfiabilityalias(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)SimpleAbstractState<H,V,T>assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)SimpleAbstractState<H,V,T>assume(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle)SimpleAbstractState<H,V,T>bottom()booleanequals(java.lang.Object obj)SimpleAbstractState<H,V,T>forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id)SimpleAbstractState<H,V,T>forgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)<D extends it.unive.lisa.analysis.SemanticDomain<?,?,?>>
java.util.Collection<D>getAllDomainInstances(java.lang.Class<D> domain)it.unive.lisa.type.TypegetDynamicTypeOf(it.unive.lisa.symbolic.SymbolicExpression e, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)HgetHeapState()Yields theHeapDomaincontained in this state.java.util.Set<it.unive.lisa.type.Type>getRuntimeTypesOf(it.unive.lisa.symbolic.SymbolicExpression e, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)TgetTypeState()Yields theTypeDomaincontained in this state.VgetValueState()Yields theValueDomaincontained in this state.SimpleAbstractState<H,V,T>glbAux(SimpleAbstractState<H,V,T> other)inthashCode()booleanisBottom()it.unive.lisa.analysis.lattices.SatisfiabilityisReachableFrom(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)booleanisTop()booleanknowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)booleanlessOrEqualAux(SimpleAbstractState<H,V,T> other)SimpleAbstractState<H,V,T>lubAux(SimpleAbstractState<H,V,T> other)SimpleAbstractState<H,V,T>narrowingAux(SimpleAbstractState<H,V,T> other)SimpleAbstractState<H,V,T>popScope(it.unive.lisa.analysis.ScopeToken scope)SimpleAbstractState<H,V,T>pushScope(it.unive.lisa.analysis.ScopeToken scope)it.unive.lisa.util.representation.StructuredRepresentationrepresentation()it.unive.lisa.analysis.lattices.ExpressionSetrewrite(it.unive.lisa.analysis.lattices.ExpressionSet expressions, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)it.unive.lisa.analysis.lattices.ExpressionSetrewrite(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)it.unive.lisa.analysis.lattices.Satisfiabilitysatisfies(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)SimpleAbstractState<H,V,T>smallStepSemantics(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)SimpleAbstractState<H,V,T>top()java.lang.StringtoString()SimpleAbstractState<H,V,T>wideningAux(SimpleAbstractState<H,V,T> other)SimpleAbstractState<H,V,T>withTopMemory()SimpleAbstractState<H,V,T>withTopTypes()SimpleAbstractState<H,V,T>withTopValues()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.analysis.BaseLattice
glb, lessOrEqual, lub, narrowing, widening
-
-
-
-
Field Detail
-
HEAP_REPRESENTATION_KEY
public static final java.lang.String HEAP_REPRESENTATION_KEY
The key that should be used to store the instance ofHeapDomaininside theStructuredRepresentationreturned byrepresentation().- See Also:
- Constant Field Values
-
TYPE_REPRESENTATION_KEY
public static final java.lang.String TYPE_REPRESENTATION_KEY
The key that should be used to store the instance ofTypeDomaininside theStructuredRepresentationreturned byrepresentation().- See Also:
- Constant Field Values
-
VALUE_REPRESENTATION_KEY
public static final java.lang.String VALUE_REPRESENTATION_KEY
The key that should be used to store the instance ofValueDomaininside theStructuredRepresentationreturned byrepresentation().- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleAbstractState
public SimpleAbstractState(H heapState, V valueState, T typeState)
Builds a new abstract state.- Parameters:
heapState- the domain containing information regarding heap structuresvalueState- the domain containing information regarding values of program variables and concretized memory locationstypeState- the domain containing information regarding runtime types of program variables and concretized memory locations
-
-
Method Detail
-
getHeapState
public H getHeapState()
Yields theHeapDomaincontained in this state.- Returns:
- the heap domain
-
getValueState
public V getValueState()
Yields theValueDomaincontained in this state.- Returns:
- the value domain
-
getTypeState
public T getTypeState()
Yields theTypeDomaincontained in this state.- Returns:
- the type domain
-
assign
public SimpleAbstractState<H,V,T> assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
smallStepSemantics
public SimpleAbstractState<H,V,T> smallStepSemantics(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
assume
public SimpleAbstractState<H,V,T> assume(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
satisfies
public it.unive.lisa.analysis.lattices.Satisfiability satisfies(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
pushScope
public SimpleAbstractState<H,V,T> pushScope(it.unive.lisa.analysis.ScopeToken scope) throws it.unive.lisa.analysis.SemanticException
-
popScope
public SimpleAbstractState<H,V,T> popScope(it.unive.lisa.analysis.ScopeToken scope) throws it.unive.lisa.analysis.SemanticException
-
lubAux
public SimpleAbstractState<H,V,T> lubAux(SimpleAbstractState<H,V,T> other) throws it.unive.lisa.analysis.SemanticException
-
glbAux
public SimpleAbstractState<H,V,T> glbAux(SimpleAbstractState<H,V,T> other) throws it.unive.lisa.analysis.SemanticException
-
wideningAux
public SimpleAbstractState<H,V,T> wideningAux(SimpleAbstractState<H,V,T> other) throws it.unive.lisa.analysis.SemanticException
-
narrowingAux
public SimpleAbstractState<H,V,T> narrowingAux(SimpleAbstractState<H,V,T> other) throws it.unive.lisa.analysis.SemanticException
-
lessOrEqualAux
public boolean lessOrEqualAux(SimpleAbstractState<H,V,T> other) throws it.unive.lisa.analysis.SemanticException
-
top
public SimpleAbstractState<H,V,T> top()
-
bottom
public SimpleAbstractState<H,V,T> bottom()
-
isTop
public boolean isTop()
-
isBottom
public boolean isBottom()
-
forgetIdentifier
public SimpleAbstractState<H,V,T> forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id) throws it.unive.lisa.analysis.SemanticException
-
forgetIdentifiersIf
public SimpleAbstractState<H,V,T> forgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test) throws it.unive.lisa.analysis.SemanticException
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object obj)
-
representation
public it.unive.lisa.util.representation.StructuredRepresentation representation()
- Specified by:
representationin interfaceit.unive.lisa.util.representation.StructuredObject
-
toString
public java.lang.String toString()
-
getAllDomainInstances
public <D extends it.unive.lisa.analysis.SemanticDomain<?,?,?>> java.util.Collection<D> getAllDomainInstances(java.lang.Class<D> domain)
-
rewrite
public it.unive.lisa.analysis.lattices.ExpressionSet rewrite(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException- Specified by:
rewritein interfaceit.unive.lisa.analysis.heap.MemoryOracle- Throws:
it.unive.lisa.analysis.SemanticException
-
rewrite
public it.unive.lisa.analysis.lattices.ExpressionSet rewrite(it.unive.lisa.analysis.lattices.ExpressionSet expressions, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException- Specified by:
rewritein interfaceit.unive.lisa.analysis.heap.MemoryOracle- Throws:
it.unive.lisa.analysis.SemanticException
-
getRuntimeTypesOf
public java.util.Set<it.unive.lisa.type.Type> getRuntimeTypesOf(it.unive.lisa.symbolic.SymbolicExpression e, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException- Specified by:
getRuntimeTypesOfin interfaceit.unive.lisa.analysis.type.TypeOracle- Throws:
it.unive.lisa.analysis.SemanticException
-
getDynamicTypeOf
public it.unive.lisa.type.Type getDynamicTypeOf(it.unive.lisa.symbolic.SymbolicExpression e, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException- Specified by:
getDynamicTypeOfin interfaceit.unive.lisa.analysis.type.TypeOracle- Throws:
it.unive.lisa.analysis.SemanticException
-
knowsIdentifier
public boolean knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
-
withTopMemory
public SimpleAbstractState<H,V,T> withTopMemory()
-
withTopValues
public SimpleAbstractState<H,V,T> withTopValues()
-
withTopTypes
public SimpleAbstractState<H,V,T> withTopTypes()
-
alias
public it.unive.lisa.analysis.lattices.Satisfiability alias(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException- Specified by:
aliasin interfaceit.unive.lisa.analysis.heap.MemoryOracle- Throws:
it.unive.lisa.analysis.SemanticException
-
isReachableFrom
public it.unive.lisa.analysis.lattices.Satisfiability isReachableFrom(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException- Specified by:
isReachableFromin interfaceit.unive.lisa.analysis.heap.MemoryOracle- Throws:
it.unive.lisa.analysis.SemanticException
-
-