论文标题

基于操作的程序等效证明使用LCTRS

Operationally-based Program Equivalence Proofs using LCTRSs

论文作者

Ciobâcă, Ştefan, Lucanu, Dorel, Buruiană, Andrei Sebastian

论文摘要

我们提出了一种基于操作的计划对等效性的演绎法。它基于将语言语义编码为逻辑上受约束的术语重写系统(LCTRS)和两个程序作为术语。我们方法的主要特征是它的灵活性。我们在两个新颖的应用中说明了这种灵活性。对于第一个应用程序,我们将展示如何编码低级详细信息,例如语言语义中的堆栈大小,以及如何在不同级别的抽象级别运行的两个程序之间证明等效性。在我们的运行示例中,我们展示了我们的方法如何证明具有无限堆栈运行的递归函数与其尾部回复的优化版本与有界堆栈一起运行。这种类型的等效检查可用于确保不会通过更具体的抽象来引入新的,不良的行为。对于第二个应用程序,我们通过以保守的方式扩展操作语义来展示如何正式化符号表达式和陈述的写入集。这实现了程序模式的关系验证,我们利用这些验证来证明编译器优化的正确性,其中一些无法通过现有工具证明。我们的方法需要用公理符号扩展标准LCTRS。我们还提出了一个原型实现,该实施证明了我们提出的这两种应用的可行性。

We propose an operationally-based deductive proof method for program equivalence. It is based on encoding the language semantics as logically constrained term rewriting systems (LCTRSs) and the two programs as terms. The main feature of our method is its flexibility. We illustrate this flexibility in two applications, which are novel. For the first application, we show how to encode low-level details such as stack size in the language semantics and how to prove equivalence between two programs operating at different levels of abstraction. For our running example, we show how our method can prove equivalence between a recursive function operating with an unbounded stack and its tail-recursive optimized version operating with a bounded stack. This type of equivalence checking can be used to ensure that new, undesirable behavior is not introduced by a more concrete level of abstraction. For the second application, we show how to formalize read-sets and write-sets of symbolic expressions and statements by extending the operational semantics in a conservative way. This enables the relational verification of program schemas, which we exploit to prove correctness of compiler optimizations, some of which cannot be proven by existing tools. Our method requires an extension of standard LCTRSs with axiomatized symbols. We also present a prototype implementation that proves the feasibility of both applications that we propose.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源