- All Superinterfaces:
Sourceable
- All Known Subinterfaces:
AbstractFunctionCallExpression,AddressOfExpression,ArrayLambdaExpression,BinaryExpression,BooleanLiteralExpression,BoundVariableExpression,CastExpression,CharLiteralExpression,CompoundLiteralExpression,ConditionalExpression,DereferenceExpression,DerivativeCallExpression,DifferentiableExpression,DomainGuardExpression,DotExpression,DynamicTypeOfExpression,ExtendedQuantifiedExpression,FunctionCallExpression,FunctionGuardExpression,FunctionIdentifierExpression,HereOrRootExpression,InitialValueExpression,IntegerLiteralExpression,LambdaExpression,LHSExpression,LiteralExpression,MemoryUnitExpression,Nothing,ProcnullExpression,QuantifiedExpression,RealLiteralExpression,RecDomainLiteralExpression,RegularRangeExpression,ScopeofExpression,SelfExpression,SizeofExpression,SizeofTypeExpression,StatenullExpression,SubscriptExpression,SystemGuardExpression,UnaryExpression,UndefinedProcessExpression,VariableExpression,WildcardExpression
The parent of all expressions.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateConstantValue(dev.civl.sarl.IF.SymbolicUniverse universe) Calculates the constant value of this expression.voidCalculate the existence of dereferences in this expressiondev.civl.sarl.IF.expr.SymbolicExpressionThe immutable constant value of this expression.booleanchecks if this expression contains the constant $here.Returns the kind of this expressionComputes the set of variables which occur freely in this expression.booleanChecks if this expression has a constant value, i.e., constantValue() != NULL.booleanreturn true iff the expression has at least one dereferences of a certain pointer variablebooleanif this expression is guaranteed to be error-free and thus doesn't need any error checking.booleanvoidAnalyzes if this expression is purely localvoidpurelyLocalAnalysisOfVariables(Scope funcScope) Analyzes if variables accessed by this expression are purely localreplaceWith(ConditionalExpression oldExpression, Expression newExpression) Attempt to create a expression by replacing a certain conditional expression with a new expression, used when translating away conditional expressions without introduction temporal variablevoidreplaceWith(ConditionalExpression oldExpression, VariableExpression newExpression) Replace a certain conditional expression with a variable expression.voidsetErrorFree(boolean value) Compute the set of variables that appear in an address-of expression.variableAddressedOf(Scope scope) Compute the set of variables visible from a certain scope that appear in an address-of expression.Methods inherited from interface dev.civl.mc.model.IF.Sourceable
getSource, setCIVLSource
-
Method Details
-
expressionScope
Scope expressionScope()- Returns:
- The highest scope accessed by this expression. Null if no variables accessed.
-
lowestScope
Scope lowestScope() -
getExpressionType
CIVLType getExpressionType()- Returns:
- The type of this expression. For a primitive or variable, this is the type of the primitive or variable. For a cast expression it is the cast type. For operations it is the type of the operation result.
-
expressionKind
Expression.ExpressionKind expressionKind()Returns the kind of this expression- Returns:
- The expression kind
-
calculateDerefs
void calculateDerefs()Calculate the existence of dereferences in this expression -
hasDerefs
boolean hasDerefs()return true iff the expression has at least one dereferences of a certain pointer variable- Returns:
- True of False
-
purelyLocalAnalysisOfVariables
Analyzes if variables accessed by this expression are purely local- Parameters:
funcScope- The function scope of this expression
-
isPurelyLocal
boolean isPurelyLocal()- Returns:
- True iff the expression accessed only purely-local variables
-
purelyLocalAnalysis
void purelyLocalAnalysis()Analyzes if this expression is purely local -
replaceWith
Replace a certain conditional expression with a variable expression. Used when translating away conditional expressions with temporal variable- Parameters:
oldExpression- The conditional expressionnewExpression- The variable expression of the temporal variable for the conditional expression
-
replaceWith
Attempt to create a expression by replacing a certain conditional expression with a new expression, used when translating away conditional expressions without introduction temporal variable- Parameters:
oldExpression- The conditional expressionnewExpression- The new expression- Returns:
- Null if nothing is changed, otherwise the new expression
-
variableAddressedOf
Compute the set of variables visible from a certain scope that appear in an address-of expression. e.g.,(invalid input: '&a' + invalid input: '&b')returns{a}ifais in visible from the given scope whilebinvisible from the given scope.- Parameters:
scope- The scope to focus on.- Returns:
- a nullable set of variables; null equivalents to an empty set
-
variableAddressedOf
Compute the set of variables that appear in an address-of expression. e.g.,(invalid input: '&a' + invalid input: '&b')returns{a, b}.- Returns:
- a nullable set of variables; null equivalents to an empty set
-
constantValue
dev.civl.sarl.IF.expr.SymbolicExpression constantValue()The immutable constant value of this expression. NULL if the expression is not a constant.- Returns:
- the constant value of this expression. NULL if the expression is not a constant.
-
hasConstantValue
boolean hasConstantValue()Checks if this expression has a constant value, i.e., constantValue() != NULL.- Returns:
- true iff this expression has a constant value.
-
calculateConstantValue
void calculateConstantValue(dev.civl.sarl.IF.SymbolicUniverse universe) Calculates the constant value of this expression.- Parameters:
universe- The symbolic universe to be used.
-
containsHere
boolean containsHere()checks if this expression contains the constant $here. e.g.: sinvalid input: '<'$here would return true.- Returns:
-
setErrorFree
void setErrorFree(boolean value) -
isErrorFree
boolean isErrorFree()if this expression is guaranteed to be error-free and thus doesn't need any error checking. e.g., invalid input: '&anon'[0] which is used to translate array literals.- Returns:
-
freeVariables
Computes the set of variables which occur freely in this expression. "Free" means not bound, i.e., quantified variables are not included.- Returns:
- the set of free variables occurring in the expression
-