Skip to main content

Advertisement

SpringerLink
Log in
Menu
Find a journal Publish with us Track your research
Search
Cart
Book cover

European Symposium on Programming

ESOP 2007: Programming Languages and Systems pp 95–109Cite as

  1. Home
  2. Programming Languages and Systems
  3. Conference paper
On the Implementation of Construction Functions for Non-free Concrete Data Types

On the Implementation of Construction Functions for Non-free Concrete Data Types

  • Frédéric Blanqui1,
  • Thérèse Hardin2 &
  • Pierre Weis3 
  • Conference paper
  • 951 Accesses

  • 4 Citations

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 4421)

Abstract

Many algorithms use concrete data types with some additional invariants. The set of values satisfying the invariants is often a set of representatives for the equivalence classes of some equational theory. For instance, a sorted list is a particular representative wrt commutativity. Theories like associativity, neutral element, idempotence, etc. are also very common. Now, when one wants to combine various invariants, it may be difficult to find the suitable representatives and to efficiently implement the invariants. The preservation of invariants throughout the whole program is even more difficult and error prone. Classically, the programmer solves this problem using a combination of two techniques: the definition of appropriate construction functions for the representatives and the consistent usage of these functions ensured via compiler verifications. The common way of ensuring consistency is to use an abstract data type for the representatives; unfortunately, pattern matching on representatives is lost. A more appealing alternative is to define a concrete data type with private constructors so that both compiler verification and pattern matching on representatives are granted. In this paper, we detail the notion of private data type and study the existence of construction functions. We also describe a prototype, called Moca, that addresses the entire problem of defining concrete data types with invariants: it generates efficient construction functions for the combination of common invariants and builds representatives that belong to a concrete data type with private constructors.

Keywords

  • Normal Form
  • Data Type
  • Pattern Match
  • Construction Function
  • Equational Theory

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.

Chapter PDF

Download to read the full chapter text

References

  1. Benanav, D., Kapur, D., Narendran, P.: Complexity of matching problems. J. of Symbolic Computation 3(1-2), 203–216 (1987)

    CrossRef  MATH  MathSciNet  Google Scholar 

  2. Bendix, P., Knuth, D.: Simple word problems in universal algebra. In: Leech, J. (ed.) Computational problems in abstract algebra, Pergamon Press, Oxford (1970)

    Google Scholar 

  3. Burton, F., Cameron, R.: Pattern matching with abstract data types. J. of Functional Programming 3(2), 171–190 (1993)

    CrossRef  MathSciNet  Google Scholar 

  4. Burton, W., et al.: Views: An extension to Haskell pattern matching (1996), http://www.haskell.org/extensions/views.html

  5. Le Chenadec, P.: Canonical forms in finitely presented algebras. Research notes in theoretical computer science. Pitman, London (1986)

    MATH  Google Scholar 

  6. Contejean, E., et al.: CiME version 2.02. LRI, CNRS UMR 8623, Université Paris-Sud, France (2004), http://cime.lri.fr/

  7. Coq Development Team: The Coq Proof Assistant Reference Manual, Version 8.0. INRIA, France (2006), http://coq.inria.fr/

  8. Dershowitz, N., Jouannaud, J.-P.: Rewrite systems. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, North-Holland, Amsterdam (1990)

    Google Scholar 

  9. Doligez, D.: Zenon, version 0.4.1 (2006), http://focal.inria.fr/zenon/

  10. Doligez, D., et al.: The Objective Caml system release 3.09, Documentation and user’s manual. INRIA, France (2005), http://caml.inria.fr/

  11. Jones, S.P.: Haskell 98 Language and Libraries, The revised report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  12. Gaillourdet, J.-M., et al.: The new Waldmeister loop at work. In: Baader, F. (ed.) CADE 2003. LNCS (LNAI), vol. 2741, Springer, Heidelberg (2003)

    Google Scholar 

  13. Hullot, J.-M.: Compilation de formes canoniques dans les théories équationnelles. PhD thesis, Université Paris 11, France (1980)

    Google Scholar 

  14. Jouannaud, J.-P.: Modular church-rosser modulo. In: Pfenning, F. (ed.) RTA 2006. LNCS, vol. 4098, Springer, Heidelberg (2006)

    Google Scholar 

  15. Moreau, P.-E., et al.: Tom Manual version 2.3. INRIA & LORIA, Nancy, France (2006), http://tom.loria.fr/

  16. Moreau, P.-E., Ringeissen, C., Vittek, M.: A pattern matching compiler for multiple target languages. In: Hedin, G. (ed.) CC 2003 and ETAPS 2003. LNCS, vol. 2622, Springer, Heidelberg (2003)

    Google Scholar 

  17. Okasaki, C.: Views for standard ML. In: Proc. of ML’98 (1998)

    Google Scholar 

  18. Peterson, G., Stickel, M.: Complete sets of reductions for some equational theories. J. of the ACM 28(2), 233–264 (1981)

    CrossRef  MATH  MathSciNet  Google Scholar 

  19. Rao, K.: Completeness of hierarchical combinations of term rewriting systems. In: Shyamasundar, R.K. (ed.) Foundations of Software Technology and Theoretical Computer Science. LNCS, vol. 761, Springer, Heidelberg (1993)

    Google Scholar 

  20. Rioboo, R., Doligez, D., Hardin, T.: all. FoCal Reference Manual, version 0.3.1. Université Paris 6, CNAM & INRIA (2005), http://focal.inria.fr/

  21. Thompson, S.: Laws in Miranda. In: Proc. of LFP’86 (1986)

    Google Scholar 

  22. Thompson, S.: Lawful functions and program verification in Miranda. Science of Computer Programming 13(2-3), 181–218 (1990)

    CrossRef  MathSciNet  MATH  Google Scholar 

  23. Wadler, P.: Views: a way for pattern matching to cohabit with data abstraction. In: Proc. of POPL’87 (1987)

    Google Scholar 

  24. Weis, P.: Private constructors in OCaml (2003), http://alan.petitepomme.net/cwn/2003.07.01.html#5

