Systematic identification and communication of type errors

Author:

CHEN SHENG,ERWIG MARTIN

Abstract

AbstractWhen type inference fails, it is often difficult to pinpoint the cause of the type error among many potential candidates. Generating informative messages to remove the type error is another difficult task due to the limited availability of type information. Over the last three decades many approaches have been developed to help debug type errors. However, most of these methods suffer from one or more of the following problems: (1) Being incomplete, they miss the real cause. (2) They cover many potential causes without distinguishing them. (3) They provide little or no information for how to remove the type error. Any one of this problems can turn the type-error debugging process into a tedious and ineffective endeavor. To address this issue, we have developed a method named counter-factual typing, which (1) finds a comprehensive set of error causes in AST leaves, (2) computes an informative message on how to get rid of the type error for each error cause, and (3) ranks all messages and iteratively presents the message for the most likely error cause. The biggest technical challenge is the efficient generation of all error messages, which seems to be exponential in the size of the expression. We address this challenge by employing the idea of variational typing that systematically reuses computations for shared parts and generates all messages by typing the whole ill-typed expression only once. We have evaluated our approach over a large set of examples collected from previous publications in the literature. The evaluation result shows that our approach outperforms previous approaches and is computationally feasible.

Publisher

Cambridge University Press (CUP)

Subject

Software

Reference50 articles.

1. Chen S. , Erwig M. & Walkingshaw E. (2012) An error-tolerant type system for variational lambda calculus. In Proceedings of ACM International Conference on Functional Programming, pp. 29–40.

2. Zhang D. & Myers A. C. (2014) Toward general diagnosis of static errors. In Proceedings of ACM Symposium on Principles of Programming Languages, pp. 569–581.

3. Yang J. (2001 May). Improving Polymorphic Type Explanations. Ph.D. thesis, Heriot-Watt University.

4. McAdam B. J. (2002b). Repairing Type Errors in Functional Programs. Ph.D. thesis, University of Edinburgh. College of Science and Engineering. School of Informatics.

5. Interactive type debugging in Haskell

Cited by 4 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Error Localization for Sequential Effect Systems;Static Analysis;2023

2. Efficient counter-factual type error debugging;Science of Computer Programming;2020-12

3. Live functional programming with typed holes;Proceedings of the ACM on Programming Languages;2019-01-02

4. Gradual liquid type inference;Proceedings of the ACM on Programming Languages;2018-10-24

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3