Skip to main content

Synthesis of Programs from Unfold/Fold Proofs

  • Conference paper

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

Abstract

We address some issues related to the use of equivalence formulas for transforming and synthesizing logic programs.

In the first part of the paper we describe a program transformation method based on the unfold/fold rules which can be used for proving that a given first order equivalence formula of the form: ∀X (∃Y F(X,Y) ↔ ∃Z G(X,Z)), where F and G are conjunctions of atoms, is true in the least Herbrand model of a given program. Equivalence formulas of that form can be used to perform goal replacement steps, which allow us to transform clauses by replacing goals by equivalent ones while preserving the least Herbrand model. We provide some simple conditions ensuring total correctness of the goal replacement steps.

In the second part of the paper we show how the unfold/fold proof method described in the first part can be applied for solving synthesis problems which can be formulated as follows. Let us consider a program P and an equivalence formula of the form: ∀X (∃Y F(X,Y) ↔ ∃Z (H(X,Z), newp(X,Z))), where F and H contain predicates defined in P and newp is a predicate symbol not occurring in P. We want to synthesize a set of clauses, say Eureka, such that the above equivalence formula is true in the least Herbrand model of P ∪Eureka.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bates JL, Constable RL. Proofs as programs. ACM Toplas 1985; 7: 113–136

    Article  MATH  Google Scholar 

  2. Bossi A, Cocco N, Dulli S. A method for specializing logic programs. ACM Toplas 1990; 12: 253–302

    Article  Google Scholar 

  3. Bossi A, Cocco N, Etalle S. Transforming normal programs by replacement. In: Pettorossi A (ed) Meta-programming in logic, Proceedings of the Third International Workshop. Springer-Verlag, Berlin, 1992, pp 265–279 (Lecture notes in computer science no. 649)

    Google Scholar 

  4. Boulanger D, Bruynooghe M. Deriving fold/unfold transformations of logic programs using extended OLDT-based abstract interpretation. Technical report, CW no. 163, Catholic University of Leuven, Belgium, 1992

    Google Scholar 

  5. Brough DR, Hogger CJ. Grammar-related transformations of logic programs. New Generation Computing 1991; 9: 115–134

    Article  MATH  Google Scholar 

  6. Bundy A, Smaill A, Wiggins G. The synthesis of logic programs from inductive proofs. In: Lloyd JW (ed) Computational logic, Symposium Proceedings, Brussels, November 1990. Springer-Verlag, Berlin, 1990, pp 135–149

    Google Scholar 

  7. Burstall RM, Darlington J. A transformation system for developing recursive programs. Journal of the ACM 1977; 24: 44–67

    Article  MathSciNet  MATH  Google Scholar 

  8. Clark KL, Tärnlund S-A. A first order theory of data and programs. In: Proceedings Information Processing 77. North Holland, 1977, pp 939–944

    Google Scholar 

  9. Fribourg L. Extracting logic programs from proofs that use extended Prolog execution and induction. In: Warren HD, Szeredi P (eds) Proceedings Seventh International Conference on Logic Programming, Jerusalem, Israel, June 18–20, 1990. The MIT Press, 1990, pp 685–699

    Google Scholar 

  10. Gallagher J, de Waal DA. Deletion of redundant unary type predicates from logic programs. In: Lau K-K, Clement T (eds) Logic program synthesis and transformation“, Proceedings of LoPSTr ‘82, Manchester 1992. Springer-Verlag, London, 1993, pp 151–167 (Workshops in Computing)

    Google Scholar 

  11. Gardner PA, Shepherdson JC. Unfold/fold transformations of logic programs. In: Lassez J-L, Plotkin G (eds) Computational logic, Essays in honor of Alan Robinson. The MIT Press, 1991, 565–583

    Google Scholar 

  12. Hansson A, Tärnlund S-A. Program transformation by data structure mapping. In: Clark KL, Tärnlund S-A (eds) Logic programming. Academic Press, 1982, pp 117–122

    Google Scholar 

  13. Kakas AC, Kowalski RA, Toni F. Abductive logic programming. Journal of Logic and Computation 1992; 2: 719–770

    Article  MathSciNet  MATH  Google Scholar 

  14. Kanamori T, Maeji M. Derivation of logic programs from implicit definition. Technical report, TR-178, ICOT, Tokyo, Japan, 1986

    Google Scholar 

  15. Kott L. The McCarthy’s recursion induction principle: “oldy” but “goody”. Calcolo 1982; 19: 59–69

    Article  MathSciNet  MATH  Google Scholar 

  16. Kraan I, Basin D, Bundy A. Logic program synthesis via proof planning. In: Lau K-K, Clement T (eds) Logic program synthesis and transformation, Proceedings of LoPSTr ‘82, Manchester 1992. Springer-Verlag, London, 1993, pp 1–14 (Workshops in Computing)

    Google Scholar 

  17. Lloyd JW, Shepherdson JC. Partial evaluation in logic programming. Journal of Logic Programming 1991; 11: 217–242

    Article  MathSciNet  MATH  Google Scholar 

  18. Maher MJ. Correctness of a logic program transformation system. IBM Research Report RC 13496, T.J. Watson Research Center, 1987

    Google Scholar 

  19. Manna Z, Waldinger R. A deductive approach to program synthesis. ACM Toplas, 1980; 2: 90–121

    Article  MATH  Google Scholar 

  20. Proietti M, Pettorossi A. The loop absorption and the generalization strategies for the development of logic programs and partial deduction. Journal of Logic Programming 1993; 16: 123–161

    Article  MathSciNet  MATH  Google Scholar 

  21. Sterling L, Shapiro E. The art of Prolog. The MIT Press, 1986

    Google Scholar 

  22. Tamaki H, Sato T. Unfold/fold transformation of logic programs. In: Tärnlund S-A (ed) Proceedings 2nd International Conference on Logic Programming. Uppsala, Sweden, 1984, pp 243–251

    Google Scholar 

  23. Zhang J. An automatic d-list transformation algorithm for Prolog programs. Technical report, Department of Computer Science, University College of Swansea, U.K., 1987

    Google Scholar 

  24. Zhang J, Grant PW. An automatic difference-list transformation algorithm for Prolog. In: Kodratoff Y (ed) Proceedings 1988 European Conference on Artificial Intelligence, ECAI 88. Pitman, 1988, pp 320–325

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1994 British Computer Society

About this paper

Cite this paper

Proietti, M., Pettorossi, A. (1994). Synthesis of Programs from Unfold/Fold Proofs. In: Deville, Y. (eds) Logic Program Synthesis and Transformation. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3234-9_13

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-3234-9_13

  • Publisher Name: Springer, London

  • Print ISBN: 978-3-540-19864-2

  • Online ISBN: 978-1-4471-3234-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics