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.protectedSubstringDomain(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 SubstringDomainadd(it.unive.lisa.symbolic.SymbolicExpression expr, it.unive.lisa.symbolic.value.Identifier id)Adds a single expression (expr) foridto the this abstract value.protected SubstringDomainadd(java.util.Set<it.unive.lisa.symbolic.SymbolicExpression> exprs, it.unive.lisa.symbolic.value.Identifier id)Adds a set of expressions (exprs) foridto the this abstract value.SubstringDomainassign(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)SubstringDomainassume(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)SubstringDomainbottom()protected SubstringDomainclosure()Performs the closure over the domain.SubstringDomainforgetIdentifier(it.unive.lisa.symbolic.value.Identifier id)SubstringDomainforgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)SubstringDomainglbAux(SubstringDomain other)booleanknowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)SubstringDomainlubAux(SubstringDomain other)SubstringDomainmk(it.unive.lisa.analysis.lattices.ExpressionInverseSet lattice, java.util.Map<it.unive.lisa.symbolic.value.Identifier,it.unive.lisa.analysis.lattices.ExpressionInverseSet> function)SubstringDomainpopScope(it.unive.lisa.analysis.ScopeToken token)SubstringDomainpushScope(it.unive.lisa.analysis.ScopeToken token)it.unive.lisa.analysis.lattices.Satisfiabilitysatisfies(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)SubstringDomainsmallStepSemantics(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.ExpressionInverseSetstateOfUnknown(it.unive.lisa.symbolic.value.Identifier key)SubstringDomaintop()-
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:
lubAuxin interfaceit.unive.lisa.analysis.BaseLattice<SubstringDomain>- Overrides:
lubAuxin 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:
glbAuxin interfaceit.unive.lisa.analysis.BaseLattice<SubstringDomain>- Overrides:
glbAuxin 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:
topin interfaceit.unive.lisa.analysis.Lattice<SubstringDomain>
-
bottom
public SubstringDomain bottom()
- Specified by:
bottomin interfaceit.unive.lisa.analysis.Lattice<SubstringDomain>
-
stateOfUnknown
public it.unive.lisa.analysis.lattices.ExpressionInverseSet stateOfUnknown(it.unive.lisa.symbolic.value.Identifier key)
- Specified by:
stateOfUnknownin 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:
mkin 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:
assignin 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:
smallStepSemanticsin 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:
assumein 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:
knowsIdentifierin 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:
forgetIdentifierin 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:
forgetIdentifiersIfin 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:
satisfiesin 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:
pushScopein 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:
popScopein 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) foridto 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) foridto 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
-
-