Section A.1.2.3 of Waite places two constraints on declarations and uses of identifiers in C--:
Once consistent renaming has been completed, detecting a violation of these constraints is trivial:
Other languages may have more complex rules, but they are all straightforward to state in terms of a set of existing bindings.
To verify the results of name analysis, you need to demonstrate that the proper entity has been associated with each identifier and that error reports are issued when constraints have been violated.
It is relatively easy to demonstrate that error reports are being issued correctly: Simply apply the name analysis to programs that violate the constraints imposed by the language definition and observe the resulting error reports. In many cases, this process is also used to attempt to verify correct association. After all, if no error report is issued then the association must have been correct.
Using a lack of error reports to verify correct association is a very tricky business, however, because it relies on indirect evidence. For example, the fact that there is no error report for an applied occurrence of an identifier means that that identifier can be associated with some definition but there is no guarantee that the associated definition is the one required by the visibility rules of the language!
An attribution module that prints all identifier bindings is available in the Eli Library. Even if you are not using Eli, the documentation for that module may give you some ideas about how bindings could be verified.
Test your structural analyzer by applying it to the C-- test suite. If you feel that the test suite is inadequate, provide any additional tests you deem necessary. Note that since you are not doing type analysis, deviance tests that contain only type errors will not generate error reports.
Hand in your verification of the bindings in the factorial program. A directory containing the complete source code (or specifications, if you used tools) for your program must be permitted for world read by 1700 on the due date for this assignment. You need not make it available to be read by others before that time. Hand in the location of this directory (machine and path name).
Complete your personal postmortem for this assignment and your personal project plan for the next assignment, and submit them via the web before class on the due date of this assignment.
|Instructor||Revision 1.9 (1998/09/20 20:39:15)|