用于安全策略式重写的追踪类型
Traced Types for Safe Strategic Rewriting
AI总结:
针对策略语言中重写组合可能错误的问题,提出结合结构化类型与执行路径追踪的静态类型系统,可检测必然失败和不可执行策略,并形式化证明类型可靠性。
摘要:
策略语言使程序员能够将重写规则组合成策略,并控制其应用。这在编程语言中非常有用,例如用于以组合方式描述程序变换;同时也用于自动定理证明,在该领域相关思想已通过战术语言得到研究。显然,并非所有重写组合都是正确的,但我们应如何帮助程序员编写正确的策略?本文提出了一种面向策略语言的静态类型系统。我们将结构化类型系统与一种新颖的追踪系统相结合:前者刻画重写策略如何改变被重写语法的形状,后者则跟踪所有可能的合法策略执行路径。当组合中的某些部分保证会在运行时失败时,我们的类型系统会发出警告;当某个策略不可能存在合法执行时,则发出错误。我们给出了策略语言及新颖追踪类型系统的形式化定义,并形式化证明了其类型可靠性。我们给出的形式化结果表明,追踪不良的策略保证会在运行时失败,而追踪良好的策略执行“不会出错”,即它们保证存在一条可能成功的执行路径。
英文摘要:
Strategy languages enable programmers to compose rewrite rules into strategies and control their application. This is useful in programming languages, e.g., for describing program transformations compositionally, but also in automated theorem proving, where related ideas have been studies with tactics languages. Clearly, not all compositions of rewrites are correct, but how can we assist programmers in writing correct strategies? In this paper, we present a static type system for strategy languages. We combine a structural type system capturing how rewrite strategies transform the shape of the rewritten syntax with a novel tracing system that keeps track of all possible legal strategy execution paths. Our type system raises warnings when parts of a composition are guaranteed to fail at runtime, and errors when no legal execution for a strategy is possible. We present a formalization of our strategy language and novel tracing type system, and formally prove its type soundness. We present formal results, showing that ill-traced strategies are guaranteed to fail at runtime and that well-traced strategy executions "can't go wrong", meaning that they are guaranteed to have a possible successful execution path.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。