Affiliation:
1. Cornell University, Ithaca, NY, USA
Abstract
Pattern matching, an important feature of functional languages, is in conflict with data abstraction and extensibility, which are central to object-oriented languages. Modal abstraction offers an integration of deep pattern matching and convenient iteration abstractions into an object-oriented setting; however, because of data abstraction, it is challenging for a compiler to statically verify properties such as exhaustiveness. In this work, we extend modal abstraction in the JMatch language to support static, modular reasoning about exhaustiveness and redundancy. New matching specifications allow these properties to be checked using an SMT solver. We also introduce expressive pattern-matching constructs. Our evaluation shows that these new features enable more concise code and that the performance of checking exhaustiveness and redundancy is acceptable.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Persimmon: Nested Family Polymorphism with Extensible Variant Types;Proceedings of the ACM on Programming Languages;2024-04-29
2. Dynamic pattern matching with Python;Proceedings of the 16th ACM SIGPLAN International Symposium on Dynamic Languages;2020-11-15
3. Truly abstract interfaces for algebraic data types: the extractor typing problem;Proceedings of the 9th ACM SIGPLAN International Symposium on Scala;2018-09-17
4. Verifying Fail-Free Declarative Programs;Proceedings of the 20th International Symposium on Principles and Practice of Declarative Programming;2018-09-03
5. A Practical Study of Control in Objected-Oriented–Functional–Logic Programming with Paisley;Electronic Proceedings in Theoretical Computer Science;2017-01-01