arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1201.6057cs.PL
收藏

结构化数据遍历程序中的编程错误

Programming errors in traversal programs over structured data

Ralf Laemmel, Simon Thompson, Markus Kaiser

摘要:

Traffic strategies á la Strafunski和“Scrap Your Boilerplate”提供了一种非常通用和统一的方法来查询和转换深度嵌套和异构结构的数据,包括函数式编程和重写中的术语、OO编程中的对象以及XML编程中的XML文档。然而,由此产生的遍历程序容易出现编程错误。我们特别关注超出保守类型错误的错误;我们检查的示例包括发散遍历、过早终止的遍历和带有死代码的遍历。基于可能的编程错误清单,我们探讨了静态类型和静态分析的选项,以便可以避免某些类别的错误。这种探索产生了对策略库及其底层程序设计语言的改进建议。Haskell用于插图和规格说明,并提供充分的解释,以使非专业人员能够理解演示文稿。总体思想是语言不可知论的,并据此进行了总结。

英文摘要:

Traversal strategies á la Stratego (also á la Strafunski and 'Scrap Your Boilerplate') provide an exceptionally versatile and uniform means of querying and transforming deeply nested and heterogeneously structured data including terms in functional programming and rewriting, objects in OO programming, and XML documents in XML programming. However, the resulting traversal programs are prone to programming errors. We are specifically concerned with errors that go beyond conservative type errors; examples we examine include divergent traversals, prematurely terminated traversals, and traversals with dead code. Based on an inventory of possible programming errors we explore options of static typing and static analysis so that some categories of errors can be avoided. This exploration generates suggestions for improvements to strategy libraries as well as their underlying programming languages. Haskell is used for illustrations and specifications with sufficient explanations to make the presentation comprehensible to the non-specialist. The overall ideas are language-agnostic and they are summarized accordingly.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