Proceedings Article10.1145/2535838.2535863
Counter-factual typing for debugging type errors
Sheng Chen,Martin Erwig +1 more
- 08 Jan 2014
- Vol. 49, Iss: 1, pp 583-594
72
TL;DR: This work presents an approach to the problem of type debugging that is based on generating and filtering a comprehensive set of type-change suggestions and finds that it outperforms other approaches and provides a viable alternative.
read more
Abstract: Changing a program in response to a type error plays an important part in modern software development. However, the generation of good type error messages remains a problem for highly expressive type systems. Existing approaches often suffer from a lack of precision in locating errors and proposing remedies. Specifically, they either fail to locate the source of the type error consistently, or they report too many potential error locations. Moreover, the change suggestions offered are often incorrect. This makes the debugging process tedious and ineffective.We present an approach to the problem of type debugging that is based on generating and filtering a comprehensive set of type-change suggestions. Specifically, we generate all (program-structure-preserving) type changes that can possibly fix the type error. These suggestions will be ranked and presented to the programmer in an iterative fashion. In some cases we also produce suggestions to change the program. In most situations, this strategy delivers the correct change suggestions quickly, and at the same time never misses any rare suggestions. The computation of the potentially huge set of type-change suggestions is efficient since it is based on a variational type inference algorithm that type checks a program with variations only once, efficiently reusing type information for shared parts.We have evaluated our method and compared it with previous approaches. Based on a large set of examples drawn from the literature, we have found that our method outperforms other approaches and provides a viable alternative.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Extending Type Inference to Variational Programs
TL;DR: This work introduces the variational lambda calculus (VLC) as a formal foundation for research on typing variational programs and defines a type system for VLC in which VLC expressions are mapped to correspondingly variational types.
Toward general diagnosis of static errors
Danfeng Zhang,Andrew C. Myers +1 more
- 08 Jan 2014
TL;DR: A general way to locate programmer mistakes that are detected by static analyses such as type checking, and the results show that the general technique identifies the location of programmer errors significantly more accurately.
59
Live functional programming with typed holes
Cyrus Omar,Ian Voysey,Ravi Chugh,Matthew A. Hammer +3 more
- 02 Jan 2019
TL;DR: Hazelnut Live as mentioned in this paper is a proof-of-concept live programming environment with dynamic feedback that allows programmers to provide continuous feedback about a program's dynamic behavior as it is being edited.
58
Type error feedback via analytic program repair
Georgios Sakkas,Madeline Endres,Benjamin Cosman,Westley Weimer,Ranjit Jhala +4 more
- 11 Jun 2020
TL;DR: An evaluation of the accuracy and efficiency of Rite on a corpus of 4,500 ill-typed Ocaml programs drawn from two instances of an introductory programming course, and a user-study of the quality of the generated error messages that shows the locations and final repair quality to be better than the state-of-the-art tool in a statistically-significant manner.
34
A practical framework for type inference error explanation
Calvin Loncaric,Satish Chandra,Cole Schlesinger,Manu Sridharan +3 more
- 19 Oct 2016
TL;DR: This work shows how to produce correcting set-based error reports by leveraging existing type inference implementations, easing the burden of adoption and, as type inference algorithms tend to be efficient in practice, producing error reports of comparable quality to similar error reporting tools orders of magnitude faster.
30
References
Principal type-schemes for functional programs
Luis Damas,Robin Milner +1 more
- 25 Jan 1982
TL;DR: Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage.
Finding the source of type errors
Mitchell Wand
- 01 Jan 1986
TL;DR: An algorithm is described which appears to be quite helpful in isolating and explaining the source of type errors by keeping track of the reasons the type-checker makes deductions about the types of variables.
152
Proofs about a folklore let-polymorphic type inference algorithm
Oukseh Lee,Kwangkeun Yi +1 more
TL;DR: This article formally defines the context-sensitive, top-down type inference algorithm “”, proves its soundness and completeness, and shows a distinguishing property that it always stops earlier than M if the input program is ill typed.
Type error slicing in implicitly typed higher-order languages
Christian Haack,Joseph Brian Wells +1 more
- 01 Mar 2004
TL;DR: This work presents a new approach that identifies the location of a type error as a set of program points (a slice) all of which are necessary for the type error.
Explaining type inference
Dominic Duggan,Frederick Bent +1 more
TL;DR: A modification of the unification algorithm used in Hindley-Milner type inference is presented, which allows the specific reasoning which led to a program variable having a particular type to be recorded for type explanation.
92
Related Papers (5)
Christian Haack,Joseph Brian Wells +1 more
- 01 Mar 2004
Danfeng Zhang,Andrew C. Myers +1 more
- 08 Jan 2014
Mitchell Wand
- 01 Jan 1986
Jurriaan Hage,Bastiaan Heeren +1 more
- 04 Sep 2006