Skip to content

Commit 87dc9a3

Browse files
committed
Add explaination of heirarchy of goto model classes
This existence of an abstract interface was previously mentioned but not properly explained or justified.
1 parent 9a6b9b4 commit 87dc9a3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

doc/architectural/central-data-structures.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ The following is some light technical documentation of the major data structures
88
used in the input transformation to Intermediate Representation (IR) inside
99
CBMC and the assorted CProver tools.
1010

11-
## goto_modelt
11+
## GOTO models
1212

13-
The `goto_modelt` is the top-level data structure that CBMC (and the other
13+
The `goto_modelt` class is the top-level data structure that CBMC (and the other
1414
tools) use for holding the GOTO intermediate representation. The following
1515
diagram is a simplified view of how the data structures relate to each other -
1616

@@ -70,8 +70,15 @@ type goto_modelt {
7070
}
7171
```
7272

73-
The abstract interface of `goto_modelt` is outlined in the file
73+
There is an abstract interface for goto models provided by the
74+
`abstract_goto_modelt` class. This is defined and documented in the file
7475
[`src/goto-programs/abstract_goto_model.h`](../../src/goto-programs/abstract_goto_model.h).
76+
Ideally code which takes a goto model as input should accept any implementation
77+
of the abstract interface rather than accepting the concrete `goto_modelt`
78+
exclusively. This helps with compatibility with `jbmc` which uses lazy loading.
79+
See the `lazy_goto_modelt` class which is defined and documented in
80+
[`jbmc/src/java_bytecode/lazy_goto_model.h`](../../jbmc/src/java_bytecode/lazy_goto_model.h)
81+
for details of lazy loading.
7582

7683
## goto_functiont
7784

0 commit comments

Comments
 (0)