Request and Assert: A pragmatic approach to generating specialization scenarios
No Thumbnail Available
Date
2006-11-13T07:09:20Z
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
A specialization scenario provides a programmer friendly mechanism communicating the information about specialization opportunities to partial evaluators. Unfortunately, the process of generating suitable scenarios remains an art only mastered by programmers with in-depth knowledge about partial evaluation.
Existing works on generating scenarios either rely on a brute-force approach to generate all possible scenarios, or to introduce specific design patterns into the programming to facilitate extracting specialization scenarios. In this paper, we provide a lightweight approach to partial evaluation by enabling non-experts to declare two simple specialization concerns: request and assert. The request enables a programmer to declare specialization opportunities and an assert aims to prevent undesirable partial evaluation, such as infinite specialization, from occurring. We describe an algorithm that derives specialization scenarios by declaring the necessary binding-time values at program inputs, aiming at fulfilling any request and satisfy the assert meanwhile.