|
ABSTRACT
A crucial aspect of a program intended for general use is its behavior in the presence of erroneous inputs. For instance, much attention has been devoted to the problems of error detection, reporting, and correction in compilers<sup>1,2</sup>. As programming languages and systems based in one way or another on unification<sup>3</sup> become more common, it becomes increasingly important to develop a theory of error detection and correction for unification-based systems. We report here on a language-based editor for a variant of ML<sup>4</sup> that uses a novel approach to the isolation of likely causes of user errors. As the user edits and manipulates his or her program, unification is incrementally applied to determine its type correctness. If a type inconsistency arises, a maximum flow technique is applied to the set of type equations to determine the most likely source of error. In this way a determination can be made as to the relative strengths with which the set of type equations asserts multiple contradictory hypotheses. In a language such as ML, the type of an object is inferred from patterns of usage. Often it is the case that most uses of a given object are mutually consistent, whereas one or a very small number of uses conflict with the general usage pattern. In MOE (ML-Oriented Editor), if it is possible to discern that such a situation has arisen, likely errors are highlighted at high intensity and all other program components that contributed to the inferred type of the object are highlighted at a lower intensity. In providing error information to the user, two principles are observed:(1) Error indications should be complete but parsimonious; the user should see highlighted on the screen everything that contributed directly to an error, but nothing. more,(2) The user's attention should be drawn to what appear to be the anomalies that are responsible for errors.Language-based editors permit a new level of quality in the process of helping users when inputs are, for one reason or another, invalid. Unification-based type inference in language-based editors appears to have been first considered by Meertens 5. Snelting and Bahlke have more recently also explored this approach.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Fischer, Charles N., Donn R. Milton, and Jon Mauney, "A locally least-cost LL(1) error corrector," Tech. Report #371, University of Wisconsin (August 1979).
|
 |
2
|
|
 |
3
|
|
| |
4
|
Milner, R., "A theory of type polymorphism in programming," <i>Journal of Computer and System Sciences</i> <b>17</b>(1978).
|
 |
5
|
|
 |
6
|
|
 |
7
|
|
 |
8
|
David MacQueen , Gordon Plotkin , Ravi Sethi, An ideal model for recursive polymorphic types, Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, p.165-174, January 15-18, 1984, Salt Lake City, Utah, United States
[doi> 10.1145/800017.800528]
|
 |
9
|
|
 |
10
|
|
| |
11
|
|
| |
12
|
Cardelli, Luca, "Basic polymorphic typechecking," Technical report, AT&T Bell Laboratories (1984).
|
|