Class NonInterference
- java.lang.Object
-
- it.unive.lisa.analysis.BaseLattice<T>
-
- it.unive.lisa.analysis.nonrelational.inference.BaseInferredValue<NonInterference>
-
- it.unive.lisa.analysis.impl.nonInterference.NonInterference
-
- All Implemented Interfaces:
Lattice<NonInterference>,InferredValue<NonInterference>,NonRelationalElement<NonInterference,ValueExpression,InferenceSystem<NonInterference>>,SemanticEvaluator
public class NonInterference extends BaseInferredValue<NonInterference>
The type-system based implementation of the non interference analysis.- See Also:
- Non-interference
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface it.unive.lisa.analysis.nonrelational.inference.InferredValue
InferredValue.InferredPair<T extends InferredValue<T>>, InferredValue.InferredPairRepresentation
-
-
Field Summary
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_REPR, BOTTOM_STRING, TOP_REPR, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description NonInterference()Builds a new instance of non interference, referring to the top element of the lattice.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InferenceSystem<NonInterference>assume(InferenceSystem<NonInterference> environment, ValueExpression expression, ProgramPoint pp)Yields the environmentenvironmenton which the expressionexpressionis assumed to hold by this domain.NonInterferencebottom()Yields the bottom element of this lattice.booleancanProcess(SymbolicExpression expression)Yieldstrueif the domain can processexpression,falseotherwise.booleanequals(java.lang.Object obj)protected InferredValue.InferredPair<NonInterference>evalBinaryExpression(BinaryOperator operator, NonInterference left, NonInterference right, NonInterference state, ProgramPoint pp)Yields the evaluation of aBinaryExpressionapplyingoperatorto two expressions whose abstract value areleftandright, respectively.protected InferredValue.InferredPair<NonInterference>evalIdentifier(Identifier id, InferenceSystem<NonInterference> environment, ProgramPoint pp)Yields the evaluation of an identifier in a given environment.protected InferredValue.InferredPair<NonInterference>evalNonNullConstant(Constant constant, NonInterference state, ProgramPoint pp)Yields the evaluation of the given non-null constant.protected InferredValue.InferredPair<NonInterference>evalNullConstant(NonInterference state, ProgramPoint pp)Yields the evaluation of the null constantNullConstant.protected InferredValue.InferredPair<NonInterference>evalTernaryExpression(TernaryOperator operator, NonInterference left, NonInterference middle, NonInterference right, NonInterference state, ProgramPoint pp)Yields the evaluation of aTernaryExpressionapplyingoperatorto two expressions whose abstract value areleft,middleandright, respectively.protected InferredValue.InferredPair<NonInterference>evalUnaryExpression(UnaryOperator operator, NonInterference arg, NonInterference state, ProgramPoint pp)Yields the evaluation of aUnaryExpressionapplyingoperatorto an expression whose abstract value isarg.inthashCode()booleanisBottom()Yieldstrueif and only if this object represents the bottom of the lattice.booleanisHighConfidentiality()Yieldstrueif and only if this instance represents ahighvalue for the confidentiality non interference analysis.booleanisHighIntegrity()Yieldstrueif and only if this instance represents ahighvalue for the integrity non interference analysis.booleanisLowConfidentiality()Yieldstrueif and only if this instance represents alowvalue for the confidentiality non interference analysis.booleanisLowIntegrity()Yieldstrueif and only if this instance represents alowvalue for the integrity non interference analysis.booleanisTop()Yieldstrueif and only if this object represents the top of the lattice.protected booleanlessOrEqualAux(NonInterference other)Yieldstrueif and only if this lattice element is in relation with (usually represented through ≤) the given one, assuming that base cases have already been handled.protected NonInterferencelubAux(NonInterference other)Performs the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled.DomainRepresentationrepresentation()Yields aDomainRepresentationof the information contained in this domain's instance.NonInterferencetop()Yields the top element of this lattice.booleantracksIdentifiers(Identifier id)Yieldstrueif the domain tracks information on the identifierid,falseotherwise.NonInterferencevariable(Identifier id, ProgramPoint pp)Yields a fixed abstraction of the given variable.protected NonInterferencewideningAux(NonInterference other)Performs the widening operation between this lattice element and the given one, assuming that base cases have already been handled.-
Methods inherited from class it.unive.lisa.analysis.nonrelational.inference.BaseInferredValue
eval, evalPushAny, evalTypeCast, evalTypeConv, glb, glbAux, satisfies, satisfiesAbstractValue, satisfiesBinaryExpression, satisfiesNonNullConstant, satisfiesNullConstant, satisfiesPushAny, satisfiesTernaryExpression, satisfiesUnaryExpression, toString
-
Methods inherited from class it.unive.lisa.analysis.BaseLattice
lessOrEqual, lub, widening
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.analysis.Lattice
lessOrEqual, lub, widening
-
-
-
-
Method Detail
-
top
public NonInterference top()
Description copied from interface:LatticeYields the top element of this lattice. The returned element should be unique across different calls to this method, sinceLattice.isTop()uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isTop()accordingly to provide a coherent test.- Returns:
- the top element
-
isTop
public boolean isTop()
Description copied from interface:LatticeYieldstrueif and only if this object represents the top of the lattice. The default implementation of this method uses reference equality betweenthisand the value returned byLattice.top(), thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Returns:
trueif this is the top of the lattice
-
bottom
public NonInterference bottom()
Description copied from interface:LatticeYields the bottom element of this lattice. The returned element should be unique across different calls to this method, sinceLattice.isBottom()uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isBottom()accordingly to provide a coherent test.- Returns:
- the bottom element
-
isBottom
public boolean isBottom()
Description copied from interface:LatticeYieldstrueif and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality betweenthisand the value returned byLattice.bottom(), thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Returns:
trueif this is the bottom of the lattice
-
isHighConfidentiality
public boolean isHighConfidentiality()
Yieldstrueif and only if this instance represents ahighvalue for the confidentiality non interference analysis.- Returns:
trueif this is a high confidentiality element
-
isLowConfidentiality
public boolean isLowConfidentiality()
Yieldstrueif and only if this instance represents alowvalue for the confidentiality non interference analysis.- Returns:
trueif this is a low confidentiality element
-
isHighIntegrity
public boolean isHighIntegrity()
Yieldstrueif and only if this instance represents ahighvalue for the integrity non interference analysis.- Returns:
trueif this is a high integrity element
-
isLowIntegrity
public boolean isLowIntegrity()
Yieldstrueif and only if this instance represents alowvalue for the integrity non interference analysis.- Returns:
trueif this is a low integrity element
-
lubAux
protected NonInterference lubAux(NonInterference other) throws SemanticException
Description copied from class:BaseLatticePerforms the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:otheris notnullotheris neither top nor bottomthisis neither top nor bottomthisandotherare not the same object (according both to==and toObject.equals(Object))
- Specified by:
lubAuxin classBaseLattice<NonInterference>- Parameters:
other- the other lattice element- Returns:
- the least upper bound between this and other
- Throws:
SemanticException- if an error occurs during the computation
-
wideningAux
protected NonInterference wideningAux(NonInterference other) throws SemanticException
Description copied from class:BaseLatticePerforms the widening operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:otheris notnullotheris neither top nor bottomthisis neither top nor bottomthisandotherare not the same object (according both to==and toObject.equals(Object))
- Specified by:
wideningAuxin classBaseLattice<NonInterference>- Parameters:
other- the other lattice element- Returns:
- the widening between this and other
- Throws:
SemanticException- if an error occurs during the computation
-
lessOrEqualAux
protected boolean lessOrEqualAux(NonInterference other) throws SemanticException
Description copied from class:BaseLatticeYieldstrueif and only if this lattice element is in relation with (usually represented through ≤) the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:otheris notnullotheris neither top nor bottomthisis neither top nor bottomthisandotherare not the same object (according both to==and toObject.equals(Object))
- Specified by:
lessOrEqualAuxin classBaseLattice<NonInterference>- Parameters:
other- the other lattice element- Returns:
trueif and only if that condition holds- Throws:
SemanticException- if an error occurs during the computation
-
hashCode
public int hashCode()
- Specified by:
hashCodein classBaseLattice<NonInterference>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin classBaseLattice<NonInterference>
-
representation
public DomainRepresentation representation()
Description copied from interface:NonRelationalElementYields aDomainRepresentationof the information contained in this domain's instance.- Returns:
- the representation
-
evalNullConstant
protected InferredValue.InferredPair<NonInterference> evalNullConstant(NonInterference state, ProgramPoint pp) throws SemanticException
Description copied from class:BaseInferredValueYields the evaluation of the null constantNullConstant.- Overrides:
evalNullConstantin classBaseInferredValue<NonInterference>- Parameters:
state- the current execution statepp- the program point that where this operation is being evaluated- Returns:
- the evaluation of the constant
- Throws:
SemanticException- if an error occurs during the computation
-
evalNonNullConstant
protected InferredValue.InferredPair<NonInterference> evalNonNullConstant(Constant constant, NonInterference state, ProgramPoint pp) throws SemanticException
Description copied from class:BaseInferredValueYields the evaluation of the given non-null constant.- Overrides:
evalNonNullConstantin classBaseInferredValue<NonInterference>- Parameters:
constant- the constant to evaluatestate- the current execution statepp- the program point that where this operation is being evaluated- Returns:
- the evaluation of the constant
- Throws:
SemanticException- if an error occurs during the computation
-
evalUnaryExpression
protected InferredValue.InferredPair<NonInterference> evalUnaryExpression(UnaryOperator operator, NonInterference arg, NonInterference state, ProgramPoint pp) throws SemanticException
Description copied from class:BaseInferredValueYields the evaluation of aUnaryExpressionapplyingoperatorto an expression whose abstract value isarg. It is guaranteed thatargis notLattice.bottom().- Overrides:
evalUnaryExpressionin classBaseInferredValue<NonInterference>- Parameters:
operator- the operator applied by the expressionarg- the instance of this domain representing the abstract value of the expresion's argumentstate- the current execution statepp- the program point that where this operation is being evaluated- Returns:
- the evaluation of the expression
- Throws:
SemanticException- if an error occurs during the computation
-
evalBinaryExpression
protected InferredValue.InferredPair<NonInterference> evalBinaryExpression(BinaryOperator operator, NonInterference left, NonInterference right, NonInterference state, ProgramPoint pp) throws SemanticException
Description copied from class:BaseInferredValueYields the evaluation of aBinaryExpressionapplyingoperatorto two expressions whose abstract value areleftandright, respectively. It is guaranteed that bothleftandrightare notLattice.bottom()and thatoperatoris neitherBinaryOperator.TYPE_CASTnorBinaryOperator.TYPE_CONV.- Overrides:
evalBinaryExpressionin classBaseInferredValue<NonInterference>- Parameters:
operator- the operator applied by the expressionleft- the instance of this domain representing the abstract value of the left-hand side argumentright- the instance of this domain representing the abstract value of the right-hand side argumentstate- the current execution statepp- the program point that where this operation is being evaluated- Returns:
- the evaluation of the expression
- Throws:
SemanticException- if an error occurs during the computation
-
evalTernaryExpression
protected InferredValue.InferredPair<NonInterference> evalTernaryExpression(TernaryOperator operator, NonInterference left, NonInterference middle, NonInterference right, NonInterference state, ProgramPoint pp) throws SemanticException
Description copied from class:BaseInferredValueYields the evaluation of aTernaryExpressionapplyingoperatorto two expressions whose abstract value areleft,middleandright, respectively. It is guaranteed that bothleftandrightare notLattice.bottom().- Overrides:
evalTernaryExpressionin classBaseInferredValue<NonInterference>- Parameters:
operator- the operator applied by the expressionleft- the instance of this domain representing the abstract value of the left-hand side argumentmiddle- the instance of this domain representing the abstract value of the middle argumentright- the instance of this domain representing the abstract value of the right-hand side argumentstate- the current execution statepp- the program point that where this operation is being evaluated- Returns:
- the evaluation of the expression
- Throws:
SemanticException- if an error occurs during the computation
-
evalIdentifier
protected InferredValue.InferredPair<NonInterference> evalIdentifier(Identifier id, InferenceSystem<NonInterference> environment, ProgramPoint pp) throws SemanticException
Description copied from class:BaseInferredValueYields the evaluation of an identifier in a given environment.- Overrides:
evalIdentifierin classBaseInferredValue<NonInterference>- Parameters:
id- the identifier to be evaluatedenvironment- the environment where the identifier must be evaluatedpp- the program point that where this operation is being evaluated- Returns:
- the evaluation of the identifier
- Throws:
SemanticException- if an error occurs during the computation
-
variable
public NonInterference variable(Identifier id, ProgramPoint pp)
Description copied from interface:NonRelationalElementYields 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)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 evaluated- Returns:
- the fixed abstraction of the variable
-
tracksIdentifiers
public boolean tracksIdentifiers(Identifier id)
Description copied from interface:SemanticEvaluatorYieldstrueif the domain tracks information on the identifierid,falseotherwise.- Parameters:
id- the identifier- Returns:
trueif the domain tracks information on the identifierid,falseotherwise
-
canProcess
public boolean canProcess(SymbolicExpression expression)
Description copied from interface:SemanticEvaluatorYieldstrueif the domain can processexpression,falseotherwise.- Parameters:
expression- the expression- Returns:
trueif the domain can processexpression,falseotherwise.
-
assume
public InferenceSystem<NonInterference> assume(InferenceSystem<NonInterference> environment, ValueExpression expression, ProgramPoint pp) throws SemanticException
Description copied from interface:NonRelationalElementYields the environmentenvironmenton which the expressionexpressionis assumed to hold by this domain.- Specified by:
assumein interfaceNonRelationalElement<NonInterference,ValueExpression,InferenceSystem<NonInterference>>- Overrides:
assumein classBaseInferredValue<NonInterference>- Parameters:
environment- the environmentexpression- the expression to be assumedpp- the program point whereexpressionoccurs.- Returns:
- the environment
environmentwhereexpressionis assumed to hold - Throws:
SemanticException- if an error occurs during the computation
-
-