Skip to content

Commit c7b714d

Browse files
author
Joel Allred
committed
Peter's comments 2
Remove --function from one of the examples
1 parent b759c22 commit c7b714d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

doc/cprover-manual/jbmc-user-manual.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ from `java.lang.String`, e.g.
167167
2|
168168
3| public class ExampleModels {
169169
4|
170-
5| public static void stringOp() {
170+
5| public static void main(String[] args) {
171171
6| StringBuilder sb = new StringBuilder("abcd");
172172
7| StringBuilder sb2 = sb.insert(2, "$");
173173
8| assert sb2.toString().startsWith("abc");
@@ -178,13 +178,17 @@ from `java.lang.String`, e.g.
178178
The following command line (note that the current directory is also added to
179179
the classpath):
180180

181-
$ jbmc ExampleModels.class --function tutorial.ExampleModels.stringOp --cp <path_to_cbmc>/jbmc/src/java_bytecode/library/core-models.jar:.
181+
$ jbmc ExampleModels.class --cp <path_to_cbmc>/jbmc/src/java_bytecode/library/core-models.jar:.
182182

183183
will flag this violation (truncated):
184184
```c
185185
[java::tutorial.ExampleModels.stringOp:()V.assertion.1] line 8 assertion: FAILURE
186186
```
187-
Again, the trace shows the string violating the condition in the assertion:
187+
Also note that when we want the main function of the class to be the entry
188+
point of the analysis, we can remove the `--function` option.
189+
190+
Again, the trace (when re-running with `--trace`) shows the string violating
191+
the condition in the assertion:
188192
```c
189193
dynamic_object2={ 'a', 'b', '$', 'c', 'd' }
190194
```

0 commit comments

Comments
 (0)