On stage ordering in staged computation

  • Authors:
  • Zhenghao Wang;Richard R. Muntz

  • Affiliations:
  • Computer Science Department, University of California Los Angeles;Computer Science Department, University of California Los Angeles

  • Venue:
  • Proceedings of the 2nd international conference on Generative programming and component engineering
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

A staged computation is a computation organized in a cascade of stages: each stage produces code for its successive stage; the final stage produces the desired output. An off-line procedure called binding time analysis (BTA) is often used to pre-convert unstaged code into staged code, i.e., code annotated with stage labels, which can guide online staged computation. For dynamic re-optimization purposes, it is advantageous for the order of stages in the cascade to change during runtime; however, the staged code may not support all permutations of stage sequences. Thus, it is both a and practical question to efficiently decide whether a specific stage sequence is valid for a staged code.Our approach is to encode the set of valid stage sequences for a staged code off-line in a stage ordering language (SOL) to facilitate fast online decision. Contrary to the intuition that we only need a single generic SOL (such as the language of posets of stage labels) to sufficiently and efficiently encode the set of valid stage sequences for any staged code in any staged language, we may need different SOLs for different staged languages. We analyze several staged languages and then present a metatheory on validating a SOL for a given staged language. Our result reveals the relationship between SOLs and semantic properties of staged languages, and can influence the design of staged languages and BTA.