Transposing Relations: From Maybe Functions to Hash Tables

  • José Nuno Fonseca de Oliveira
  • César de Jesus Pereira Cunha Rodrigues
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3125)


Functional transposition is a technique for converting relations into functions aimed at developing the relational algebra via the algebra of functions.

This paper attempts to develop a basis for generic transposition. Two instances of this construction are considered, one applicable to any relation and the other applicable to simple relations only.

Our illustration of the usefulness of the generic transpose takes advantage of the free theorem of a polymorphic function. We show how to derive laws of relational combinators as free theorems of their transposes. Finally, we relate the topic of functional transposition with the hashing technique for efficient data representation.


Binary Relation Simple Relation Hash Table Galois Connection Membership Relation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aarts, C., Backhouse, R., Hoogendijk, P., Voermans, E., van der Woude, J.: A relational theory of datatypes (December 1992)Google Scholar
  2. 2.
    Adámek, J., Herrlich, H., Strecker, G.E.: Abstract and Concrete Categories. John Wiley & Sons, Inc., Chichester (1990)zbMATHGoogle Scholar
  3. 3.
    Backhouse, K., Backhouse, R.C.: Safety of abstract interpretations for free,via logical relations and Galois connections. In: Science of Computer Programming (2003) (accepted for publication)Google Scholar
  4. 4.
    Backhouse, R.C.: Regular algebra applied to language problems, Available from, Extended version of Backhouse, R.: Fusion on languages. In: Sands, D. (ed.) ESOP 2001. LNCS, vol. 2028, pp. 107–121. Springer, Heidelberg (2001)
  5. 5.
    Backhouse, R.C., de Bruin, P., Hoogendijk, P., Malcolm, G., Voermans, T.S., van der Woude, J.: Polynomial relators. In: 2nd Int. Conf. Algebraic Methodology and Software Technology (AMAST 1991). LNCS, pp. 303–362. Springer, Heidelberg (1991)Google Scholar
  6. 6.
    Bird, R., deMoor, O.: Algebra of Programming. Series in Computer Science. Prentice-Hall International, Englewood Cliffs (1997), C.A.R. Hoare, series editorGoogle Scholar
  7. 7.
    Fitzgerald, J., Larsen, P.G.: Modelling Systems: Practical Tools and Techniques for Software Development, 1st edn. Cambridge University Press, Cambridge (1998)Google Scholar
  8. 8.
    Fokkinga, M.M.: Monadic maps and folds for arbitrary datatypes. Memoranda Informatica 94-28, University of Twente (June 1994) Google Scholar
  9. 9.
    Fokkinga, M.M., Meertens, L.: Adjunctions. Memoranda Informatica 94-31, University of Twente (June 1994) Google Scholar
  10. 10.
    Hoogendijk, P.: A Generic Theory of Data Types. PhD thesis, University of Eindhoven, The Netherlands (1997) Google Scholar
  11. 11.
    Hoogendijk, P.F., de Moor, O.: Container types categorically. Journal of Functional Programming 10(2), 191–225 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Horowitz, E., Sahni, S.: Fundamentals of Data Structures. Computer Software Engineering Series. Pitman (1978) E. Horowitz (ed.)Google Scholar
  13. 13.
    Peyton Jones, S.L.: Haskell 98 Language and Libraries. Cambridge University Press, Cambridge (2003), Also published as a Special Issue of the Journal of Functional Programming, 13(1) (January 2003)Google Scholar
  14. 14.
    Meng, S., Barbosa, L.S.: On refinement of generic state-based software components. In: Rattray, C., Maharaj, S., Shankland, C. (eds.) AMAST 2004. LNCS, vol. 3116, Springer, Heidelberg (2004) (to appear)Google Scholar
  15. 15.
    Oliveira, J.N.: Software Reification using the SETS Calculus. In: Denvir, T., Jones, C.B., Shaw, R.C. (eds.) Proc. of the BCS FACS 5th Refinement Workshop, Theory and Practice of Formal Software Development, London, UK, January 8-10, pp. 140–171. Springer, Heidelberg (1992) (Invited paper) ISBN 0387197524Google Scholar
  16. 16.
    Oliveira, J.N.: Hash Tables – A Case Study in ⊴ -calculation. Technical Report DI/INESC 94-12-1, INESC Group 2361, Braga (December 1994) Google Scholar
  17. 17.
    Oliveira, J.N.: ‘Fractal’ Types: an Attempt to Generalize Hash Table Calculation. In: Workshop on Generic Programming (WGP 1998), Marstrand, Sweden (June 1998)Google Scholar
  18. 18.
    Oliveira, J.N.: Hash tables as transposed data structures (2004), PURe Project technical report (in preparation) Google Scholar
  19. 19.
    Reynolds, J.C.: Types, abstraction and parametric polymorphism. Information Processing 83, 513–523 (1983)Google Scholar
  20. 20.
    Wadler, P.: Theorems for free! In: 4th International Symposium on Functional Programming Languages and Computer Architecture, London, September 1989, ACM, New York (1989)Google Scholar
  21. 21.
    Wirth, N.: Algorithms + Data Structures = Programs. Prentice-Hall, Englewood Cliffs (1976)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • José Nuno Fonseca de Oliveira
    • 1
  • César de Jesus Pereira Cunha Rodrigues
    • 1
  1. 1.Dep. InformáticaUniversidade do MinhoBragaPortugal

Personalised recommendations