hn.today

Denotational Results in Compiler Correctness and Comparisons with Operational

arxiv.org5 points0 comments
Screenshot of Denotational Results in Compiler Correctness and Comparisons with Operational

Compiler correctness can be established using operational semantics, which describe program execution, or denotational semantics, which assign programs mathematical meanings. This work investigates whether denotational methods can handle a difficult compiler transformation: closure conversion, which turns lexically scoped functions into code and explicit environments. The compiler translates FPC, a language with recursive types and functions, into a first-order low-level language. The authors prove that closure conversion preserves and reflects program meaning, with reflection ensuring that target behavior does not introduce meanings absent from the source. They provide the first such denotational reflection proofs for closure conversion in a Turing-complete language, using both a graph model and Scott domains. The graph-model proof introduces an approximant logical relation; the Scott-domain proof adapts a relation developed by John Reynolds.

To compare proof styles in practice, the authors mechanize correctness proofs for an eight-pass FPC compiler targeting a typed low-level intermediate language. They examine five semantic approaches: two denotational and three operational. No approach produces the shortest proof across all passes. Operational proof size tends to increase when source and target executions differ substantially. Denotational proofs are compact when a pass’s correctness follows directly from equality of meanings, but can become lengthy when they require a logical relation. The results frame semantics choice as a pass-by-pass tradeoff rather than a contest with one universally superior method.

Read on arxiv.org0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Laravel Rust

Laravel Rust

Laravel for Rust is a full-stack web framework with routing, validation, database tools, background jobs, and real-time features. It also supports Inertia for frontend integration and is released under the MIT license. (github.com)

The Uberization of Software

The Uberization of Software

Ride-hailing apps greatly expanded demand for trips but undercut the value of taxi medallions and squeezed driver earnings by removing the supply limits that had protected them. The essay argues that software engineering faces a similar paradox: rising demand can lower workers’ pay when technology rapidly expands the supply of labor. (lsrx.net)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.