Download Value Analysis manual - Frama-C

Transcript
Chapter 7
Annotations
Frama-C’s language for annotations is ACSL. Only a subset of the properties that can be
expressed in ACSL can effectively be of service to or be checked by the value analysis plug-in.
7.1
7.1.1
Preconditions, postconditions and assertions
Truth value of a property
Each time it encounters a precondition, postcondition or user assertion, the analyzer evaluates
the truth value of the property in the state it is propagating. The result of this evaluation
can be:
• valid, indicating that the property is verified for the current state;
• invalid, indicating that the property is certainly false for the current state;
• unknown, indicating that the imprecision of the current state and/or the complexity of
the property do not allow to conclude in one way or the other.
If a property obtains the evaluation valid every time the analyzer goes through it, this means
that the property is valid under the hypotheses made by the analyzer.
When a property evaluates to invalid for some passages of the analysis, it does not necessarily
indicate a problem: the property is false only for the execution paths that the analyzer was
considering these times. It is possible that these paths do not to occur for any real execution.
The fact that the analyzer is considering these paths may be a consequence of a previous
approximation. However, if the property evaluates to invalid for all passages of the analysis,
then the code at that point is either dead or always reached in a state that does not satisfy
the property, and the program should be examined more closely.
69