Results 1  10
of
11
Concoqtion: indexed types now
 In Workshop on Partial Evaluation and SemanticsBased Program Manipulation
, 2007
"... Almost twenty years after the pioneering efforts of Cardelli, the programming languages community is vigorously pursuing ways to incorporate Fωstyle indexed types into programming languages. This paper advocates Concoqtion, a practical approach to adding such highly expressive types to fullfledged ..."
Abstract

Cited by 29 (1 self)
 Add to MetaCart
Almost twenty years after the pioneering efforts of Cardelli, the programming languages community is vigorously pursuing ways to incorporate Fωstyle indexed types into programming languages. This paper advocates Concoqtion, a practical approach to adding such highly expressive types to fullfledged programming languages. The approach is applied to MetaOCaml using the Coq proof checker to conservatively extend HindleyMilner type inference. The implementation of MetaOCaml Concoqtion requires minimal modifications to the syntax, the type checker, and the compiler; and yields a language comparable in notation to the leading proposals. The resulting language provides unlimited expressiveness in the type system while maintaining decidability. Furthermore, programmers can take advantage of a wide range of libraries not only for the programming language but also for the indexed types. Programming in MetaOCaml Concoqtion is illustrated with small examples and a case study implementing a staticallytyped domainspecific language. 1.
Implementing Cut Elimination: A Case Study of Simulating Dependent Types in Haskell
 In Proceedings of the 6th International Symposium on Practical Aspects of Declarative Languages
, 2004
"... Gentzen's Hauptsatz  cut elimination theorem  in sequent calculi reveals a fundamental property on logic connectives in various logics such as classical logic and intuitionistic logic. In this paper, we implement a procedure in Haskell to perform cut elimination for intuitionistic seque ..."
Abstract

Cited by 12 (4 self)
 Add to MetaCart
Gentzen's Hauptsatz  cut elimination theorem  in sequent calculi reveals a fundamental property on logic connectives in various logics such as classical logic and intuitionistic logic. In this paper, we implement a procedure in Haskell to perform cut elimination for intuitionistic sequent calculus, where we use types to guarantee that the procedure can only return a cutfree proof of the same sequent when given a proof of a sequent that may contain cuts. The contribution of the paper is twofold. On the one hand, we present an interesting (and somewhat unexpected) application of the current type system of Haskell, illustrating through a concrete example how some typical use of dependent types can be simulated in Haskell. On the other hand, we identify several problematic issues with such a simulation technique and then suggest some approaches to addressing these issues in Haskell.
A fresh look at programming with names and binders
"... A wide range of computer programs, including compilers and theorem provers, manipulate data structures that involve names and binding. However, the design of programming idioms which allow performing these manipulations in a safe and natural style has, to a large extent, remained elusive. In this pa ..."
Abstract

Cited by 7 (2 self)
 Add to MetaCart
