Frama-C Bug Tracking System - Frama-C
View Issue Details
0000612Frama-CDocumentation > ACSLpublic2010-10-18 17:482014-02-12 16:55
Assigned Tovirgile 
PlatformOSOS Version
Product VersionFrama-C Boron-20100401 
Target VersionFrama-C Carbon-20101201-beta1Fixed in VersionFrama-C Carbon-20101201-beta1 
Summary0000612: Mention that invariant does not hold after for-loop
DescriptionThe ACSL-1.4 reference, available from, explains on p.35-36 where the invariant of a for-loop shall hold as follows: ``The predicate I holds ... right after the initialization expression ...; ­for a for (init; c; step) s loop, I must be preserved by the side-effects of c followed by s followed by step''.
While this is possibly the most compact explanation, it is based on the transformation of "for (init;c;step) s" into "init; while (1) { int C=c; if(!C) break; s; step; }", which seems to be rather unusual. As a consequence, the for-loop invariant does not hold after normal termination, if c has side-effects (cf. attached demonstration program).
This unexpected fact should be mentioned in the ACSL reference.
TagsNo tags attached.
Attached Filesc ftest.c (1,103) 2010-10-18 17:48

There are no notes attached to this issue.

Issue History
2010-10-18 17:48JochenNew Issue
2010-10-18 17:48JochenStatusnew => assigned
2010-10-18 17:48JochenAssigned To => signoles
2010-10-18 17:48JochenFile Added: ftest.c
2010-10-18 18:01signolesAssigned Tosignoles => virgile
2010-10-26 13:12virgileTarget Version => Frama-C Carbon
2010-12-02 16:54svn
2010-12-02 16:54svnStatusassigned => resolved
2010-12-02 16:54svnResolutionopen => fixed
2010-12-10 15:45signolesFixed in Version => Frama-C Carbon-20101201-beta1
2010-12-17 19:35signolesStatusresolved => closed
2013-12-19 01:12Source_changeset_attached => framac master d592363e
2014-02-12 16:55Source_changeset_attached => framac stable/neon d592363e
2016-06-21 14:11signolesCategoryDocumentation => Documentation > ACSL