skip to main content
10.1145/1159876.1159880acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Type-safe modular hash-consing

Published: 16 September 2006 Publication History

Abstract

Hash-consing is a technique to share values that are structurally equal. Beyond the obvious advantage of saving memory blocks, hash-consing may also be used to speed up fundamental operations and data structures by several orders of magnitude when sharing is maximal. This paper introduces an \ocaml\ hash-consing library that encapsulates hash-consed terms in an abstract datatype, thus safely ensuring maximal sharing. This library is also parameterized by an equality that allows the user to identify terms according to an arbitrary equivalence relation.

References

[1]
The Objective Caml language. http://caml.inria.fr/.
[2]
John Allen. Anatomy of Lisp. McGraw-Hill Book Compagny, 1978.
[3]
Henrik Reif Andersen. An Introduction to Binary Decision Diagrams. Lecture notes, 1998. http://www.itu.dk/people/hra/.
[4]
Andrew W. Appel and Marcelo J. R. Gonçalves. Hash-consing Garbage Collection. Technical Report CS--TR--412--93, Princeton University, February 1993.
[5]
Randal E. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers, 8(C-35):677--691, 1986.
[6]
M. Davis, G. Logemann, and D. Loveland. A machine program for theorem proving. Communications of the ACM, 5(7):394--397, July 1962.
[7]
M. Davis and H. Putnam. A computing procedure for quantification theory. Journal of the ACM, 7(3):201--215, July 1960.
[8]
A. P. Ershov. On programming of arithmetic operations. Commun. ACM, 1(8):3--6, 1958.
[9]
Eiichi Goto. Monocopy and associative algorithms in extended Lisp. Technical Report TR 74--03, University of Tokyo, May 1974.
[10]
Jean Goubault. Implementing Functional Languages with Fast Equality, Sets and Maps: an Exercise in Hash Consing. In Journées Francophones des Langages Applicatifs (JFLA'93), pages 222--238, Annecy, February 1993.
[11]
Gérard Huet. Constructive Computation Theory. Courses notes. Available at http://pauillac.inria.fr/~huet/CCT/.
[12]
Chris Okasaki and Andrew Gill. Fast Mergeable Integer Maps. In Workshop on ML, pages 77--86, September 1998.
[13]
Philip Wadler. Views: A way for pattern matching to cohabit with data abstraction. In 14th ACM Symposium on Principles of Programming Languages, Munich, January 1987.

Cited By

View all

Index Terms

  1. Type-safe modular hash-consing

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ML '06: Proceedings of the 2006 workshop on ML
    September 2006
    102 pages
    ISBN:1595934839
    DOI:10.1145/1159876
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 16 September 2006

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. data structures
    2. hash-consing
    3. sharing

    Qualifiers

    • Article

    Conference

    ICFP06
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 6 of 11 submissions, 55%

    Upcoming Conference

    ICFP '25
    ACM SIGPLAN International Conference on Functional Programming
    October 12 - 18, 2025
    Singapore , Singapore

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)49
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 28 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media