A wide range of computer programs, including compilers and theorem provers, manipulate data structures that involve names and binding. However, the design of programming idioms which allow performing these manipulations in a safe and natural style has, to a large extent, remained elusive. In this paper, we present a novel approach to the problem. Our proposal can be viewed either as a programming language design or as a library: in fact, it is currently implemented within Agda. enough to support multiple concrete implementations: we present one in nominal style and one in de Bruijn style. We use logical relations to prove that “welltyped programs do not mix names with different scope”. We exhibit an adequate encoding of Pittsstyle nominal terms into our system. Keywords: names, binders, metaprogramming, name abstraction, higherorder abstract syntax
Concoqtion: Mixing dependent types and HindleyMilner type inference (extended version
, 2006
"... This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approa ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approached used by Shao et al. for certified binaries. This approach maintains a phase distinction between the computational and logical languages, thereby limiting effects and nontermination to the computational language, and maintaining the decidability of the type system. The extension subsumes language features such as impredicative firstclass (higherrank) polymorphism and type operators, that are notoriously difficult to integrate with the HindleyMilner style of type inference that is used in OCaml. We make the observation that these features can be more easily integrated with type inference if the inference algorithm is free to adapt the order in which it solves typing constraints to each program. To this end we define a novel “orderfree ” type inference algorithm. The key enabling technology is a graph representation of constraints and a constraint solver that performs HindleyMilner inference with just three graph rewrite rules. 1
Statically verified typepreserving code transformations in Haskell
 PLPV 2006: Programming languages meets program verification, ed. Aaron Stump and Hongwei Xi, 40–53. Electronic Notes in Theoretical Computer Science 174(7
, 2006
"... The use of typed intermediate languages can significantly increase the reliability of a compiler. By typechecking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. We propose to take the use of types in compilation a s ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
The use of typed intermediate languages can significantly increase the reliability of a compiler. By typechecking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. We propose to take the use of types in compilation a step further by verifying that the transformation itself is type correct, in the sense that it is impossible that it produces an ill typed term given a well typed term as input. We base our approach on higherorder abstract syntax (HOAS), a representation of programs where variables in the object language are represented by metavariables. We use a representation that accounts for the object language’s type system using generalized algebraic data types (GADTs). In this way, the full binding and type structure of the object language is exposed to the host language’s type system. In this setting we encode a type preservation property of a CPS conversion in Haskell’s type system, using witnesses of a type correctness proof encoded as values in a GADT.
Abstract A TypePreserving Closure Conversion in Haskell
"... The use of typed intermediate languages can significantly increase the reliability of a compiler. By typechecking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. Also it guarantees that any property that was enforced ..."
Abstract
 Add to MetaCart
The use of typed intermediate languages can significantly increase the reliability of a compiler. By typechecking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. Also it guarantees that any property that was enforced by the sourcelevel typesystem is holds also for the generated code. Recently, several people have tried to push this effort a bit further by verifying formally that the compiler indeed preserves typing. This is usually done with proof assistants or experimental languages. Instead, we decided to use Haskell, to see how far we can go with a more mainstream system, supported by robust compilers and plentiful libraries. This article presents one part of our type preserving compiler, namely the closure conversion and its associated hoisting phase, where we use GADTs to let Haskell’s type checker verify the we obey the object language’s typing rules and that we correctly preserve types from one phase to the other. This should be both a good showcase as well as a good stress test for GADTs, so we also discuss our experience, as well as some tradeoffs in the choice of representation, namely between higherorder abstract syntax (HOAS) and a first order representation (i.e. de Bruijn indices) and justify our choice of a de Bruijn representation. We incidentally present a type preserving conversion from HOAS (used in earlier phases of the compiler [4]) to a de Bruijn representation.
TypeSafe Code Transformations in Haskell Abstract
"... Département d’informatique et de recherche opérationnelle ..."
and Reasoning about Programs]: Mechanical verification
"... The use of typed intermediate languages can significantly increase the reliability of a compiler. By typechecking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. Also it guarantees that any property that was enforced ..."
Abstract
 Add to MetaCart
The use of typed intermediate languages can significantly increase the reliability of a compiler. By typechecking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. Also it guarantees that any property that was enforced by the sourcelevel typesystem is holds also for the generated code. Recently, several people have tried to push this effort a bit further by verifying formally that the compiler indeed preserves typing. This is usually done with proof assistants or experimental languages. Instead, we decided to use Haskell (with GHC’s extensions), to see how far we can go with a more mainstream system, supported by robust compilers and plentiful libraries. This article presents one part of our type preserving compiler, namely the closure conversion and its associated hoisting phase, where we use GADTs to let Haskell’s type checker verify the we obey the object language’s typing rules and that we correctly preserve types from one phase to the other. This should be both a good showcase as well as a good stress test for GADTs, so we also discuss our experience, as well as some tradeoffs in the choice of representation, namely between higherorder abstract syntax (HOAS) and a first order representation (i.e. de Bruijn indices) and justify our choice of a de Bruijn representation. We incidentally present a type preserving conversion from HOAS (used in earlier phases of the compiler [6]) to a de Bruijn representation.
Abstract Concoqtion: Mixing Indexed Types and HindleyMilner Type Inference
"... This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approa ..."
Abstract
 Add to MetaCart
This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approached used by Shao et al. for certified binaries. This approach maintains a phase distinction between the computational and logical languages, thereby limiting effects and nontermination to the computational language, and maintaining the decidability of the type system. The extension subsumes language features such as impredicative firstclass (higherrank) polymorphism and type operators, that are notoriously difficult to integrate with the HindleyMilner style of type inference that is used in OCaml. We make the observation that these features can be more easily integrated with type inference if the inference algorithm is free to adapt the order in which it solves typing constraints to each program. To this end we define a novel “orderfree ” type inference algorithm. The key enabling technology is a graph representation of constraints and a constraint solver that performs HindleyMilner inference with just three graph rewrite rules.
Abstract Concoqtion: Mixing Indexed Types and HindleyMilner Type Inference
"... This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approa ..."
Abstract
 Add to MetaCart
This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approached used by Shao et al. for certified binaries. This approach maintains a phase distinction between the computational and logical languages, thereby limiting effects and nontermination to the computational language, and maintaining the decidability of the type system. The extension subsumes language features such as impredicative firstclass (higherrank) polymorphism and type operators, that are notoriously difficult to integrate with the HindleyMilner style of type inference that is used in OCaml. We make the observation that these features can be more easily integrated with type inference if the inference algorithm is free to adapt the order in which it solves typing constraints to each program. To this end we define a novel “orderfree ” type inference algorithm. The key enabling technology is a graph representation of constraints and a constraint solver that performs HindleyMilner inference with just three graph rewrite rules.