一句话:将可编程策略忠实编码为项重写系统,使策略控制重写的终止性可用现成终止工具分析。
重写被广泛用作编程和建模范式,但策略控制规则应用,其操作语义通常只被默认接受,终止性分析多局限于特定策略。本文提出一种通用编码,将 Maude、Stratego、Tom 等重写语言中的经典控制和遍历策略翻译为普通项重写系统。编码被证明可靠且完备,因此项重写已有终止性方法可直接分析策略控制项重写系统的终止性。作者将编码推广到多类签名,并用项的元层表示减小编码规模。Tom 实现生成 AProVE、TTT2 等终止工具可接受的 TRS;实验表明这些工具能有效证明或反驳终止性,且编码后性能与原生的 Tom 策略相当。该工作也可视为可集成到提供模式匹配原语语言中的通用策略编译器。
Rewriting is a formalism widely used in computer science and mathematical logic. When using rewriting as a programming or modeling paradigm, the rewrite rules describe the transformations one wants to operate and rewriting strategies are used to con- trol their application. The operational semantics of these strategies are generally accepted and approaches for analyzing the termination of specific strategies have been studied. We propose in this paper a generic encoding of classic control and traversal strategies used in rewrite based languages such as Maude, Stratego and Tom into a plain term rewriting system. The encoding is proven sound and complete and, as a direct consequence, estab- lished termination methods used for term rewriting systems can be applied to analyze the termination of strategy controlled term rewriting systems. We show that the encoding of strategies into term rewriting systems can be easily adapted to handle many-sorted signa- tures and we use a meta-level representation of terms to reduce the size of the encodings. The corresponding implementation in Tom generates term rewriting systems compatible with the syntax of termination tools such as AProVE and TTT2, tools which turned out to be very effective in (dis)proving the termination of the generated term rewriting systems. The approach can also be seen as a generic strategy compiler which can be integrated into languages providing pattern matching primitives; experiments in Tom show that applying our encoding leads to performances comparable to the native Tom strategies.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{CirsteaLM17,
title = {Faithful (meta-)encodings of programmable strategies into term rewriting systems},
author = {Horatiu Cirstea and Serguei Lenglet and Pierre-Etienne Moreau},
journal = {Logical Methods in Computer Science},
volume = {Volume 13, Issue 4},
year = {2017},
doi = {10.23638/lmcs-13(4:16)2017}
}