On Practical SMT-Based Type Error Localization
Zvonimir Pavlinovic, Tim King, Thomas Wies

TL;DR
This paper introduces an efficient SMT-based algorithm for type error localization in statically typed functional languages, significantly improving speed and scalability over previous methods by iteratively expanding typing constraints.
Contribution
It presents a novel algorithm that uses an improved SMT encoding and iterative constraint expansion to efficiently find optimal type error sources, handling polymorphic types effectively.
Findings
Reduces localization time from minutes to seconds.
Scales better than previous algorithms.
Successfully implemented for OCaml.
Abstract
Compilers for statically typed functional programming languages are notorious for generating confusing type error messages. When the compiler detects a type error, it typically reports the program location where the type checking failed as the source of the error. Since other error sources are not even considered, the actual root cause is often missed. A more adequate approach is to consider all possible error sources and report the most useful one subject to some usefulness criterion. In our previous work, we showed that this approach can be formulated as an optimization problem related to satisfiability modulo theories (SMT). This formulation cleanly separates the heuristic nature of usefulness criteria from the underlying search problem. Unfortunately, algorithms that search for an optimal error source cannot directly use principal types which are crucial for dealing with the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Engineering Research · Teaching and Learning Programming
