Complexity of matching problems
Journal of Symbolic Computation
Views: a way for pattern matching to cohabit with data abstraction
POPL '87 Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Lawful functions and program verification in Miranda
Science of Computer Programming
Handbook of theoretical computer science (vol. B)
LFP '86 Proceedings of the 1986 ACM conference on LISP and functional programming
Complete Sets of Reductions for Some Equational Theories
Journal of the ACM (JACM)
Completeness of Hierarchical Combinations of term Rewriting Systems
Proceedings of the 13th Conference on Foundations of Software Technology and Theoretical Computer Science
A pattern matching compiler for multiple target languages
CC'03 Proceedings of the 12th international conference on Compiler construction
RTA'06 Proceedings of the 17th international conference on Term Rewriting and Applications
Caml trading – experiences with functional programming on wall street
Journal of Functional Programming
Dependency Pairs for Rewriting with Built-In Numbers and Semantic Data Structures
RTA '08 Proceedings of the 19th international conference on Rewriting Techniques and Applications
PADL'10 Proceedings of the 12th international conference on Practical Aspects of Declarative Languages
Termination of context-sensitive rewriting with built-in numbers and collection data structures
WFLP'09 Proceedings of the 18th international conference on Functional and Constraint Logic Programming
Hi-index | 0.00 |
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.