Eliminating array bound checking through dependent types
PLDI '98 Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation
Intersection types and computational effects
ICFP '00 Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
Dead Code Elimination through Dependent Types
PADL '99 Proceedings of the First International Workshop on Practical Aspects of Declarative Languages
Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Refined typechecking with Stardust
PLPV '07 Proceedings of the 2007 workshop on Programming languages meets program verification
A Bidirectional Refinement Type System for LF
Electronic Notes in Theoretical Computer Science (ENTCS)
Refinement Types as Proof Irrelevance
TLCA '09 Proceedings of the 9th International Conference on Typed Lambda Calculi and Applications
Greedy bidirectional polymorphism
Proceedings of the 2009 ACM SIGPLAN workshop on ML
State Based Robustness Testing for Components
Electronic Notes in Theoretical Computer Science (ENTCS)
Higher-order multi-parameter tree transducers and recursion schemes for program verification
Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Practical Datatype Specializations with Phantom Types and Recursion Schemes
Electronic Notes in Theoretical Computer Science (ENTCS)
Type assignment for intersections and unions in call-by-value languages
FOSSACS'03/ETAPS'03 Proceedings of the 6th International conference on Foundations of Software Science and Computation Structures and joint European conference on Theory and practice of software
Robustness testing for software components
Science of Computer Programming
Verification of tree-processing programs via higher-order model checking
APLAS'10 Proceedings of the 8th Asian conference on Programming languages and systems
When is a type refinement an inductive type?
FOSSACS'11/ETAPS'11 Proceedings of the 14th international conference on Foundations of software science and computational structures: part of the joint European conferences on theory and practice of software
Nested refinements: a logic for duck typing
POPL '12 Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Elaborating intersection and union types
Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
Hi-index | 0.01 |
Software development is a complex and error prone task. Programming languages with strong static type systems assist programmers by capturing and checking the fundamental structure of programs in a very intuitive way. Given this success, it is natural to ask: can we capture and check more of the structure of programs? In this dissertation I describe an approach called refinement-type checking that allows many common program properties to be captured and checked. This approach builds on the strength of the type system of a language by adding the ability to specify refinements of each type. Following previous work, I focus on refinements that include subtyping and a form of intersection types. Central to my approach is the use of a bidirectional checking algorithm. This does not attempt to infer refinements for some expressions, such as functions, but only checks them against refinements. This avoids some difficulties encountered in previous work, and requires that the programmer annotate their program with some of the intended refinements. The required annotations appear to be very reasonable. Further, they document properties in a way that is natural, precise, easy to read, and reliable. I demonstrate the practicality of my approach by showing that it can be used to design a refinement-type checker for a widely-used language with a strong type system: Standard ML. This requires two main technical developments. Firstly, I present a new valiant of intersection types that obtain soundness in the presence of call-by-value effects by incorporating a value restriction. Secondly, I present a practical approach to incorporating recursive refinements of ML datatypes, including a pragmatic method for checking the sequential pattern matching construct of ML. I conclude by reporting the results of experiments with my implementation of refinement-type checking for SML. These indicate that refinement-type checking is a practical method for capturing and checking properties of real code.