Constructor specialization

  • Authors:
  • Torben Æ Mogensen

  • Affiliations:
  • -

  • Venue:
  • PEPM '93 Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

In the section on “challenging problems” in the proceedings from the first international workshop on partial evaluation and mixed computation [BEJ88] a question is stated: “Can PE be used to generate new specialized data types, in a way analogous to generating specialized functions”. Since then little has been done to address this problem. In [Lau89], new types are indeed generated, but they are all simpler versions of the types in the original program. It is, e.g. not possible to have types with more constructors than the types in the original program.I propose to alleviate this by means of constructor specialization. Constructors are specialized with respect to the static parts of their arguments, just like residual functions. I show how this is done and argue that it makes it possible to get good results from partial evaluation in cases where the traditional methods fail to produce satisfactory results. The discussion is centered around a small subset of Standard ML, but the idea applies equally well to other languages having user defined constructors, e.g. Haskell and Prolog.