Reasoning about multi-stage programs

  • Authors:
  • Jun Inoue;Walid Taha

  • Affiliations:
  • Rice University, Houston, TX;Halmstad University, Halmstad, Sweden and Rice University, Houston, TX

  • Venue:
  • ESOP'12 Proceedings of the 21st European conference on Programming Languages and Systems
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

We settle three basic questions that naturally arise when verifying multi-stage functional programs. Firstly, 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. Secondly, 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 facts--for example, that functions agreeing on all arguments are equivalent? We provide a sound and complete notion of applicative bisimulation, which establishes such facts or, in principle, any valid program equivalence. These results greatly improve our understanding of staging, and allow us to prove the correctness of quite complicated multi-stage programs.