Abstract
We give an algorithm for higher-order pattern matching in the context of automatic program transformation. In particular, we show how accumulating parameter optimisations of functional programs can be automatically derived with the aid of programmer annotations. These techniques have been successfully applied to some complex manual derivations in the literature, such as Bird’s “longest path-sequence”.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
H. P. Barendregt. The Lambda Calculus: Its Syntax and Semantics. Studies in Logic and the Foundations of Mathematics. North-Holland, 1984.
R. S Bird. The promotion and accumulation strategies in transformational programming. ACM Transactions on Programming Languages and Systems, 6(4):487–504, 1984.
R. S Bird. Introduction to Functional Programming in Haskell. International Series in Computer Science. Prentice Hall, 1998.
R. S. Bird and John Hughes. An alpha-beta algorithm: an exercise in program transformation. Information Processing Letters, 24(1):53–57, 1987.
O. Chitil. Type-inference based short cut deforestation (nearly) without inlining. In C. Clack and P. Koopman, editors, Eleventh International Workshop on Implementation of Functional Languages, Lecture Notes in Computer Science. Springer-Verlag, 2000.
H. Comon. Higher-order matching and tree automata. In M. Nielsen and W. Thomas, editors, Proc. Conf. on Computer Science Logic, volume 1414 of Lecture Notes in Computer Science, pages 157–176. Springer-Verlag, 1997.
O. de Moor and G. Sittampalam. Generic program transformation. In Third International Summer School on Advanced Functional Programming, volume 1608 of Lecture Notes in Computer Science, pages 116–149. Springer-Verlag, 1998.
O. de Moor and G. Sittampalam. Higher-order matching for program transformation (full report). Theoretical Computer Science, To appear, 2001. Available from URL: http://www.comlab.ox.ac.uk/oucl/users/oege.demoor/pubs.htm.
A. Gill, Launchbury J., and Peyton Jones S.L. A short cut to deforestation. In Conference on Functional Programming Languages and Computer Architecture, pages 223–232, June 1993.
G. Huet and B. Lang. Proving and applying program transformations expressed with second-order patterns. Acta Informatica, 11:31–55, 1978.
B. Krieg-Brückner, J. Liu, H. Shi, and B. Wolff. Towards correct, efficient and reusable transformational developments. In M. Broy and S. Jähnichen, editors, KORSO: Methods, Languages, and Tools for the Construction of Correct Software, volume 1009 of Lecture Notes in Computer Science, pages 270–284. Springer-Verlag, 1995.
D. Miller. A logic programming language with lambda-abstraction, function variables, and simple unification. Journal of Logic and Computation, 1:479–536, 1991.
T. Nipkow. Functional unification of higher-order patterns. In 8th IEEE Symposium on Logic in Computer Science, pages 64–74. IEEE Computer Society Press, 1993.
Y. Onoue, Z. Hu, H. Iwasaki, and M. Takeichi. A calculational fusion system hylo. In R. S. Bird and L. Meertens, editors, IFIP TC2 Working Conference on Algorithmic Languages and Calculi, pages 76–106. Chapman and Hall, 1997.
S. L. Peyton-Jones and A. L. M. Santos. A transformation-based optimiser for Haskell. Science of Computer Programming, 32(1-3):3–48, 1998.
F. Pfenning and C. Elliott. Higher-order abstract syntax. In Proc. SIGPLAN’ 88 Conf. on Programming Language Design and Implementation, pages 199–208. ACM, 1988.
D. R. Smith. KIDS: A semiautomatic program development system. IEEE Transactions on Software Engineering, 16(9):1024–1043, 1990.
D. A. Wolfram. The Clausal Theory of Types, volume 21 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1993.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sittampalam, G., de Moor, O. (2001). Higher-Order Pattern Matching for Automatically Applying Fusion Transformations. In: Danvy, O., Filinski, A. (eds) Programs as Data Objects. PADO 2001. Lecture Notes in Computer Science, vol 2053. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44978-7_13
Download citation
DOI: https://doi.org/10.1007/3-540-44978-7_13
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42068-2
Online ISBN: 978-3-540-44978-2
eBook Packages: Springer Book Archive