44
55### Iteration-based Unwinding
66
7- The basic idea of CBMC is to model the computation of the programs up to
8- a particular depth . Technically, this is achieved by a process that
7+ The basic idea of CBMC is to model a program's execution up to a
8+ bounded number of steps . Technically, this is achieved by a process that
99essentially amounts to * unwinding loops* . This concept is best
1010illustrated with a generic example:
1111
@@ -47,7 +47,7 @@ The construction above is meant to produce a program that is trace
4747equivalent with the original programs for those traces that contain up
4848to five iterations of the loop.
4949
50- In many cases, CBMC is able to automatically determine an upper bound on
50+ In many cases, CBMC is able to determine automatically an upper bound on
5151the number of loop iterations. This may even work when the number of
5252loop unwindings is not constant. Consider the following example:
5353
@@ -83,12 +83,12 @@ requires a limit of 101, and not 100.
8383
8484The setting given with ` --unwind ` is used globally, that is, for all
8585loops in the program. In order to set individual limits for the loops,
86- first use
86+ first use:
8787
8888 --show-loops
8989
9090to obtain a list of all loops in the program. Then identify the loops
91- you need to set a separate bound for, and note their loop ID. Then use
91+ you need to set a separate bound for, and note their loop ID. Then use:
9292
9393 --unwindset L:B,L:B,...
9494
@@ -138,8 +138,7 @@ execution time](http://en.wikipedia.org/wiki/Worst-case_execution_time)
138138(WCET).
139139
140140In some cases, it is desirable to cut off very deep loops in favor of
141- code that follows the loop. As an example, consider the following
142- program:
141+ code that follows the loop. As an example, consider this program:
143142
144143```C
145144int main() {
@@ -159,18 +158,18 @@ to the later assertion, use the option
159158This option will allow paths that execute loops only partially, enabling
160159a counterexample for the assertion above even for small unwinding
161160bounds. The disadvantage of using this option is that the resulting path
162- may be spurious, i.e., may not exist in the original program.
161+ may be spurious, that is, it may not exist in the original program.
163162
164163### Depth-based Unwinding
165164
166165The loop-based unwinding bound is not always appropriate. In particular,
167166it is often difficult to control the size of the generated formula when
168- using the ` --unwind ` option. The option
167+ using the ` --unwind ` option. The option:
169168
170169 --depth nr
171170
172171specifies an unwinding bound in terms of the number of instructions that
173- are executed on a given path, irrespectively of the number of loop
172+ are executed on a given path, irrespective of the number of loop
174173iterations. Note that CBMC uses the number of instructions in the
175174control-flow graph as the criterion, not the number of instructions in
176175the source code.
0 commit comments