Author:
BIERMAN GAVIN M.,GORDON ANDREW D.,HRIŢCU CĂTĂLIN,LANGWORTHY DAVID
Abstract
AbstractWe study a first-order functional language with the novel combination of the ideas of refinement type (the subset of a type to satisfy a Boolean expression) and type-test (a Boolean expression testing whether a value belongs to a type). Our core calculus can express a rich variety of typing idioms; for example, intersection, union, negation, singleton, nullable, variant, and algebraic types are all derivable. We formulate a semantics in which expressions denote terms, and types are interpreted as first-order logic formulas. Subtyping is defined as valid implication between the semantics of types. The formulas are interpreted in a specific model that we axiomatize using standard first-order theories. On this basis, we present a novel type-checking algorithm able to eliminate many dynamic tests and to detect many errors statically. The key idea is to rely on a Satisfiability Modulo Theories solver to compute subtyping efficiently. Moreover, using a satisfiability modulo theories solver allows us to show the uniqueness of normal forms for non-deterministic expressions, provide precise counterexamples when type-checking fails, detect empty types, and compute instances of types statically and at run-time.
Publisher
Cambridge University Press (CUP)
Cited by
16 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. How to safely use extensionality in Liquid Haskell;Proceedings of the 15th ACM SIGPLAN International Haskell Symposium;2022-09-06
2. Refinement Types: A Tutorial;Foundations and Trends® in Programming Languages;2021
3. Statically verified refinements for multiparty protocols;Proceedings of the ACM on Programming Languages;2020-11-13
4. Formulog: Datalog for SMT-based static analysis;Proceedings of the ACM on Programming Languages;2020-11-13
5. Proceedings 36th International Conference on Logic Programming (Technical Communications);Electronic Proceedings in Theoretical Computer Science;2020-09-19