Package it.unive.lisa.analysis.string
Class SubstringDomain
- java.lang.Object
-
- it.unive.lisa.analysis.lattices.FunctionalLattice<SubstringDomain,it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet>
-
- it.unive.lisa.analysis.string.SubstringDomain
-
- All Implemented Interfaces:
it.unive.lisa.analysis.BaseLattice<SubstringDomain>
,it.unive.lisa.analysis.Lattice<SubstringDomain>
,it.unive.lisa.analysis.ScopedObject<SubstringDomain>
,it.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
,it.unive.lisa.analysis.value.ValueDomain<SubstringDomain>
,it.unive.lisa.analysis.value.ValueOracle
,it.unive.lisa.util.representation.StructuredObject
,java.lang.Iterable<java.util.Map.Entry<it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet>>
public class SubstringDomain extends it.unive.lisa.analysis.lattices.FunctionalLattice<SubstringDomain,it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet> implements it.unive.lisa.analysis.value.ValueDomain<SubstringDomain>
The substring relational abstract domain, tracking relation between string expressions. The domain is implemented as aFunctionalLattice
, mapping identifiers to string expressions, tracking which string expressions are definitely substring of an identifier. This domain follows the one defined in this paper.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
it.unive.lisa.analysis.lattices.FunctionalLattice.FunctionalLift<V extends it.unive.lisa.analysis.Lattice<V>>, it.unive.lisa.analysis.lattices.FunctionalLattice.KeyFunctionalLift<K extends java.lang.Object>
-
-
Constructor Summary
Constructors Modifier Constructor Description SubstringDomain()
Builds the top abstract value.protected
SubstringDomain(it.unive.lisa.analysis.lattices.ExpressionInverseSet lattice, java.util.Map<it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet> function)
Builds the abstract value by cloning the given function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SubstringDomain
add(it.unive.lisa.symbolic.SymbolicExpression expr, it.unive.lisa.symbolic.value.Identifier id)
Adds a single expression (expr
) forid
to the this abstract value.protected SubstringDomain
add(java.util.Set<it.unive.lisa.symbolic.SymbolicExpression> exprs, it.unive.lisa.symbolic.value.Identifier id)
Adds a set of expressions (exprs
) forid
to the this abstract value.SubstringDomain
assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
SubstringDomain
assume(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle)
SubstringDomain
bottom()
protected SubstringDomain
closure()
Performs the closure over the domain.SubstringDomain
forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id)
SubstringDomain
forgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)
SubstringDomain
glbAux(SubstringDomain other)
boolean
knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
SubstringDomain
lubAux(SubstringDomain other)
SubstringDomain
mk(it.unive.lisa.analysis.lattices.ExpressionInverseSet lattice, java.util.Map<it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet> function)
SubstringDomain
popScope(it.unive.lisa.analysis.ScopeToken token)
SubstringDomain
pushScope(it.unive.lisa.analysis.ScopeToken token)
it.unive.lisa.analysis.lattices.Satisfiability
satisfies(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
SubstringDomain
smallStepSemantics(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
it.unive.lisa.analysis.lattices.ExpressionInverseSet
stateOfUnknown(it.unive.lisa.symbolic.value.Identifier key)
SubstringDomain
top()
-
Methods inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
equals, functionalLift, getKeys, getMap, getOtDefault, getState, getValues, glbKeys, hashCode, isBottom, isTop, iterator, lessOrEqualAux, lubKeys, mkNewFunction, narrowingAux, putState, representation, toString, wideningAux
-
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
-
-
-
-
Constructor Detail
-
SubstringDomain
public SubstringDomain()
Builds the top abstract value.
-
SubstringDomain
protected SubstringDomain(it.unive.lisa.analysis.lattices.ExpressionInverseSet lattice, java.util.Map<it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet> function)
Builds the abstract value by cloning the given function.- Parameters:
lattice
- the underlying latticefunction
- the function to clone
-
-
Method Detail
-
lubAux
public SubstringDomain lubAux(SubstringDomain other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
lubAux
in interfaceit.unive.lisa.analysis.BaseLattice<SubstringDomain>
- Overrides:
lubAux
in classit.unive.lisa.analysis.lattices.FunctionalLattice<SubstringDomain,it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet>
- Throws:
it.unive.lisa.analysis.SemanticException
-
glbAux
public SubstringDomain glbAux(SubstringDomain other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
glbAux
in interfaceit.unive.lisa.analysis.BaseLattice<SubstringDomain>
- Overrides:
glbAux
in classit.unive.lisa.analysis.lattices.FunctionalLattice<SubstringDomain,it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet>
- Throws:
it.unive.lisa.analysis.SemanticException
-
top
public SubstringDomain top()
- Specified by:
top
in interfaceit.unive.lisa.analysis.Lattice<SubstringDomain>
-
bottom
public SubstringDomain bottom()
- Specified by:
bottom
in interfaceit.unive.lisa.analysis.Lattice<SubstringDomain>
-
stateOfUnknown
public it.unive.lisa.analysis.lattices.ExpressionInverseSet stateOfUnknown(it.unive.lisa.symbolic.value.Identifier key)
- Specified by:
stateOfUnknown
in classit.unive.lisa.analysis.lattices.FunctionalLattice<SubstringDomain,it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet>
-
mk
public SubstringDomain mk(it.unive.lisa.analysis.lattices.ExpressionInverseSet lattice, java.util.Map<it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet> function)
- Specified by:
mk
in classit.unive.lisa.analysis.lattices.FunctionalLattice<SubstringDomain,it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet>
-
assign
public SubstringDomain assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
assign
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
smallStepSemantics
public SubstringDomain smallStepSemantics(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
smallStepSemantics
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
assume
public SubstringDomain assume(it.unive.lisa.symbolic.value.ValueExpression 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
- Specified by:
assume
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
knowsIdentifier
public boolean knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
- Specified by:
knowsIdentifier
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
-
forgetIdentifier
public SubstringDomain forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id) throws it.unive.lisa.analysis.SemanticException
- Specified by:
forgetIdentifier
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
forgetIdentifiersIf
public SubstringDomain forgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test) throws it.unive.lisa.analysis.SemanticException
- Specified by:
forgetIdentifiersIf
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
satisfies
public it.unive.lisa.analysis.lattices.Satisfiability satisfies(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
satisfies
in interfaceit.unive.lisa.analysis.SemanticDomain<SubstringDomain,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
pushScope
public SubstringDomain pushScope(it.unive.lisa.analysis.ScopeToken token) throws it.unive.lisa.analysis.SemanticException
- Specified by:
pushScope
in interfaceit.unive.lisa.analysis.ScopedObject<SubstringDomain>
- Throws:
it.unive.lisa.analysis.SemanticException
-
popScope
public SubstringDomain popScope(it.unive.lisa.analysis.ScopeToken token) throws it.unive.lisa.analysis.SemanticException
- Specified by:
popScope
in interfaceit.unive.lisa.analysis.ScopedObject<SubstringDomain>
- Throws:
it.unive.lisa.analysis.SemanticException
-
add
protected SubstringDomain add(java.util.Set<it.unive.lisa.symbolic.SymbolicExpression> exprs, it.unive.lisa.symbolic.value.Identifier id) throws it.unive.lisa.analysis.SemanticException
Adds a set of expressions (exprs
) forid
to the this abstract value.- Parameters:
exprs
- the set of symbolic expressionsid
- the identifier- Returns:
- a new abstract value with the added expressions
- Throws:
it.unive.lisa.analysis.SemanticException
- if an error occurs during the computation
-
add
protected SubstringDomain add(it.unive.lisa.symbolic.SymbolicExpression expr, it.unive.lisa.symbolic.value.Identifier id) throws it.unive.lisa.analysis.SemanticException
Adds a single expression (expr
) forid
to the this abstract value.- Parameters:
expr
- the symbolic expressionid
- the identifier- Returns:
- a new abstract value with the added expression
- Throws:
it.unive.lisa.analysis.SemanticException
- if an error occurs during the computation
-
closure
protected SubstringDomain closure() throws it.unive.lisa.analysis.SemanticException
Performs the closure over the domain.- Returns:
- A copy of the domain with the added relations
- Throws:
it.unive.lisa.analysis.SemanticException
- if an error occurs during the computation
-
-