Package it.unive.lisa.analysis
Interface SemanticDomain<D extends SemanticDomain<D,E,I>,E extends SymbolicExpression,I extends Identifier>
-
- Type Parameters:
D- the concreteSemanticDomaininstanceE- the type ofSymbolicExpressionthat this domain can processI- the type of variableIdentifierthat this domain can handle
- All Known Subinterfaces:
AbstractState<A,H,V>,HeapDomain<D>,ValueDomain<D>
- All Known Implementing Classes:
AnalysisState,BaseHeapDomain,CartesianProduct,DataflowDomain,DefiniteForwardDataflowDomain,Environment,FieldSensitivePointBasedHeap,HeapEnvironment,InferenceSystem,MonolithicHeap,PointBasedHeap,PossibleForwardDataflowDomain,SimpleAbstractState,TypeBasedHeap,ValueCartesianProduct,ValueEnvironment
public interface SemanticDomain<D extends SemanticDomain<D,E,I>,E extends SymbolicExpression,I extends Identifier>A domain able to determine how abstract information evolves thanks to the semantics of statements and expressions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSemanticDomain.SatisfiabilityThe satisfiability of an expression.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Dassign(I id, E expression, ProgramPoint pp)Yields a copy of this domain, whereidhas been assigned tovalue.Dassume(E expression, ProgramPoint pp)Yields a copy of this domain, modified by assuming that the given expression holds.DforgetIdentifier(Identifier id)Forgets anIdentifier.default DforgetIdentifiers(java.lang.Iterable<Identifier> ids)Forgets all the givenIdentifiers.DpopScope(ScopeToken token)Pops the scope identified by the given token from the domain.DpushScope(ScopeToken token)Pushes a new scope, identified by the give token, in the domain.DomainRepresentationrepresentation()Yields aDomainRepresentationof the information contained in this domain's instance.SemanticDomain.Satisfiabilitysatisfies(E expression, ProgramPoint pp)Checks if the given expression is satisfied by the abstract values of this domain, returning an instance ofSemanticDomain.Satisfiability.DsmallStepSemantics(E expression, ProgramPoint pp)Yields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression.
-
-
-
Method Detail
-
assign
D assign(I id, E expression, ProgramPoint pp) throws SemanticException
Yields a copy of this domain, whereidhas been assigned tovalue.- Parameters:
id- the identifier to assign the value toexpression- the expression to assignpp- the program point that where this operation is being evaluated- Returns:
- a copy of this domain, modified by the assignment
- Throws:
SemanticException- if an error occurs during the computation
-
smallStepSemantics
D smallStepSemantics(E expression, ProgramPoint pp) throws SemanticException
Yields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression.- Parameters:
expression- the expression whose semantics need to be computedpp- the program point that where this operation is being evaluated- Returns:
- a copy of this domain, modified accordingly to the semantics of
expression - Throws:
SemanticException- if an error occurs during the computation
-
assume
D assume(E expression, ProgramPoint pp) throws SemanticException
Yields a copy of this domain, modified by assuming that the given expression holds. It is required that the returned domain is in relation with this one. A safe (but imprecise) implementation of this method can always returnthis.- Parameters:
expression- the expression to assume to hold.pp- the program point that where this operation is being evaluated- Returns:
- the (optionally) modified copy of this domain
- Throws:
SemanticException- if an error occurs during the computation
-
forgetIdentifier
D forgetIdentifier(Identifier id) throws SemanticException
Forgets anIdentifier. This means that all information regarding the givenidwill be lost. This method should be invoked whenever an identifier gets out of scope.- Parameters:
id- the identifier to forget- Returns:
- the semantic domain without information about the given id
- Throws:
SemanticException- if an error occurs during the computation
-
forgetIdentifiers
default D forgetIdentifiers(java.lang.Iterable<Identifier> ids) throws SemanticException
Forgets all the givenIdentifiers. The default implementation of this method iterates onids, invokingforgetIdentifier(Identifier)on each element.- Parameters:
ids- the collection of identifiers to forget- Returns:
- the semantic domain without information about the given ids
- Throws:
SemanticException- if an error occurs during the computation
-
satisfies
SemanticDomain.Satisfiability satisfies(E expression, ProgramPoint pp) throws SemanticException
Checks if the given expression is satisfied by the abstract values of this domain, returning an instance ofSemanticDomain.Satisfiability.- Parameters:
expression- the expression whose satisfiability is to be evaluatedpp- the program point that where this operation is being evaluated- Returns:
SemanticDomain.Satisfiability.SATISFIEDis the expression is satisfied by the values of this domain,SemanticDomain.Satisfiability.NOT_SATISFIEDif it is not satisfied, orSemanticDomain.Satisfiability.UNKNOWNif it is either impossible to determine if it satisfied, or if it is satisfied by some values and not by some others (this is equivalent to a TOP boolean value)- Throws:
SemanticException- if an error occurs during the computation
-
pushScope
D pushScope(ScopeToken token) throws SemanticException
Pushes a new scope, identified by the give token, in the domain. This causes information about all variables not associated with a scope (and thus visible) to be mapped to the given scope and hidden away, until the scope is popped withpopScope(ScopeToken).- Parameters:
token- the token identifying the scope to push- Returns:
- a copy of this domain where the local variables have been hidden
- Throws:
SemanticException- if an error occurs during the computation
-
popScope
D popScope(ScopeToken token) throws SemanticException
Pops the scope identified by the given token from the domain. This causes all the visible variables (i.e. that are not mapped to a scope) to be removed from the domain, while the local variables that were associated to the given scope token (and thus hidden) will become visible again.- Parameters:
token- the token of the scope to be restored- Returns:
- a copy of this domain where the local variables have been removed, while the variables mapped to the given scope are visible again
- Throws:
SemanticException- if an error occurs during the computation
-
representation
DomainRepresentation representation()
Yields aDomainRepresentationof the information contained in this domain's instance.- Returns:
- the representation
-
-