The application of the transformational methodology to the area of logic programming is based on theoretical results which show that the Unfold/Fold transformation rules preserve both the least Herbrand model semantics and the set of answer substitutions semantics of logic programs [Tamaki-Sato 84, Kawamura-Kanamori 88]. Unfortunately, those semantics do not capture the termination behaviour of logic programs when they are evaluated under the standard depth-first search strategy of Prolog, which is the basis of most existing implementations of logic programming. As a consequence, the programmer is left with the hard task of checking that the transformation techniques given in the literature, behave conveniently when used for Prolog programs. In the present work we study the applicability of those techniques when logic programs are evaluated according to the Prolog depth-first search strategy, and in particular, we study the correctness of the Unfold/Fold transformations for Prolog programs. This work has been partially supported by the “Progetto Finalizzato Sistemi Informatici e Calcolo Parallclo” at-d by the MURST 40%, Ilaly, Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission. @ 1991 ACM 0-89791-433-3/91 10006 /0274 . ..S1 .5o We give some syntactical restrictions which ensure that the transformation rules preserve the sequence of answer substitutions semantics, which is one that has been proposed for Prolog [JonesMycroft 84], We believe that our work is a contribution towards making program transformation a more reliable and effective tool for the automatic development of Prolog programs.
[1]
Tadashi Kanamori,et al.
Preservation of Stronger Equivalence in Unfold/Fold Logic Program Transformation
,
1990,
Theor. Comput. Sci..
[2]
Saumya K. Debray,et al.
Denotational and Operational Semantics for Prolog
,
1988,
J. Log. Program..
[3]
Hisao Tamaki,et al.
Unfold/Fold Transformation of Logic Programs
,
1984,
ICLP.
[4]
Neil D. Jones,et al.
Stepwise Development of Operational and Denotational Semantics for Prolog
,
1984,
International Conference on Spoken Language Processing.
[5]
Alberto Pettorossi,et al.
Synthesis of Eureka Predicates for Developing Logic Programs
,
1990,
ESOP.
[6]
Jan Komorowski,et al.
Partial evaluation as a means for inferencing data structures in an applicative language: a theory and implementation in the case of prolog
,
1982,
POPL '82.
[7]
J. Vuillemin.
Proof techniques for recursive programs
,
1973
.
[8]
G. G. Stokes.
"J."
,
1890,
The New Yale Book of Quotations.
[9]
Chris Hankin,et al.
Abstract Interpretation of Declarative Languages
,
1987
.
[10]
John C. Shepherdson,et al.
Unfold/fold transformations of logic programs
,
1992,
Mathematical Structures in Computer Science.
[11]
J. Lloyd.
Foundations of Logic Programming
,
1984,
Symbolic Computation.
[12]
John Darlington,et al.
A Transformation System for Developing Recursive Programs
,
1977,
J. ACM.