首页> 外文期刊>Journal of Functional Programming >Systematic identification and communication of type errors*
【24h】

Systematic identification and communication of type errors*

机译:系统识别和传达类型错误*

获取原文
获取原文并翻译 | 示例
       

摘要

When 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.
机译:当类型推断失败时,通常很难在许多潜在候选对象中查明类型错误的原因。由于类型信息的可用性有限,生成信息性消息以消除类型错误是另一项艰巨的任务。在过去的三十年中,已经开发出许多方法来帮助调试类型错误。但是,这些方法大多数都存在以下一个或多个问题:(1)不完整,它们错过了真正的原因。 (2)它们涵盖了许多潜在原因,没有加以区分。 (3)他们很少或根本没有提供有关如何消除类型错误的信息。这些问题中的任何一个都会使类型错误调试过程变成繁琐而无效的工作。为解决此问题,我们开发了一种称为反事实类型的方法,该方法(1)在AST树叶中找到一组全面的错误原因,(2)计算有关如何消除每种错误的类型错误的信息原因(3)对所有消息进行排名,并针对最可能的错误原因迭代显示该消息。最大的技术挑战是有效生成所有错误消息,这似乎在表达式的大小上是指数级的。我们通过采用变体类型的想法来解决这一挑战,该概念系统地重用共享部分的计算,并通过只键入整个错误类型的表达式来生成所有消息。我们已经从文献中以前的出版物中收集的大量示例中评估了我们的方法。评估结果表明,我们的方法优于以前的方法,在计算上是可行的。

著录项

  • 来源
    《Journal of Functional Programming》 |2018年第2018期|e2.1-e2.48|共48页
  • 作者

    Chen Sheng; Erwig Martin;

  • 作者单位

    UL Lafayette, Lafayette, LA 70504 USA;

    Oregon State Univ, Corvallis, OR 97331 USA;

  • 收录信息 美国《科学引文索引》(SCI);
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

  • 入库时间 2022-08-18 02:48:42

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号