Download references

Author information

Authors and Affiliations

  1. INRIA & LORIA, BP 239, 54506 Villers-lès-Nancy Cedex, France

    Frédéric Blanqui

  2. UPMC, LIP6, 104, Av. du Pr. Kennedy, 75016 Paris, France

    Thérèse Hardin

  3. INRIA, Domaine de Voluceau, BP 105, 78153 Le Chesnay Cedex, France

    Pierre Weis

Authors
  1. Frédéric Blanqui
    View author publications

    You can also search for this author in PubMed Google Scholar

  2. Thérèse Hardin
    View author publications

    You can also search for this author in PubMed Google Scholar

  3. Pierre Weis
    View author publications

    You can also search for this author in PubMed Google Scholar

Editor information

Rocco De Nicola

Rights and permissions

Reprints and Permissions

Copyright information

© 2007 Springer Berlin Heidelberg

About this paper

Cite this paper

Blanqui, F., Hardin, T., Weis, P. (2007). On the Implementation of Construction Functions for Non-free Concrete Data Types. In: De Nicola, R. (eds) Programming Languages and Systems. ESOP 2007. Lecture Notes in Computer Science, vol 4421. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71316-6_8

Download citation

  • .RIS
  • .ENW
  • .BIB
  • DOI: https://doi.org/10.1007/978-3-540-71316-6_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-71314-2

  • Online ISBN: 978-3-540-71316-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Publish with us

Policies and ethics

search

Navigation

  • Find a journal
  • Publish with us
  • Track your research

Discover content

  • Journals A-Z
  • Books A-Z

Publish with us

  • Publish your research
  • Open access publishing

Products and services

  • Our products
  • Librarians
  • Societies
  • Partners and advertisers

Our imprints

  • Springer
  • Nature Portfolio
  • BMC
  • Palgrave Macmillan
  • Apress
  • Your US state privacy rights
  • Accessibility statement
  • Terms and conditions
  • Privacy policy
  • Help and support
  • Cancel contracts here

167.114.118.210

Not affiliated

Springer Nature

© 2023 Springer Nature