arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.19868cs.PLcs.LO
收藏

结合小步和大步语义来验证循环优化

Combining Small-Step and Big-Step Semantics to Verify Loop Optimizations

FZI Research Center for Information Technology, Karlsruhe, Germany(德国卡尔斯鲁厄 FZI 信息技术研究中心);University of Tübingen, Tübingen, Germany(德国蒂宾根大学)

David Knothe, Oliver Bringmann

AI总结:

本文提出结合小步和大步语义的方法,用于验证循环优化,通过引入抽象行为语义实现结构变换与局部变换的统一,提升编译器验证的表达能力。

摘要:

验证编译器旨在保证编译过程保持源程序的可观察行为。虽然小步语义在这样的编译器中被广泛应用,但它们并不总是结构变换(如循环优化)最方便的框架。本文提出了一种方法,结合了小步和大步语义:小步语义用于局部变换,而大步语义用于结构变换。引入了一个抽象行为语义作为两种风格之间的共同接口。扩展了共诱导的大步语义以正确处理有限和无限轨迹中的发散情况,使其表达能力与小步语义相当。这使大步变换能够插入到现有的小步流水线中间,从而完全保持所有顶层语义保持定理。这种方法在CompCert中得到了实际演示,通过在大步Cminor中实现和验证几个新的循环优化,包括循环展开和显著的完整循环展开。

英文摘要:

Verified compilers aim to guarantee that compilation preserves the observable behavior of source programs. While small-step semantics are widely used in such compilers, they are not always the most convenient framework for structural transformations such as loop optimizations. This paper proposes an approach that leverages both small-step and big-step semantics: small-step semantics are used for local transformations, while big-step semantics are employed for structural transformations. An abstract behavioral semantics is introduced as a common interface between the two styles. Coinductive big-step semantics is extended to correctly handle divergence with both finite and infinite traces, bringing it on par with the expressiveness of small-step semantics. This enables the insertion of big-step transformations into the middle of an existing small-step pipeline, thereby fully preserving all top-level semantic preservation theorems. This approach is practically demonstrated in CompCert by implementing and verifying a few new loop optimizations in big-step Cminor, including loop unswitching and, notably, full loop unrolling.

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

↑