The figure below illustrates the data declaration portion of an example Cobol program (the leftmost box), a corresponding logical data model, and links between the two (the dashed edges). The logical model is recovered by analyzing the usage of the data in the statements in the program (which are omitted, for brevity).

Significance of the logical data model and links
The example above illustrates the significance of the various elements of logical data models:
- Each logical type (e.g., Transaction, Order) is linked to one or more declared variables. Additionally, fields of logical types are linked to fields of declared variables.
- Certain types are linked to more than one variable. For instance, Order is linked to ORDER-BUF and to ORDER-REC, which implies that both these variables are used to store orders. This information is not available in the data declarations itself (Cobol has no user-defined types). It is implicitly present in the program's code, and can be inferred only by an analysis of the program's statements (e.g., there might be a sequence of statements that copy the value in one of these two variables to the other); the logical data model, together with the links, enables program understanding by making this information explicit.
- Note that in the logical model "New Order" is a subtype of Transaction. This means that the variable NTR-TRANSACTION-REC (which is linked to New Order) stores "new order" transactions, whereas TRANSACTION-REC (which is linked to Transaction) stores new-order transactions and as well as other kinds of transactions (at different times). Again, this information is not available in the data declarations.
- The solid arrows between logical types are associations between the types caused by foreign keys. For instance, the association from Transaction to Order implies that a field in the transaction record (field TRANS-DET-KEY) serves as a foreign key into the set of order records; i.e., intuitively, a transaction pertains to an order. Cobol data declarations do not specify foreign keys. In other words, foreign-key-based associations are implicit in the program (e.g., a statement in the program might use the current value in TRANS-DET-KEY to lookup a corresponding order record). The logical model adds value by making such associations explicit.
Note that the links between the logical and physical models are central to the usefulness of our tool. For instance, the links allow programmers to express queries about the program in terms of its logical model, and then map the query results back to the source-code level, if necessary, to obtain a more fine-grained, low-level view of those results. The links also enable the planning and execution of program transformations through the lens of the logical model.
