Controlling generalization and polyvariance in partial deduction of normal logic programs

  • Authors:
  • Michael Leuschel;Bern Martens;Danny De Schreye

  • Affiliations:
  • Katholieke Univ. Leuven, Heverlee, Belgium;Katholieke Univ. Leuven, Heverlee, Belgium;Katholieke Univ. Leuven, Heverlee, Belgium

  • Venue:
  • ACM Transactions on Programming Languages and Systems (TOPLAS)
  • Year:
  • 1998

Quantified Score

Hi-index 0.01

Visualization

Abstract

Given a program and some input data, partial deduction computes a specialized program handling any remaining input more efficiently.However, controlling the process well is a rather difficult problem.In this article, we elaborate global control for partial deduction:for which atoms, among possibly infinitely many, should specialized relations be produced, meanwhile guaranteeing correctness as well as termination? Our work is based on two ingredients. First, we use the concept of a characteristic tree, encapsulating specialization behavior rather than syntactic structure, to guide generalization and polyvariance, and we show how this can be done in a correct andelegant way. Second, we structure combinations of atoms and associated characteristic trees in global trees registering “causal” relationships among such pairs. This allows us to spot looming nontermination and perform proper generalization in order to avert the danger, without having to impose a depth bound on characteristic trees. The practical relevance and benefits of the work areillustrated through extensive experiments. Finally, a similar approach may improve upon current (on-line) control strategies for program transformation in general such as (positive) supercompilation of functional programs. It also seems valuable in the context of abstract interpretation to handle infinite domains of infinite height with more precision.