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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Knothe, David, Bringmann, Oliver
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917288658075648
author Knothe, David
Bringmann, Oliver
author_facet Knothe, David
Bringmann, Oliver
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2602_19868
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Combining Small-Step and Big-Step Semantics to Verify Loop Optimizations
Knothe, David
Bringmann, Oliver
Programming Languages
Logic in Computer Science
F.3.2; D.3.4; D.2.4
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.
title Combining Small-Step and Big-Step Semantics to Verify Loop Optimizations
topic Programming Languages
Logic in Computer Science
F.3.2; D.3.4; D.2.4
url https://arxiv.org/abs/2602.19868