Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] Issue on value analysis with loops
- Subject: [Frama-c-discuss] Issue on value analysis with loops
- From: boris at yakobowski.org (Boris Yakobowski)
- Date: Thu, 20 Jan 2011 16:59:01 +0100
- In-reply-to: <AANLkTikhWpiCWfi6mm4eoSQ202By0EZTOF-kE1pCeATb@mail.gmail.com>
- References: <AANLkTi=d6Jmq-b9cKMwsrkqjdXp22=0UhAvj=0SRifHo@mail.gmail.com> <AANLkTikRUEYNCDZHEWmASrA3apWPpC87EFH1coF83fVB@mail.gmail.com> <AANLkTikhWpiCWfi6mm4eoSQ202By0EZTOF-kE1pCeATb@mail.gmail.com>
On Thu, Jan 20, 2011 at 4:40 PM, David MENTRE <dmentre at linux-france.org> wrote: > Two other questions for the same program: > ?* Why the "i = i + 1" in the for() loop of the original program is > transformed into "i++; i++;"? The first i++ is the loop incrementation, while the second one is your i = i+1. Cil (which is used by Frama-C as parser) does not record the difference between i=i+1, i+=1 and i++, and chooses to print them using the most idiomatic form. In debug mode, the printer is as simple as possible, and print incrementation using += . > ?* Why value 0 appears for next statement's value of the last "i++" in > the loop (sid: 7 in the debug version)? I would have expected "i ? {2; > 4; 6; 8; 10; }". Is it because, once again, the next statement is the > point after the while() loop? Depending on how I read your question, the answer may be yes or no. If by "after the while loop()" you reason syntactically and mean just above the "return" statement, then the answer is no. A this point, i only has value 10, as can be seen by evaluating it with the right-button menu. "Next statement" (both the printed message and the notion used by Cil) actually refer to the execution flow of the program. In this case, the control flows from i++ to the while itself (sid 2), and we once more have 0 in the possible values for i (in case we haven't started iterating). -- Boris
- Follow-Ups:
- [Frama-c-discuss] Issue on value analysis with loops
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] Issue on value analysis with loops
- References:
- [Frama-c-discuss] Issue on value analysis with loops
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] Issue on value analysis with loops
- From: boris at yakobowski.org (Boris Yakobowski)
- [Frama-c-discuss] Issue on value analysis with loops
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] Issue on value analysis with loops
- Prev by Date: [Frama-c-discuss] Issue on value analysis with loops
- Next by Date: [Frama-c-discuss] Issue on value analysis with loops
- Previous by thread: [Frama-c-discuss] Issue on value analysis with loops
- Next by thread: [Frama-c-discuss] Issue on value analysis with loops
- Index(es):