Results 1 -
8 of
8
Practical Refinement-Type Checking
, 1997
"... Refinement types allow many more properties of programs to be expressed and statically checked than conventional type systems. We present a practical algorithm for refinement-type checking in a -calculus enriched with refinement-type annotations. We prove that our basic algorithm is sound and comple ..."
Abstract
-
Cited by 37 (1 self)
- Add to MetaCart
Refinement types allow many more properties of programs to be expressed and statically checked than conventional type systems. We present a practical algorithm for refinement-type checking in a -calculus enriched with refinement-type annotations. We prove that our basic algorithm is sound and complete, and show that every term which has a refinement type can be annotated as required by our algorithm. Our positive experience with an implementation of an extension of this algorithm to the full core language of Standard ML demonstrates that refinement types can be a practical program development tool in a realistic programming language. The required refinement type definitions and annotations are not much of a burden and serve as formal, machine-checked explanations of code invariants which otherwise would remain implicit. 1 Introduction The advantages of statically-typed programming languages are well known, and have been described many times (e.g. see [Car97]). However, conventional ty...
Practical refinement-type checking. Thesis Proposal
, 1997
"... 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 str ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
(Show Context)
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 work I consider a new 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. Such refinement types have been considered previously, and 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, but 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 variant of intersection types that achieve 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 also report 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.
Polymorphic Functions with Set-Theoretic Types
"... Abstract. We present a type system and local type inference for a calculus with higher-order polymorphic functions, recursive types with arrow and product type constructors and set-theoretic type connectives (union, intersection, and negation). This work provides the theoretical foundations and tech ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
(Show Context)
Abstract. We present a type system and local type inference for a calculus with higher-order polymorphic functions, recursive types with arrow and product type constructors and set-theoretic type connectives (union, intersection, and negation). This work provides the theoretical foundations and technical machinery needed to start the design and implementation of polymorphic functional languages for semi-structured data. 1.
A Typed Semantics of Higher-Order Store and
"... Abstract. We consider a call-by-value language, with higher-order functions, records, references to values of arbitrary type, and subtyping. We adapt an intrinsic denotational model for a similar language based on a possible-world semantics, recently given by Levy [14], and relate it to an untyped m ..."
Abstract
- Add to MetaCart
(Show Context)
Abstract. We consider a call-by-value language, with higher-order functions, records, references to values of arbitrary type, and subtyping. We adapt an intrinsic denotational model for a similar language based on a possible-world semantics, recently given by Levy [14], and relate it to an untyped model by a logical relation. Following the methodology of Reynolds [22], this relation is used to establish coherence of the typed semantics, with a coercion interpretation of subtyping. We obtain a typed denotational semantics of (imperative) object-based languages. 1
Computational monads and subtyping
"... Subtyping is an important concept and used in many programming languages. One approach to give semantics to languages with subtypes is by translation to target languages without subtyping: Subtypings A ≤ B are interpreted via conversion functions A → B. This paper shows how to extend the method to l ..."
Abstract
- Add to MetaCart
Subtyping is an important concept and used in many programming languages. One approach to give semantics to languages with subtypes is by translation to target languages without subtyping: Subtypings A ≤ B are interpreted via conversion functions A → B. This paper shows how to extend the method to languages with computational effects, using Moggi’s computational metalanguage. 1
Contents Depth Exam: Observations and Comments
, 2007
"... 1 “What do Types Mean? ” [Rey] 2 ..."
(Show Context)
Correctness of Compiling Polymorphism to Dynamic Typing
"... The connection between polymorphic and dynamic typing was originally considered by Curry, et al. in the form of “polymorphic type assignment ” for untyped λ-terms. Types are assigned after the fact to what is, in modern terminology, a dynamic language. Interest in type assignment was revitalized by ..."
Abstract
- Add to MetaCart
The connection between polymorphic and dynamic typing was originally considered by Curry, et al. in the form of “polymorphic type assignment ” for untyped λ-terms. Types are assigned after the fact to what is, in modern terminology, a dynamic language. Interest in type assignment was revitalized by the proposals of Bracha, et al. and Bank, et al. to enrich Java with polymorphism (generics), which in turn sparked the development of other languages, such as Scala, with similar combinations of features. In that setting it is desirable to compile polymorphism to dynamic typing in such a way that as much static typing as possible is preserved, relying on dynamics only insofar as genericity is actually required. The basic approach is to compile polymorphism using embeddings from each type into a universal ‘top ’ type, dyn, and partial projections that go in the other direction. This scheme is intuitively reasonable, and, indeed, has been used in practice many times. Proving its correctness, however, is non-trivial. This paper studies the compilation of System F to an extension of Moggi’s computational metalanguage with a dynamic type and shows how the compilation may be proved correct using a logical relation. 1