Find out how to access previewonly content
Date:
21 Jun 2002
Inverting Functions as Folds
 ShinCheng Mu,
 Richard Bird
 … show all 2 hide
Abstract
This paper is devoted to the proof and applications of a theorem giving conditions under which the inverse of a partial function can be expressed as a relational hylomorphism. The theorem is a generalisation of a previous result, due to Bird and de Moor, that gave conditions under which a total function can be expressed a relational fold. The theorem is illustrated with three problems, all dealing with constructing trees with various properties.
 S. M. Abramov and R. Glück. The universal resolving algorithm: inverse computation in a functional language. In R. C. Backhouse and J. N. F. d. Oliveira, editors, Mathematics of Program Construction 2000, number 1837 in Lecture Notes in Computer Science, pages 187–212. SpringerVerlag, 2000. CrossRef
 R. C. Backhouse, P. de Bruin, G. Malcolm, T. S. Voermans, and J. van der Woude. Relational catamorphisms. In B. Moller, editor, Proceedings of the IFIP TC2/WG2.1 Working Conference on Constructing Programs, pages 287–318. Elsevier Science Publishers B.V., 1991.
 R. C. Backhouse and P. F. Hoogendijk. Elements of a relational theory of datatypes. In B. Moller, H. Partsch, and S. A. Schuman, editors, Formal Program Development. Proc. IFIP TC2/WG 2.1 State of the Art Seminar., number 755 in Lecture Notes in Computer Science, pages 7–42. SpringerVerlag, January 1992.
 R. S. Bird. On building trees with minimum height. Journal of Functional Programming, 7(4):441–445, 1997. CrossRef
 R. S. Bird and O. de Moor. Algebra of Programming. International Series in Computer Science. Prentice Hall, 1997.
 R. S. Bird, J. Gibbons, and S.C. Mu. Algebraic methods for optimization problems. In R. C. Backhouse, R. Crole, and J. Gibbons, editors, Algebraic and Coalgebraic Methods in the Mathematics of Program Construction, number 2297 in Lecture Notes in Computer Science, pages 281–307. SpringerVerlag, January 2002. CrossRef
 W. Chen and J. T. Udding. Program inversion: more than fun! Science of Computer Programming, 15:1–13, 1990. CrossRef
 T.R. Chuang and B. Goldberg. Realtime deques, multihead Turing machines, and purely functional programming. In Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, June 1993. ACM Press.
 O. de Moor and J. Gibbons. Pointwise relational programming. In Proceedings of Algebraic Methodology and Software Technology 2000, number 1816 in Lecture Notes in Computer Science, pages 371–390. SpringerVerlag, May 2000. CrossRef
 E. W. Dijkstra. Program inversion. Technical Report EWD671, Eindhoven University of Technology, 1978.
 H. Doornbos and R. C. Backhouse. Induction and recursion on datatypes. In B. Moller, editor, Mathematics of Program Construction, 3rd International Conference, number 947 in Lecture Notes in Computer Science, pages 242–256. SpringerVerlag, July 1995.
 J. Gibbons, G. Hutton, and T. Altenkirch. When is a function a fold or an unfold? In A. Corradini, M. Lenisa, and U. Montanari, editors, Coalgebraic Methods in Computer Science, number 44.1 in Electronic Notes in Theoretical Computer Science, April 2001.
 J. Gibbons and G. Jones. Lineartime breadthfirst tree algorithms: an exercise in the arithmetic of folds and zips. Technical report, University of Auckland, 1993. University of Auckland Computer Science Report No. 71, and IFIP Working Group 2.1 working paper 705 WIN2.
 D. Gries. The Science of Programming. Springer Verlag, 1981.
 D. Gries and J. L. van de Snepscheut. Inorder traversal of a binary tree and its inversion. In E. W. Dijkstra, editor, Formal Development of Programs and Proofs, pages 37–42. Addison Wesley, 1990.
 P. G. Harrison and H. Khoshnevisan. On the synthesis of function inverses. Acta Informatica, 29:211–239, 1992. CrossRef
 P. F. Hoogendijk and O. de Moor. Container types categorically. Journal of Functional Programming, 10(2):191–225, March 2000.
 T. C. Hu and A. C. Tucker. Optimal computer search trees and variablelength alphabetical codes. SIAM Journal on Applied Mathematics, 21(4):514–532, 1971. CrossRef
 E. Knapen. Relational Programming, Program Inversion, and the Derivation of Parsing Algorithms. Master’s thesis, Eindhoven University of Technology, 23 November 1993.
 R. E. Korf. Inversion of applicative programs. In Proceedings of the Seventh Intern. Joint Conference on Artificial Intelligence (IJCAI81), pages 1007–1009. William Kaufmann, Inc., 1981.
 C. Okasaki. Simple and efficient purely functional queues and deques. Journal of Functional Programming, 5(4):583–592, 1995. CrossRef
 C. Okasaki. Breadthfirst numbering: lessons from a small exercise in algorithm design. In Proceedings of the 2000 ACM SIGPLAN International Conference on Functional Programming, pages 131–136. ACM Press, September 2000.
 C. ParejaFlores and J. Á. VelázquezIturbide. Synthesis of functions by transformations and constraints. In Proceedings of the 1997 ACM SIGPLAN International Conference on Functional Programming, page 317, Amsterdam, The Netherlands, June 1997. ACM Press.
 B. J. Ross. Running programs backwards: the logical inversion of imperative computation. Formal Aspects of Computing Journal, 9:331–348, 1997. CrossRef
 B. Schoenmakers. Inorder traversal of a binary heap and its inversion in optimal time and space. In Mathematics of Program Construction 1992, number 669 in Lecture Notes in Computer Science, pages 291–301. SpringerVerlag, 1993.
 J. L. van de Snepscheut. Inversion of a recursive tree traversal. Technical Report JAN 171a, California Institute of Technology, May 1991. Available online at ftp://ftp.cs.caltech.edu/tr/cstr9107.ps.Z.
 Title
 Inverting Functions as Folds
 Book Title
 Mathematics of Program Construction
 Book Subtitle
 6th International Conference, MPC 2002 Dagstuhl Castle, Germany, July 8–10, 2002 Proceedings
 Pages
 pp 209232
 Copyright
 2002
 DOI
 10.1007/354045442X_13
 Print ISBN
 9783540438571
 Online ISBN
 9783540454427
 Series Title
 Lecture Notes in Computer Science
 Series Volume
 2386
 Series ISSN
 03029743
 Publisher
 Springer Berlin Heidelberg
 Copyright Holder
 SpringerVerlag Berlin Heidelberg
 Additional Links
 Topics
 Industry Sectors
 eBook Packages
 Editors

 Eerke A. Boiten ^{(4)}
 Bernhard Möller ^{(5)}
 Editor Affiliations

 4. Computing Laboratory, University of Kent at Canterbury
 5. Institut für Informatik, Universität Augsburg
 Authors

 ShinCheng Mu ^{(6)}
 Richard Bird ^{(6)}
 Author Affiliations

 6. Programming Research Group, Oxford University, Wolfson Building, Parks Road, OX1 3QD, UK
Continue reading...
To view the rest of this content please follow the download PDF link above.