基于 SMT 的类型错误定位现代化

Max Kopinsky, Brigitte Pientka, Xujie Si
{"title":"基于 SMT 的类型错误定位现代化","authors":"Max Kopinsky, Brigitte Pientka, Xujie Si","doi":"arxiv-2408.09034","DOIUrl":null,"url":null,"abstract":"Traditional implementations of strongly-typed functional programming\nlanguages often miss the root cause of type errors. As a consequence, type\nerror messages are often misleading and confusing - particularly for students\nlearning such a language. We describe Tyro, a type error localization tool\nwhich determines the optimal source of an error for ill-typed programs\nfollowing fundamental ideas by Pavlinovic et al. : we first translate typing\nconstraints into SMT (Satisfiability Modulo Theories) using an intermediate\nrepresentation which is more readable than the actual SMT encoding; during this\nphase we apply a new encoding for polymorphic types. Second, we translate our\nintermediate representation into an actual SMT encoding and take advantage of\nrecent advancements in off-the-shelf SMT solvers to effectively find optimal\nerror sources for ill-typed programs. Our design maintains the separation of\nheuristic and search also present in prior and similar work. In addition, our\narchitecture design increases modularity, re-usability, and trust in the\noverall architecture using an intermediate representation to facilitate the\nsafe generation of the SMT encoding. We believe this design principle will\napply to many other tools that leverage SMT solvers. Our experimental evaluation reinforces that the SMT approach finds accurate\nerror sources using both expert-labeled programs and an automated method for\nlarger-scale analysis. Compared to prior work, Tyro lays the basis for\nlarge-scale evaluation of error localization techniques, which can be\nintegrated into programming environments and enable us to understand the impact\nof precise error messages for students in practice.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-08-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Modernizing SMT-Based Type Error Localization\",\"authors\":\"Max Kopinsky, Brigitte Pientka, Xujie Si\",\"doi\":\"arxiv-2408.09034\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Traditional implementations of strongly-typed functional programming\\nlanguages often miss the root cause of type errors. As a consequence, type\\nerror messages are often misleading and confusing - particularly for students\\nlearning such a language. We describe Tyro, a type error localization tool\\nwhich determines the optimal source of an error for ill-typed programs\\nfollowing fundamental ideas by Pavlinovic et al. : we first translate typing\\nconstraints into SMT (Satisfiability Modulo Theories) using an intermediate\\nrepresentation which is more readable than the actual SMT encoding; during this\\nphase we apply a new encoding for polymorphic types. Second, we translate our\\nintermediate representation into an actual SMT encoding and take advantage of\\nrecent advancements in off-the-shelf SMT solvers to effectively find optimal\\nerror sources for ill-typed programs. Our design maintains the separation of\\nheuristic and search also present in prior and similar work. In addition, our\\narchitecture design increases modularity, re-usability, and trust in the\\noverall architecture using an intermediate representation to facilitate the\\nsafe generation of the SMT encoding. We believe this design principle will\\napply to many other tools that leverage SMT solvers. Our experimental evaluation reinforces that the SMT approach finds accurate\\nerror sources using both expert-labeled programs and an automated method for\\nlarger-scale analysis. Compared to prior work, Tyro lays the basis for\\nlarge-scale evaluation of error localization techniques, which can be\\nintegrated into programming environments and enable us to understand the impact\\nof precise error messages for students in practice.\",\"PeriodicalId\":501197,\"journal\":{\"name\":\"arXiv - CS - Programming Languages\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-08-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Programming Languages\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2408.09034\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.09034","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

强类型函数式编程语言的传统实现往往忽略了类型错误的根本原因。因此,类型错误信息往往具有误导性和迷惑性,对于学习这种语言的学生来说尤其如此。我们介绍了 Tyro,这是一种类型错误定位工具,它可以根据 Pavlinovic 等人的基本思想,确定类型错误程序的最佳错误源:我们首先使用一种比实际 SMT 编码更具可读性的中间表示法,将类型约束翻译成 SMT(满足度模态理论);在这一阶段,我们为多态类型应用了一种新的编码。其次,我们将中间表示转化为实际的 SMT 编码,并利用现成 SMT 求解器的最新进展,有效地为类型不佳的程序找到最佳错误源。我们的设计保持了之前类似工作中的启发式和搜索分离。此外,我们的架构设计还增加了模块性、可重用性和整体架构的信任度,使用中间表示法来促进 SMT 编码的安全生成。我们相信这一设计原则将适用于其他许多利用 SMT 解算器的工具。我们的实验评估证明,SMT 方法可以利用专家标注的程序和用于更大规模分析的自动方法找到准确的错误源。与之前的工作相比,Tyro 为错误定位技术的大规模评估奠定了基础,这种技术可以集成到编程环境中,使我们能够在实践中了解精确错误信息对学生的影响。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Modernizing SMT-Based Type Error Localization
Traditional implementations of strongly-typed functional programming languages often miss the root cause of type errors. As a consequence, type error messages are often misleading and confusing - particularly for students learning such a language. We describe Tyro, a type error localization tool which determines the optimal source of an error for ill-typed programs following fundamental ideas by Pavlinovic et al. : we first translate typing constraints into SMT (Satisfiability Modulo Theories) using an intermediate representation which is more readable than the actual SMT encoding; during this phase we apply a new encoding for polymorphic types. Second, we translate our intermediate representation into an actual SMT encoding and take advantage of recent advancements in off-the-shelf SMT solvers to effectively find optimal error sources for ill-typed programs. Our design maintains the separation of heuristic and search also present in prior and similar work. In addition, our architecture design increases modularity, re-usability, and trust in the overall architecture using an intermediate representation to facilitate the safe generation of the SMT encoding. We believe this design principle will apply to many other tools that leverage SMT solvers. Our experimental evaluation reinforces that the SMT approach finds accurate error sources using both expert-labeled programs and an automated method for larger-scale analysis. Compared to prior work, Tyro lays the basis for large-scale evaluation of error localization techniques, which can be integrated into programming environments and enable us to understand the impact of precise error messages for students in practice.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信