Abstract
This paper investigatesthe optimization by fold/unfold of functional-logic programswith operational semantics based on needed narrowing. Transformation sequences are automatically guided by tupling, a powerful strategy that avoids multiple accesses to data structures and redundant sub-computations. We systematically decompose in detail the internal structure of tupling in three low-level transformation phases (definition introduction, unfolding and abstraction with folding) that constitute the core of our automatic tupling algorithm. The resulting strategy is (strongly) correct and complete, efficient, elegant and realistic. In addition (and most important), our technique preserves the natural structure of multi-paradigm declarative programs, which contrasts with prior pure functional approachesthat produce corrupt integrated programswith (forbidden) overlapping rules.
This work hasb een partially supported by CICYT under grant TIC 2001-2705- C03-03 and by Acción Integrada Hispano-Italiana HI2000-0161, and the Valencian Research Council under grant GV01-424.
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
M. Alpuente, M. Falaschi, C. Ferri, G. Moreno, and G. Vidal. Un sistema de transformación para programasm ultiparadigma. Revista Iberoamericana de Inteligencia Artificial, X/99(8):27–35, 1999.
M. Alpuente, M. Falaschi, C. Ferri, G. Moreno, G. Vidal, and I. Ziliotto. The Transformation System synth. Technical Report DSIC-II/16/99, UPV, 1999. Available in URL: http://www.dsic.upv.es/users/elp/papers.html.
M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. Safe folding/unfolding with conditional narrowing. In H. Heering M. Hanusand K. Meinke, editors, Proc. of the International Conference on Algebraic and Logic Programming, ALP’97, Southampton (England), pages1–15. Springer LNCS 1298, 1997.
M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. A Transformation System for Lazy Functional Logic Programs. In A. Middeldorp and T. Sato, editors, Proc. of the 4th Fuji International Symposyum on Functional and Logic Programming, FLOPS’99, Tsukuba (Japan), pages147–162. Springer LNCS 1722, 1999.
M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. An Automatic Composition Algorithm for Functional Logic Programs. In V. Hlaváč, K. G. Jeffery, and J. Wiedermann, editors, Proc. of the 27th Annual Conference on Current Trends in Theory and Practice of Informatics, SOFSEM’2000, pages289–297. Springer LNCS 1963, 2000.
S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. In Proc. 21st ACM Symp. on Principles of Programming Languages, Portland, pages268–279, New York, 1994. ACM Press.
F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.
R.S. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403–418, 1980.
M. Bruynooghe, D. De Schreye, and B. Martens. A General Criterion for Avoiding Infinite Unfolding. New Generation Computing, 11(1):47–79, 1992.
R.M. Burstall and J. Darlington. A Transformation System for Developing Recursive Programs. Journal of the ACM, 24(1):44–67, 1977.
W. Chin. Towardsan Automated Tupling Strategy. In Proc. of Partial Evaluation and Semantics-Based Program Manipulation, 1993, pages119–132. ACM, New York, 1993.
W. Chin, A. Goh, and S. Khoo. Effective Optimisation of Multiple Traversals in Lazy Languages. In Proc. of Partial Evaluation and Semantics-Based Program Manipulation, San Antonio, Texas, USA (Technical Report BRICS-NS-99-1), pages 119–130. University of Aarhus, DK, 1999.
J. Darlington. Program transformation. In J. Darlington, P. Henderson, and D. A. Turner, editors, Functional Programming and its Applications, pages193–215. Cambridge University Press, 1982.
M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, 19&20:583–628, 1994.
G. Hutton. Fold and Unfold for Program Semantics. In Proc. of 3rd ACM SIGPLAN Int’l Conf. on Functional Programming, Baltimore, Maryland, 1998.
G. Moreno. Automatic Tupling for Functional-Logic Programs. Technical Report DIAB-02-07-24, UCLM, 2002. Available in URL: http://www.info-ab.uclm.es/personal/gmoreno/gmoreno.htm.
G. Moreno. Transformation Rulesand Strategiesfor Functional-Logic Programs. AI Communications, IO Press (Amsterdam), 15(2):3, 2002.
A. Pettorossi and M. Proietti. Transformation of Logic Programs: Foundations and Techniques. Journal of Logic Programming, 19,20:261–320, 1994.
A. Pettorossi and M. Proietti. A Comparative Revisitation of Some Program Transformation Techniques. In O. Danvy, R. Glück, and P. Thiemann, editors, Partial Evaluation, Int’l Seminar, Dagstuhl Castle, Germany, pages 355–385. Springer LNCS 1110, 1996.
A. Pettorossi and M. Proietti. Rules and Strategies for Transforming Functional and Logic Programs. ACM Computing Surveys, 28(2):360–414, 1996.
H. Tamaki and T. Sato. Unfold/Fold Transformations of Logic Programs. In S. Tärnlund, editor, Proc. of Second Int’l Conf. on Logic Programming, Uppsala, Sweden, pages127–139, 1984.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Moreno, G. (2002). Automatic Optimization of Multi-paradigm Declarative Programs. In: Garijo, F.J., Riquelme, J.C., Toro, M. (eds) Advances in Artificial Intelligence — IBERAMIA 2002. IBERAMIA 2002. Lecture Notes in Computer Science(), vol 2527. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36131-6_14
Download citation
DOI: https://doi.org/10.1007/3-540-36131-6_14
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-00131-7
Online ISBN: 978-3-540-36131-2
eBook Packages: Springer Book Archive