Interface NonRelationalElement<T extends NonRelationalElement<T,E,F>,E extends SymbolicExpression,F extends FunctionalLattice<F,Identifier,T>>
-
- Type Parameters:
T
- the concrete type of the domainE
- the type of expressions that this domain can evaluateF
- the type of functional lattice that is used in conjuntion with this domain
- All Superinterfaces:
Lattice<T>
,SemanticEvaluator
,StructuredObject
- All Known Subinterfaces:
BaseInferredValue<T>
,BaseNonRelationalTypeDomain<T>
,BaseNonRelationalValueDomain<T>
,InferredValue<T>
,NonRelationalDomain<T,E,F>
,NonRelationalHeapDomain<T>
,NonRelationalTypeDomain<T>
,NonRelationalValueDomain<T>
public interface NonRelationalElement<T extends NonRelationalElement<T,E,F>,E extends SymbolicExpression,F extends FunctionalLattice<F,Identifier,T>> extends Lattice<T>, SemanticEvaluator
A non-relational domain, that is able to compute the value of aSymbolicExpression
s of typeE
by knowing the values of all program variables. Instances of this class can be wrapped inside anFunctionalLattice
to represent abstract values of individualIdentifier
s.
-
-
Field Summary
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_STRING, TOP_STRING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description F
assume(F environment, E expression, ProgramPoint src, ProgramPoint dest, SemanticOracle oracle)
Yields the environmentenvironment
on which the expressionexpression
is assumed to hold by this domain.default T
fixedVariable(Identifier id, ProgramPoint pp, SemanticOracle oracle)
Yields a fixed abstraction of the given variable.Satisfiability
satisfies(E expression, F environment, ProgramPoint pp, SemanticOracle oracle)
Checks whetherexpression
is satisfied inenvironment
, assuming that the values of program variables are the ones stored inenvironment
and returning an instance ofSatisfiability
.default T
unknownVariable(Identifier id)
Yields the default abstraction returned whenever a functional lattice using this element as values is queried for the state of a variable not currently part of its mapping.-
Methods inherited from interface it.unive.lisa.analysis.Lattice
bottom, glb, isBottom, isTop, lessOrEqual, lub, narrowing, top, widening
-
Methods inherited from interface it.unive.lisa.analysis.SemanticEvaluator
canProcess
-
Methods inherited from interface it.unive.lisa.util.representation.StructuredObject
representation
-
-
-
-
Method Detail
-
satisfies
Satisfiability satisfies(E expression, F environment, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Checks whetherexpression
is satisfied inenvironment
, assuming that the values of program variables are the ones stored inenvironment
and returning an instance ofSatisfiability
.- Parameters:
expression
- the expression whose satisfiability is to be evaluatedenvironment
- the environment containing the values of program variables for the satisfiabilitypp
- the program point that where this operation is being evaluatedoracle
- the oracle for inter-domain communication- Returns:
Satisfiability.SATISFIED
if the expression is satisfied by the environment,Satisfiability.NOT_SATISFIED
if it is not satisfied, orSatisfiability.UNKNOWN
if 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 something goes wrong during the computation
-
assume
F assume(F environment, E expression, ProgramPoint src, ProgramPoint dest, SemanticOracle oracle) throws SemanticException
Yields the environmentenvironment
on which the expressionexpression
is assumed to hold by this domain. The returned environment must be an updated version of the given one, where the relevant abstractions have been (optionally) updated. Returning the given environment as-is is always a sound implementation.- Parameters:
environment
- the environmentexpression
- the expression to be assumedsrc
- the program point that where this operation is being evaluated, corresponding to the one that generated the given expressiondest
- the program point where the execution will move after the expression has been assumedoracle
- the oracle for inter-domain communication- Returns:
- the environment
environment
whereexpression
is assumed to hold - Throws:
SemanticException
- if an error occurs during the computation
-
fixedVariable
default T fixedVariable(Identifier id, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Yields a fixed abstraction of the given variable. The abstraction does not depend on the abstract values that get assigned to the variable, but is instead fixed among all possible execution paths. If this method does not return the bottom element (as the default implementation does), thenEnvironment.assign(Identifier, SymbolicExpression, ProgramPoint, SemanticOracle)
will store that abstract element instead of the one computed starting from the expression.- Parameters:
id
- The identifier representing the variable being assignedpp
- the program point that where this operation is being evaluatedoracle
- the oracle for inter-domain communication- Returns:
- the fixed abstraction of the variable
- Throws:
SemanticException
- if an error occurs during the computation
-
unknownVariable
default T unknownVariable(Identifier id)
Yields the default abstraction returned whenever a functional lattice using this element as values is queried for the state of a variable not currently part of its mapping. Abstraction for such a variable might have been lost, for instance, due to a call toLattice.top()
on the function itself. The default implementation of this method returnsLattice.top()
.- Parameters:
id
- the variable that is missing from the mapping- Returns:
- a default abstraction for the variable
-
-