10.1145/1480881.1480927acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Focusing on pattern matching

Published:21 January 2009Publication History

ABSTRACT

In this paper, we show how pattern matching can be seen to arise from a proof term assignment for the focused sequent calculus. This use of the Curry-Howard correspondence allows us to give a novel coverage checking algorithm, and makes it possible to give a rigorous correctness proof for the classical pattern compilation strategy of building decision trees via matrices of patterns.

References

  1. J.M. Andreoli. Logic Programming with Focusing Proofs in Linear Logic. Journal of Logic and Computation, 2 (3): 297, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  2. L. Augustsson. Compiling pattern matching. Proc. of a conference on Functional Programming Languages and Computer Architecture, pages 368--381, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Luca Cardelli. Compiling a functional language. In LFP '84: Proceedings of the 1984 ACM Symposium on LISP and Functional Programming, pages 208--217, New York, NY, USA, 1984. ACM Press. ISBN 0-89791-142-3. http://doi.acm.org/10.1145/800055.802037. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Cerrito and D. Kesner. Pattern matching as cut elimination. Theoretical Computer Science, 323 (1-3): 71--127, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. H. Cirstea and C. Kirchner. The rewriting calculus -- Part I. Logic Journal of the IGPL, 9(3): 2001.Google ScholarGoogle Scholar
  6. T. Coquand. Pattern matching with dependent types. Proceedings of the Workshop on Types for Proofs and Programs, pages 71--83, 1992.Google ScholarGoogle Scholar
  7. M. Dummett. The Logical Basis of Metaphysics. Duckworth, 1991.Google ScholarGoogle Scholar
  8. Fabrice Le Fessant and Luc Maranget. Optimizing pattern matching. In ICFP '01: Proceedings of the sixth ACM SIGPLAN International Conference on Functional Programming, pages 26--37, New York, NY, USA, 2001. ACM Press. ISBN 1-58113-415-0. http://doi.acm.org/10.1145/507635.507641. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J.Y. Girard. Locus Solum: From the rules of logic to the logic of rules. Mathematical Structures in Computer Science, 11 (03): 301--506, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. B. Jay. The pattern calculus. Transactions on Programming Languages and Systems 26(6):911--937, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S.P. Jones, D. Vytiniotis, S. Weirich, and G. Washburn. Simple unification-based type inference for GADTs. Proceedings of the eleventh ACM SIGPLAN International Conference on Functional Programming, pages 50--61, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Kesner, L. Puel, and V. Tannen. A Typed Pattern Calculus. Information and Computation, 124 (1): 32--61, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Chuck Liang and Dale Miller. Focusing and polarization in intuitionistic logic. In 16th EACSL Annual Conference on Computer Science and Logic. Springer-Verlag, 2007. URL http://www.cs.hofstra.edu/~cscccl/focusil.pdf. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Luc Maranget. Warnings for pattern matching. Journal of Functional Programming, 2007.Google ScholarGoogle ScholarCross RefCross Ref
  15. C. McBride. Epigram. Types for Proofs and Programs, 3085: 115--129, 2003.Google ScholarGoogle Scholar
  16. Dale Miller, Gopalan Nadathur, Frank Pfenning, and Andre Scedrov. Uniform proofs as a foundation for logic programming. Ann. Pure Appl. Logic, 51 (1-2): 125--157, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  17. R.R. Milner, Mads Tofte, Robert Harper, and David McQueen. The Definition of Standard ML:(revised). MIT Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Mikael Pettersson. A term pattern-match compiler inspired by finite automata theory. In Uwe Kastens and Peter Pfahler, editors, CC, volume 641 of phLecture Notes in Computer Science, pages 258--270. Springer, 1992. ISBN 3-540-55984-1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. F. Pfenning. Structural Cut Elimination I. Intuitionistic and Classical Logic. Information and Computation, 157 (1-2): 84--141, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Sestoft. ML pattern match compilation and partial evaluation. Lecture Notes in Computer Science, 1110: 446, 1996. URL citeseer.ist.psu.edu/sestoft96ml.html.Google ScholarGoogle ScholarCross RefCross Ref
  21. Vincent Simonet and Francois Pottier. A constraint-based approach to guarded algebraic data types. Transactions on Programming Languages and Systems 29(1), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. K. Watkins, I. Cervesato, F. Pfenning, and D. Walker. A concurrent logical framework: The propositional fragment. Types for Proofs and Programs, pages 355--377, 2004.Google ScholarGoogle Scholar
  23. H. Xi. Dependently Typed Pattern Matching. Journal of Universal Computer Science, 9 (8): 851--872, 2003.Google ScholarGoogle Scholar
  24. Noam Zeilberger. The logical basis of evaluation order. Thesis proposal, May 2007. Carnegie Mellon, Pittsburgh, Pennsylvania. Available at http://www.cs.cmu.edu/~noam/research/proposal.pdf., 2007.Google ScholarGoogle Scholar
  25. Noam Zeilberger. Focusing and higher-order abstract syntax. In George C. Necula and Philip Wadler, editors, POPL, pages 359--369. ACM, 2008. ISBN 978-1-59593-689-9. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Focusing on pattern matching

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2009
          464 pages
          ISBN:9781605583792
          DOI:10.1145/1480881
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 44, Issue 1
            POPL '09
            January 2009
            453 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1594834
            Issue’s Table of Contents

          Copyright © 2009 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 21 January 2009

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate 770 of 3,892 submissions, 20%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!