Abstract
In the context of program verification in an interactive theorem prover, we study the problem of transforming function definitions with ML-style (possibly overlapping) pattern matching into minimal sets of independent equations. Since independent equations are valid unconditionally, they are better suited for the equational proof style using induction and rewriting, which is often found in proofs in theorem provers or on paper.
We relate the problem to the well-known minimization problem for propositional DNF formulas and show that it is £P/2-complete. We then develop a concrete algorithm to compute minimal patterns, which naturally generalizes the standard Quine-McCluskey procedure to the domain of term patterns.
Supplemental Material
Available for Download
Supplemental material for: Pattern minimization problems over recursive data types
- Lennart Augustsson. Compiling pattern matching. In FPCA'85, pages 368--381, 1985. Google Scholar
Digital Library
- Marianne Baudinet and David MacQueen. Tree pattern matching for ML. URL http://www.smlnj.org/compiler-notes/85-note-baudinet.ps. Unpublished, 1985.Google Scholar
- R. K. Brayton, G. D. Hachtel, C. T. McMullen, and A. L. Sangiovanni-Vincentelli. Logic Minimization Algorithms for VLSI Synthesis. Kluwer Academic Publishers, Boston, MA, 1984. Google Scholar
Digital Library
- Amine Chaieb. Verifying mixed real-integer quantifier elimination. In Ulrich Furbach and Natarajan Shankar, editors, Automated Reasoning, Third International Joint Conference, LNAI 4130, pages 528--540. Springer, 2006. ISBN 3-540-37187-7. Google Scholar
Digital Library
- Amine Chaieb. Automated methods for formal proofs in simple arithmetics and algebra. D thesis, Technische Universität München, Germany, April 2008.Google Scholar
- Fabrice Le Fessant and Luc Maranget. Optimizing pattern matching. In ICFP, pages 26--37, 2001. Google Scholar
Digital Library
- Michael Gordon and Tom Melham, editors. Introduction to HOL: A theorem proving environment for higher order logic. Cambridge University Press, 1993. Google Scholar
Digital Library
- Gérard Huet. Confluent reductions: Abstract properties and applications to term rewriting systems. J. ACM, 27 (4): 797--821, 1980. Google Scholar
Digital Library
- John Hughes. The Design of a Pretty-printing Library. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, volume 925 of LNCS. Springer Verlag, 1995. Google Scholar
Digital Library
- Randy H. Katz and Gaetano Borriello. Contemporary Logic Design. Prentice Hall, 2005. Google Scholar
Digital Library
- E. J. McCluskey. Logic Design Principles. Prentice Hall, 1986.Google Scholar
- E. J. McCluskey. Minimization of boolean formulas. Bell Lab. Tech. J., 35 (6): 1417--1444, Nov 1956.Google Scholar
Cross Ref
- Tobias Nipkow, Lawrence C. Paulson, and Markus Wenzel. Isabelle/HOL - A Proof Assistant for Higher-Order Logic. LNCS 2283. Springer, 2002. Google Scholar
Digital Library
- Chris Okasaki. Red-black trees in a functional setting. J. Funct. Program., 9 (4): 471--477, 1999. Google Scholar
Digital Library
- Christos H. Papadimitriou. Computational Complexity. Addison-Wesley, New York, 1994.Google Scholar
- Markus Schaefer and Christopher Umans. Completeness in the polynomial-time hierarchy: Part I: A compendium. SIGACTN: SIGACT News (ACM Special Interest Group on Automata and Computability Theory), 33, 2002.Google Scholar
- Konrad Slind. Reasoning About Terminating Functional Programs. D thesis, Institut für Informatik, TU München, 1999.Google Scholar
- Tadeusz Strzemecki. Polynomial-time algorithms for generation of prime implicants. J. Complexity, 8 (1): 37--63, 1992. Google Scholar
Digital Library
- Simon Thompson. Haskell: The Craft of Functional Programming (2nd Edition). Addison-Wesley, 1999. Google Scholar
Digital Library
- Christopher Umans. Approximability and completeness in the polynomial hierarchy. D thesis, University of California, Berkeley, 2000. Google Scholar
Digital Library
- Christopher Umans, Tiziano Villa, and Alberto L. Sangiovanni-Vincentelli. Complexity of two-level logic minimization. IEEE Trans. on CAD of Integrated Circuits and Systems, 25 (7): 1230--1246, 2006. Google Scholar
Digital Library
- Philip Wadler. Efficient compilation of pattern-matching. In S. L. Peyton Jones, The Implementation of Functional Programming Languages, chapter 5. Prentice-Hall International, 1987.Google Scholar
- Lyndon While and Tony Field. Optimising parallel pattern-matching by source-level program transformation. In Vladimir Estivill-Castro, editor, ACSC, volume 38 of CRPIT, pages 239--248. Australian Computer Society, 2005. ISBN 1-920682-20-1. Google Scholar
Digital Library
Index Terms
Pattern minimization problems over recursive data types
Recommendations
Pattern minimization problems over recursive data types
ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programmingIn the context of program verification in an interactive theorem prover, we study the problem of transforming function definitions with ML-style (possibly overlapping) pattern matching into minimal sets of independent equations. Since independent ...
Completeness and Cut-elimination in the Intuitionistic Theory of Types
In this paper we define a model theory and give a semantic proof of cut-elimination for ICTT, an intuitionistic formulation of Church's theory of types defined by Miller et al. and the basis for the λProlog programming language. Our approach, extending ...
Polymorphic lemmas and definitions in $\lambda$Prolog and Twelf
$\lambda$Prolog is known to be well-suited for expressing and implementing logics and inference systems. We show that lemmas and definitions in such logics can be implemented with a great economy of expression. We encode a higher-order logic using an ...







Comments