• Documents
  • Authors
  • Tables
  • Other Seers ▼
    RefSeer AckSeer CollabSeer SeerSeer
  • Log in
  • Sign up
  • MetaCart

CiteSeerX logo

Advanced Search Include Citations
Advanced Search Include Citations | Disambiguate

Type Inference and Reconstruction for First Order Dependent Types (1995)

by Neal Nelson
Add To MetaCart

Tools

Sorted by:
Results 1 - 3 of 3

Type Safe Abstractions Using Program Generators

by Tim Sheard, Neal Nelson , 1995
"... Writing program generators involves the development of programs that manipulate representations of programs, thus offering unlimited possibliities for abstraction. Abstractions not expressable in typed languages can always be expressed as generators. For example generator mechanisms are implicit in ..."
Abstract - Cited by 16 (1 self) - Add to MetaCart
Writing program generators involves the development of programs that manipulate representations of programs, thus offering unlimited possibliities for abstraction. Abstractions not expressable in typed languages can always be expressed as generators. For example generator mechanisms are implicit in the eq-types of Standard ML, and the deriving clauses of Haskel type classes, neither of which can be encoded within the language. While these mechanisms always generate well typed code, they are "hard coded" into the compiler. Our goal is to incorporate generator like abstraction mechanisms into programming languages, while ensuring that only well typed programs are executed. This can be accomplished by a generate and then type-check approach or an inference mechanism that guarantees that only well typed programs are generated. In this paper we investigate both possibilities. The problems associated with program generators include problems of "hygiene" and the type compatibility of the programs being generated. Naive approaches to typing generators have either been inflexible (giving rigid, invariant types to the meta-level expressions representing programs requiring every object term to have the same type) or undecidable (requiring dependent types with arbitrary equality theories on expression equality). We solve the hygiene problems by the use of syntactic closures and have approached the type problem in two ways. First, by using a two level system (a la Nielson and Nielson[9]) we are able to embed a meta-computation phase which associates invariant code types to object expressions, into a later phase which then indexes these code types with the object expression's type. This ensures that only well-typed programs reach the run-time phase. We guarantee that the meta-computation phase terminates by restricting its expressiveness by the use of catamorphisms as the exclusive mechanism to encode recursion. Second we introduce a theory of dependent types for two-level languages that has a useful, decidable theory due to the use of catamorphisms, rather than arbitrary recursion, in the expressions that may index dependent types. We show that this can give useful types to program generators which detect type problems in generated code at the compile-type of the generator. Third we show that by embedding second level type declarations as values in first level computations we are able to construct polytypic program generators, such as polymorphic equality and generic map using our theory.

Type Reconstruction Algorithms: A Survey

by Sunil Kothari, James L. Caldwell , 2007
"... Most type reconstruction algorithms can be broadly classified into two distinct categories: unification and substitution based and constraint based. This report is a survey of some of the popular type reconstruction algorithms in the above two categories to promote better understanding of these algo ..."
Abstract - Cited by 2 (2 self) - Add to MetaCart
Most type reconstruction algorithms can be broadly classified into two distinct categories: unification and substitution based and constraint based. This report is a survey of some of the popular type reconstruction algorithms in the above two categories to promote better understanding of these algorithms. We have implemented the above algorithms for a language based on pure lambda calculus extended extended with poylorphic let construct on some non-trivial examples. 1

Type Safe Meta-Programming

by Tim Sheard, James Hook , 1994
"... This paper advances a general theory of "generator" systems which is used to attack several well known problems associated with the use of program generators. ..."
Abstract - Cited by 1 (0 self) - Add to MetaCart
This paper advances a general theory of "generator" systems which is used to attack several well known problems associated with the use of program generators.
The National Science Foundation
  • About CiteSeerX
  • Submit Documents
  • Privacy Policy
  • Help
  • Data
  • Source
  • Contact Us

Developed at and hosted by The College of Information Sciences and Technology

© 2007-2010 The Pennsylvania State University