Total Type Error Localization and Recovery with Holes
Total Type Error Localization and Recovery with Holes
复制标题
总类型错误定位和带孔恢复
DOI:
10.1145/3632910
复制
发表时间:
2024
影响因子:
--
通讯作者:
Omar, Cyrus
中科院分区:
文献类型:
--
作者:
Zhao, Eric;Maroof, Raef;Dukkipati, Anand;Blinn, Andrew;Pan, Zhiyi;Omar, Cyrus
Type systems typically only define the conditions under which an expression is well-typed, leaving ill-typed expressions formally meaningless. This approach is insufficient as the basis for language servers driving modern programming environments, which are expected to recover from simultaneously localized errors and continue to provide a variety of downstream semantic services. This paper addresses this problem, contributing the first comprehensive formal account of total type error localization and recovery: the marked lambda calculus. In particular, we define a gradual type system for expressions with marked errors, which operate as non-empty holes, together with a total procedure for marking arbitrary unmarked expressions. We mechanize the metatheory of the marked lambda calculus in Agda and implement it, scaled up, as the new basis for Hazel, a full-scale live functional programming environment with, uniquely, no meaningless editor states.The marked lambda calculus is bidirectionally typed, so localization decisions are systematically predictable based on a local flow of typing information. Constraint-based type inference can bring more distant information to bear in discovering inconsistencies but this notoriously complicates error localization. We approach this problem by deploying constraint solving as a type-hole-filling layer atop this gradual bidirectionally typed core. Errors arising from inconsistent unification constraints are localized exclusively to type and expression holes, i.e. the system identifies unfillable holes using a system of traced provenances, rather than localized in an ad hoc manner to particular expressions. The user can then interactively shift these errors to particular downstream expressions by selecting from suggested partially consistent type hole fillings, which returns control back to the bidirectional system. We implement this type hole inference system in Hazel.
登录
查看更多内容
DOI:
--
发表时间:
2017
期刊:
Proc. ACM Program. Lang.
影响因子:
--
作者:
Eric L. Seidel;Huma Sibghat;Kamalika Chaudhuri;Westley Weimer;Ranjit Jhala
通讯作者:
Ranjit Jhala
DOI:
--
发表时间:
2011
期刊:
Symposium on Trends in Functional Programming
影响因子:
--
作者:
Thomas Schilling
通讯作者:
Thomas Schilling
DOI:
10.1145/3546196.3550164
发表时间:
2022
期刊:
Proceedings of the 7th ACM SIGPLAN International Workshop on Type-Driven Development
影响因子:
--
作者:
David Moon;Andrew Blinn;Cyrus Omar
通讯作者:
Cyrus Omar
影响因子:
--
作者:
Yuan, Yongwei;Guest, Scott;Griffis, Eric;Potter, Hannah;Moon, David;Omar, Cyrus
通讯作者:
Omar, Cyrus
DOI:
--
发表时间:
2016
期刊:
ACM-SIGACT Symposium on Principles of Programming Languages
影响因子:
--
作者:
M. Cimini;Jeremy G. Siek
通讯作者:
Jeremy G. Siek