Specialization of lazy functional logic programs

  • Authors:
  • M. Alpuente;M. Falaschi;P. Julián;G. Vidal

  • Affiliations:
  • DSIC, UPV, Camino de Vera s/n, 46071 Valencia, Spain;Dip. Matematica e Informatica, Via delle Scienze 206, 33100 Udine, Italy;Dep. de Informática, Ronda de Calatrava s/n, 13.071 Ciudad Real, Spain;DSIC, UPV, Camino de Vera s/n, 46071 Valencia, Spain

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

Quantified Score

Hi-index 0.00

Visualization

Abstract

Partial evaluation is a method for program specialization based on fold/unfold transformations [8, 25]. Partial evaluation of pure functional programs uses mainly static values of given data to specialize the program [15, 44]. In logic programming, the so-called static/dynamic distinction is hardly present, whereas considerations of determinacy and choice points are far more important for control [12]. We discuss these issues in the context of a (lazy) functional logic language. We formalize a two-phase specialization method for a non-strict, first order, integrated language which makes use of lazy narrowing to specialize the program w.r. t. a goal. The basic algorithm (first phase) is formalized as an instance of the framework for the partial evaluation of functional logic programs of [2, 3], using lazy narrowing. However, the results inherited by [2, 3] mainly regard the termination of the PE method, while the (strong) soundness and completeness results must be restated for the lazy strategy. A post-processing renaming scheme (second phase) is necessary which we describe and illustrate on the well-known matching example. This phase is essential also for other non-lazy narrowing strategies, like innermost narrowing, and our method can be easily extended to these strategies. We show that our method preserves the lazy narrowing semantics and that the inclusion of simplification steps in narrowing derivations can improve control during specialization.