Proceedings Article10.1145/2983990.2983994
A practical framework for type inference error explanation
Calvin Loncaric,Satish Chandra,Cole Schlesinger,Manu Sridharan +3 more
- 19 Oct 2016
- Vol. 51, Iss: 10, pp 781-799
30
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.
read more
Abstract: Many languages have support for automatic type inference. But when inference fails, the reported error messages can be unhelpful, highlighting a code location far from the source of the problem. Several lines of work have emerged proposing error reports derived from correcting sets: a set of program points that, when fixed, produce a well-typed program. Unfortunately, these approaches are tightly tied to specific languages; targeting a new language requires encoding a type inference algorithm for the language in a custom constraint system specific to the error reporting tool. We show 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. Many type inference algorithms are already formulated as dual phases of type constraint generation and solving; rather than (re)implementing type inference in an error explanation tool, we isolate the solving phase and treat it as an oracle for solving typing constraints. Given any set of typing constraints, error explanation proceeds by iteratively removing conflicting constraints from the initial constraint set until discovering a subset on which the solver succeeds; the constraints removed form a correcting set. Our approach is agnostic to the semantics of any particular language or type system, instead leveraging the existing type inference engine to give meaning to constraints.
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
•Journal Article
On solving the partial MAX-SAT problem
Zhaohui Fu,Sharad Malik +1 more
TL;DR: Two solvers are implemented for the Partial MAX-SAT problem; the relative strengths and thus applicability of the two solvers for different solution scenarios are discussed and how both techniques benefit from the persistent learning techniques of incremental SAT.
266
MaxSMT-Based Type Inference for Python 3
Mostafa Hassan,Caterina Urban,Marco Eilers,Peter Müller +3 more
- 14 Jul 2018
TL;DR: Typpete is a sound type inferencer that automatically infers Python 3 type annotations and uses optional constraints and specific quantifier instantiation patterns to make the constraint solving process efficient.
Type inference for static compilation of JavaScript
Satish Chandra,Colin S. Gordon,Jean-Baptiste Jeannin,Cole Schlesinger,Manu Sridharan,Frank Tip,Young-Il Choi +6 more
- 19 Oct 2016
TL;DR: A type system and inference algorithm for a rich subset of JavaScript equipped with objects, structural subtyping, prototype inheritance, and first-class methods is presented, expressed in a simple constraint language, designed to leverage off-the-shelf fixed point solvers.
44
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
•Proceedings Article
Migrating Gradual Types
John Peter Campora,Sheng Chen,Martin Erwig,Eric Walkingshaw +3 more
- 07 Jan 2018
TL;DR: Migrational typing is developed, which efficiently types all possible ways of adding or removing type annotations from a gradually typed program, and supports automatically migrating a program to be as static as possible, or introducing the least number of dynamic types necessary to remove a type error.
26
References
•Book
Introduction to Algorithms, third edition
Thomas H. Cormen,Charles E. Leiserson,Ronald L. Rivest,Clifford Stein +3 more
- 31 Jul 2009
TL;DR: Pseudo-code explanation of the algorithms coupled with proof of their accuracy makes this book a great resource on the basic tools used to analyze the performance of algorithms.
3.2K
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.
The SAT4J library, Release 2.2, System Description
Daniel Le Berre,Anne Parrain +1 more
TL;DR: This work provides a modular SAT solver architecture designed to work with generic constraints that is used to provide SAT, MaxSat and pseudo-boolean and solvers for lightweight constraint programming.
605
•Proceedings Article
QUICKXPLAIN: preferred explanations and relaxations for over-constrained problems
Ulrich Junker
- 25 Jul 2004
TL;DR: This work significantly accelerate the basic method by a divide-and-conquer strategy and thus provides the technological basis for the explanation facility of a principal industrial constraint programming tool, which is, for example, used in numerous configuration applications.
•Journal Article
On solving the partial MAX-SAT problem
Zhaohui Fu,Sharad Malik +1 more
TL;DR: Two solvers are implemented for the Partial MAX-SAT problem; the relative strengths and thus applicability of the two solvers for different solution scenarios are discussed and how both techniques benefit from the persistent learning techniques of incremental SAT.
266
Related Papers (5)
Danfeng Zhang,Andrew C. Myers +1 more
- 08 Jan 2014
Sheng Chen,Martin Erwig +1 more
- 08 Jan 2014
Christian Haack,Joseph Brian Wells +1 more
- 01 Mar 2004
Mitchell Wand
- 01 Jan 1986
Jurriaan Hage,Bastiaan Heeren +1 more
- 04 Sep 2006