Compiling by Proving: Language-Agnostic Automatic Optimization from Formal Semantics

Jianhong Zhao, Everett Hildenbrandt, Juan Conejero, Yongwang Zhao
9/26/2025
cs.PLcs.CL

No confident code implementation found for this paper.

Abstract

Verification proofs encode complete program behavior, yet we discard them after checking correctness. We present compiling by proving, a paradigm that transforms these proofs into optimized execution rules.

Show full abstract

By constructing All-Path Reachability Proofs through symbolic execution and compiling their graph structure, we consolidate many semantic rewrites into single rules while preserving correctness by construction. We implement this as a language-agnostic extension to the K framework. Evaluation demonstrates performance improvements across different compilation scopes: opcode-level optimizations show consistent speedups, while whole-program compilation achieves orders of magnitude greater performance gains.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhao2025compiling,
  title  = {Compiling by Proving: Language-Agnostic Automatic Optimization from Formal Semantics},
  author = {Jianhong Zhao and Everett Hildenbrandt and Juan Conejero and Yongwang Zhao},
  year   = {2025},
  eprint = {2509.21793},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.21793v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.21793.svg)](https://codeofpaper.com/paper/2509.21793)

Discussion