Results 1 -
4 of
4
Semantic subtyping with an SMT solver
, 2010
"... We 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; ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
We 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 an SMT solver to compute subtyping efficiently. Moreover, interpreting types as formulas allows us to call the SMT solver at run-time to compute instances of types.
Nested refinements: A logic for duck typing
"... Programs written in dynamic languages make heavy use of features — run-time type tests, value-indexed dictionaries, polymorphism, and higher-order functions — that are beyond the reach of type systems that employ either purely syntactic or purely semantic reasoning. We present a core calculus, Syste ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Programs written in dynamic languages make heavy use of features — run-time type tests, value-indexed dictionaries, polymorphism, and higher-order functions — that are beyond the reach of type systems that employ either purely syntactic or purely semantic reasoning. We present a core calculus, System D, that merges these two modes of reasoning into a single powerful mechanism of nested refinement types wherein the typing relation is itself a predicate in the refinement logic. System D coordinates SMT-based logical implication and syntactic subtyping to automatically typecheck sophisticated dynamic language programs. By coupling nested refinements with McCarthy’s theory of finite maps, System D can precisely reason about the interaction of higher-order functions, polymorphism, and dictionaries. The addition of type predicates to the refinement logic creates a circularity that leads to unique technical challenges in the metatheory, which we solve with a novel stratification approach that we use to prove the soundness of System D.
Hybrid typing, Functional programming
, 2010
"... I would like to express my heartfelt gratitude to my two great mentors throughout my time at Willamette: Fritz Ruehr and John Lasseter. I also would like to extend my thanks to Genevieve Orr and Haiyan Cheng for their assistance and aid as thesis class leaders. Finally, I thank my family, for their ..."
Abstract
- Add to MetaCart
I would like to express my heartfelt gratitude to my two great mentors throughout my time at Willamette: Fritz Ruehr and John Lasseter. I also would like to extend my thanks to Genevieve Orr and Haiyan Cheng for their assistance and aid as thesis class leaders. Finally, I thank my family, for their encouragement, support, and love (and proofreading!) Numerous approaches to the problem of determining the correctness of computer programs have been proposed and implemented, such as dynamic and static type checking. Static typing enables earlier error checking and more e cient execution in many programs, while dynamic type systems allow for greater expressiveness and exibility. This paper presents a type system, hybrid typing, and a programming language utilizing it, Gnarly, that negotiate the space between static and dynamic typing by allowing the programmer to select which typing paradigm he or she wishes to use at the level of individual terms rather than entire languages. Furthermore, any program in Gnarly that is entirely static is provably type safe, and therefore is inherently more trustworthy than it would be otherwise. This results in a very robust language, capable of expressing a wider range of possible programs than any static language, but still retaining a far stronger degree of
HALO: Haskell to Logic through Denotational Semantics
"... Even well-typed programs can go wrong, by encountering a pattern-match failure, or simply returning the wrong answer. An increasingly-popular response is to allow programmers to write contracts that express semantic properties, such as crash-freedom or some useful post-condition. We study the static ..."
Abstract
- Add to MetaCart
Even well-typed programs can go wrong, by encountering a pattern-match failure, or simply returning the wrong answer. An increasingly-popular response is to allow programmers to write contracts that express semantic properties, such as crash-freedom or some useful post-condition. We study the static verification of such contracts. Our main contribution is a novel translation to first-order logic of both Haskell programs, and contracts written in Haskell, all justified by denotational semantics. This translation enables us to prove that functions satisfy their contracts using an off-the-shelf first-order logic theorem prover. 1.

