Hostname: page-component-77c78cf97d-lmk9j Total loading time: 0 Render date: 2026-05-02T08:27:32.838Z Has data issue: false hasContentIssue false

Reasoning about multi-stage programs*

Published online by Cambridge University Press:  07 November 2016

JUN INOUE
Affiliation:
National Institute of Advanced Industrial Science and Technology, Ikeda, Osaka, Japan (e-mails: jun.inoue@aist.go.jp)
WALID TAHA
Affiliation:
Halmstad University, Halmstad, Halland, Sweden (e-mails: walid.taha@hh.se)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We settle three basic questions that naturally arise when verifying code generators written in multi-stage functional programming languages. First, does adding staging to a language compromise any equalities that hold in the base language? Unfortunately it does, and more care is needed to reason about terms with free variables. Second, staging annotations, as the name “annotations” suggests, are often thought to be orthogonal to the behavior of a program, but when is this formally guaranteed to be true? We give termination conditions that characterize when this guarantee holds. Finally, do multi-stage languages satisfy useful, standard extensional properties, for example, that functions agreeing on all arguments are equivalent? We provide a sound and complete notion of applicative bisimulation, which establishes such properties or, in principle, any valid program equivalence. These results yield important insights into staging and allow us to prove the correctness of quite complicated multi-stage programs.

Information

Type
Articles
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
Copyright © Cambridge University Press 2016
Submit a response

Discussions

No Discussions have been published for this article.