Abstract
We introduce a framework for assessing the effectiveness of partial evaluators in functional logic languages. Our framework is based on properties of the rewrite system that models a functional logic program. Consequently, our assessment is independent of any specific language implementation or computing environment. We define several criteria for measuring the cost of a computation: number of steps, number of function applications, and pattern matching effort. Most importantly, we express the cost of each criterion by means of recurrence equations over algebraic data types, which can be automatically inferred from the partial evaluation process itself. In some cases, the equations can be solved by transforming their arguments from arbitrary data types to natural numbers. In other cases, it is possible to estimate the improvement of a partial evaluation by analyzing the associated cost recurrence equations.
This is a preview of subscription content, log in via an 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
A. V. Aho, J. E. Hopcroft, and J. D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading, MA, 1974.
E. Albert, M. Alpuente, M. Falaschi, and G. Vidal. Indy User’s Manual. Technical Report DSIC-II/12/98, UPV, 1998.
E. Albert, S. Antoy, and G. Vidal. A Formal Approach to Reasoning about the Effectiveness of Partial Evaluation. Technical Report DSIC, UPV, 2000. Available from URL: http://www.dsic.upv.es/users/elp/papers.html.
E. Albert, M. Hanus, and G. Vidal. Using an Abstract Representation to Specialize Functional Logic Programs. In Proc. of the 7th Int’l Conf. on Logic for Programming and Automated Reasoning (LPAR’2000), pages 381–398. Springer LNAI 1955, 2000.
M. Alpuente, M. Falaschi, and G. Vidal. Partial Evaluation of Functional Logic Programs. ACM Transactions on Programming Languages and Systems, 20(4):768–844, 1998.
M. Alpuente, M. Hanus, S. Lucas, and G. Vidal. Specialization of Functional Logic Programs Based on Needed Narrowing. ACM Sigplan Notices, 34(9):273–283, 1999.
T. Amtoft. Properties of Unfolding-based Meta-level Systems. In Proc. of PEPM’91, pages 243–254. ACM Press, 1991.
L. O. Andersen and C. K. Gomard. Speedup Analysis in Partial Evaluation: Preliminary Results. In Proc. of PEPM’92, pages 1–7. Yale University, 1992.
S. Antoy. Definitional trees. In Proc. of the 3rd Int’l Conference on Algebraic and Logic Programming (ALP’92), pages 143–157. Springer LNCS 632, 1992.
S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4):776–822, 2000.
F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.
C. Consel and O. Danvy. Tutorial notes on Partial Evaluation. In Proc. of the Annual Symp. on Principles of Programming Languages (POPL’93), pages 493–501. ACM, New York, 1993.
S. K. Debray and N. W. Lin. Cost Analysis of Logic Programs. ACM Transactions on Programming Languages and Systems, 15(5):826–975, 1993.
J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM’93, pages 88–98. ACM, New York, 1993.
E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel Leaf: A Logic plus Functional Language. Journal of Computer and System Sciences, 42:363–377, 1991.
M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, 19&20:583–628, 1994.
M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at http://www-i2.informatik.rwth-aachen.de/~hanus/curry, 2000.
G. Huet and J. J. Lévy. Computations in orthogonal rewriting systems, Part I + II. In J. L. Lassez and G. D. Plotkin, editors, Computational Logic-Essays in Honor of Alan Robinson, pages 395–443, 1992.
M. P. Jones and A. Reid. The Hugs 98 User Manual. Available at http://haskell.cs.yale.edu/hugs/, 1998.
N. D. Jones. Partial Evaluation, Self-Application and Types. In M. S. Paterson, editor, Proc. of 17th Int’l Colloquium on Automata, Languages and Programming (ICALP’90), pages 639–659. Springer LNCS 443, 1990.
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.
Laura Lafave. A Constraint-based Partial Evaluator for Functional Logic Programs and its Application. PhD thesis, University of Bristol, 1999.
M. Leuschel, D. De Schreye, and A. de Waal. A Conceptual Embedding of Folding into Partial Deduction: Towards a Maximal Integration. In M. Maher, editor, Proc. of the Joint Int’l Conf. and Symp. on Logic Programming (JICSLP’96), pages 319–332. The MIT Press, Cambridge, MA, 1996.
Y. A. Liu and G. Gomez. Automatic Accurate Time-Bound Analysis for High-Level Languages. In Proc. of ACM SIGPLAN Workshop on Languages, Compilers, and Tools for Embedded Systems, pages 31–40. Springer LNCS 1474, 1998.
J. W. Lloyd and J. C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11:217–242, 1991.
R. Loogen, F. López-Fraguas, and M. Rodríguez-Artalejo. A Demand Driven Computation Strategy for Lazy Narrowing. In Proc. of 5th Int’l Symp. on Programming Language Implementation and Logic Programming (PLILP’93), pages 184–200. Springer LNCS 714, 1993.
F. J. López-Fraguas and J. Sánchez-Hernández. TOY: A Multiparadigm Declarative System. In Proc. of the 10th Int’l Conf. on Rewriting Techniques and Applications (RTA’99), pages 244–247. Springer LNCS 1631, 1999.
J. J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191–224, 1992.
F. Nielson. A Formal Type System for Comparing Partial Evaluators. In Proc. of the Int’l Workshop on Partial Evaluation and Mixed Computation, pages 349–384. N-H, 1988.
M. Rosendahl. Automatic Complexity Analysis. In Proc. of the Int’l Conf. on Functional Programming Languages and Computer Architecture, pages 144–156, New York, NY, 1989. ACM.
D. Sands. A Naive Time Analysis and its Theory of Cost Equivalence. Journal of Logic and Computation, 5(4):495–541, 1995.
D. Sands. Total Correctness by Local Improvement in the Transformation of Functional Programs. ACM Transactions on Programming Languages and Systems, 18(2):175–234, March 1996.
P. M. Sansom and S. L. Peyton-Jones. Formally Based Profiling for Higher-Order Functional Languages. ACM Transactions on Programming Languages and Systems, 19(2):334–385, 1997.
M. H. Sørensen. Turchin’s Supercompiler Revisited: An Operational Theory of Positive Information Propagation. Technical Report 94/7, Master’s Thesis, DIKU, University of Copenhagen, Denmark, 1994.
M. H. Sørensen, R. Glück, and N. D. Jones. A Positive Supercompiler. Journal of Functional Programming, 6(6):811–838, 1996.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Albert, E., Vidal, G., Antoy, S. (2001). Measuring the Effectiveness of Partial Evaluation in Functional Logic Languages. In: Logic Based Program Synthesis and Transformation. LOPSTR 2000. Lecture Notes in Computer Science, vol 2042. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45142-0_7
Download citation
DOI: https://doi.org/10.1007/3-540-45142-0_7
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42127-6
Online ISBN: 978-3-540-45142-6
eBook Packages: Springer Book Archive