- All Superinterfaces:
Sourceable
This represents a block of ACSL contract for a function.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumContractKind: This kind is used to denotes all kinds of contracts. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNamedBehavior(NamedFunctionBehavior behavior) Adds a named behavior to the function.Returns the default behavior of the function.getBehavior(String name) returns the behavior with the given name; null if no such behavior exists.guard()Returns the guard of the function.booleanis there assigns clause in this contract?booleanis there depends clause in this contract?booleanis there reads clause in this contract?booleanis there any requirements or ensurances ?booleanisPure()Does the contract containspureclause?Returns the named behaviors of the function.voidprint(String prefix, PrintStream out, boolean isDebug) prints this function contractscope()The static scope in which the function contract exists.voidsetDefaultBehavior(FunctionBehavior behavior) Sets the default behavior of the function.voidsetGuard(Expression expression) Sets the guard of the function.voidsetPure(boolean value) Updates the contract to denote if it containspureclause.Methods inherited from interface dev.civl.mc.model.IF.Sourceable
getSource, setCIVLSource
-
Method Details
-
defaultBehavior
FunctionBehavior defaultBehavior()Returns the default behavior of the function.- Returns:
-
namedBehaviors
Iterable<NamedFunctionBehavior> namedBehaviors()Returns the named behaviors of the function.- Returns:
-
guard
Expression guard()Returns the guard of the function.- Returns:
-
isPure
boolean isPure()Does the contract containspureclause?- Returns:
-
setPure
void setPure(boolean value) Updates the contract to denote if it containspureclause.- Parameters:
value-
-
setGuard
Sets the guard of the function.- Parameters:
expression-
-
setDefaultBehavior
Sets the default behavior of the function.- Parameters:
behavior-
-
addNamedBehavior
Adds a named behavior to the function.- Parameters:
behavior-
-
getBehavior
returns the behavior with the given name; null if no such behavior exists.- Parameters:
name-- Returns:
-
print
prints this function contract- Parameters:
prefix-out-isDebug-
-
hasReadsClause
boolean hasReadsClause()is there reads clause in this contract?- Returns:
-
hasAssignsClause
boolean hasAssignsClause()is there assigns clause in this contract?- Returns:
-
hasDependsClause
boolean hasDependsClause()is there depends clause in this contract?- Returns:
-
hasRequirementsOrEnsurances
boolean hasRequirementsOrEnsurances()is there any requirements or ensurances ?- Returns:
-
scope
Scope scope()The static scope in which the function contract exists. Not necessarily the same as the function definition's parameter scope, because the contract may have been associated with a function prototype.- Returns:
- scope in which contract exists
-