Skip to content

Commit 76fb32b

Browse files
author
Daniel Kroening
authored
Merge pull request #3533 from edstenson/review_loop_unwinding
Updated language use in cbmc-unwinding.md
2 parents 9c9ebfb + 80a8f70 commit 76fb32b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

doc/cprover-manual/cbmc-unwinding.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
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
99
essentially amounts to *unwinding loops*. This concept is best
1010
illustrated with a generic example:
1111

@@ -47,7 +47,7 @@ The construction above is meant to produce a program that is trace
4747
equivalent with the original programs for those traces that contain up
4848
to 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
5151
the number of loop iterations. This may even work when the number of
5252
loop unwindings is not constant. Consider the following example:
5353

@@ -83,12 +83,12 @@ requires a limit of 101, and not 100.
8383

8484
The setting given with `--unwind` is used globally, that is, for all
8585
loops in the program. In order to set individual limits for the loops,
86-
first use
86+
first use:
8787

8888
--show-loops
8989

9090
to 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
140140
In 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
145144
int main() {
@@ -159,18 +158,18 @@ to the later assertion, use the option
159158
This option will allow paths that execute loops only partially, enabling
160159
a counterexample for the assertion above even for small unwinding
161160
bounds. 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

166165
The loop-based unwinding bound is not always appropriate. In particular,
167166
it 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

172171
specifies 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
174173
iterations. Note that CBMC uses the number of instructions in the
175174
control-flow graph as the criterion, not the number of instructions in
176175
the source code.

0 commit comments

Comments
 (0)