## Fully Reflexive Intensional Type Analysis (2000)

### Cached

### Download Links

- [flint.cs.yale.edu]
- [flint.cs.yale.edu]
- [flint.cs.yale.edu]
- [flint.cs.yale.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | In Fifth ACM SIGPLAN International Conference on Functional Programming |

Citations: | 44 - 7 self |

### BibTeX

@INPROCEEDINGS{Trifonov00fullyreflexive,

author = {Valery Trifonov and Bratin Saha and Zhong Shao},

title = {Fully Reflexive Intensional Type Analysis},

booktitle = {In Fifth ACM SIGPLAN International Conference on Functional Programming},

year = {2000},

pages = {82--93},

publisher = {ACM Press}

}

### OpenURL

### Abstract

Compilers for polymorphic languages can use runtime type inspection to support advanced implementation techniques such as tagless garbage collection, polymorphic marshalling, and flattened data structures. Intensional type analysis is a type-theoretic framework for expressing and certifying such type-analyzing computations. Unfortunately, existing approaches to intensional analysis do not work well on types with universal, existential, or fixpoint quantifiers. This makes it impossible to code applications such as garbage collection, persistence, or marshalling which must be able to examine the type of any runtime value. We present a typed intermediate language that supports fully reflexive intensional type analysis. By fully reflexive, we mean that type-analyzing operations are applicable to the type of any runtime value in the language. In particular, we provide both type-level and term-level constructs for analyzing quantified types. Our system supports structural induction on quant...

### Citations

588 | From System F to Typed Assembly Language
- Morrisett, Walker, et al.
- 1999
(Show Context)
Citation Context ...e definition of an anamorphism for every such catamorphism. Necula [13] proposed the ideas of a certifying compiler and implemented a certifying compiler for a type-safe subset of C. Morrisettset al. =-=[12]-=- showed that a fully type-preserving compiler generating type-safe assembly code is a practical basis for a certifying compiler. The idea of programming with iterators is explained in Pierce's notes [... |

539 | A Syntactic Approach to Type Soundness
- Wright, Felleisen
- 1994
(Show Context)
Citation Context ...EM 3.3 (SOUNDNESS OF # P i FOR TYPE SAFETY). If #; #; # # e : # and e # # e # in # P i , then e # is not stuck. We prove soundness of the system using a contextual semantics in Wright/Felleisen style =-=[26]-=- using the standard progress, subject reduction, and substitution lemmas as well as the confluence and strong normalization properties of the # P i type system. 3.1 Example: Marshalling One of the exa... |

364 |
Towards a theory of type structure
- Reynolds
- 1974
(Show Context)
Citation Context ...Another serious problem in analyzing quantified types involves both the type-level and the term-level operators. Typed intermediate languages like FLINT [20] and TIL [24] are based on the calculus F# =-=[5, 17]-=-, which has higher order type constructors. In a quantified type, say ## : #. # , the quantified variable # is no longer restricted to a base kind# , but can have an arbitrary kind #. Consider the ter... |

352 |
Proofs and Types
- Girard, Lafont, et al.
- 1989
(Show Context)
Citation Context ...o the companion technical report [18]). THEOREM 3.1. Reduction of well-formed types is strongly normalizing. We prove strong normalization of the type language following Girard's method of candidates =-=[6]-=-, using his definition of a candidate. The standard set of neutral types is extended to include types constructed by Typerec. We define R# as the set of types # of kind# such that the type Typerec[#] ... |

259 | Compiling Polymorphism Using Intensional Type Analysis
- Harper, Morrisett
- 1995
(Show Context)
Citation Context ...ally typed languages, yet retain the advantages of static type checking. Supporting runtime type analysis in a type-safe manner has been an active area of research. This paper builds on existing work =-=[8]-=- but makes the following new contributions: . We support fully reflexive type analysis at the term level. Consequently, programs can analyze any runtime value such as function closures and polymorphic... |

238 |
Interprétation fonctionnelle et elimination des coupures de l’arithmétique d’ordre supérieur. Thèse d’état, Université de Paris 7
- Girard
- 1972
(Show Context)
Citation Context ...Another serious problem in analyzing quantified types involves both the type-level and the term-level operators. Typed intermediate languages like FLINT [20] and TIL [24] are based on the calculus F# =-=[5, 17]-=-, which has higher order type constructors. In a quantified type, say ## : #. # , the quantified variable # is no longer restricted to a base kind# , but can have an arbitrary kind #. Consider the ter... |

227 | TIL: A TypeDirected Optimizing Compiler for ML
- Tarditi, Morrisett, et al.
- 1996
(Show Context)
Citation Context ...guages like ML, the type of a value may not be known statically; therefore, compilers have traditionally used inefficient, uniformly boxed data representation. To avoid this, several modern compilers =-=[23, 19, 25]-=- use runtime type information to support unboxed data representation. When compiling code which uses runtime type inspections, most existing compilers use untyped intermediate languages, and reify run... |

154 | Typed closure conversion
- Minamide, Morrisett, et al.
- 1996
(Show Context)
Citation Context ...nding structures(e.g., polymorphic, existential or recursive types). Therefore, type analyzing primitives that handle polymorphic code blocks, closures (since closures are represented as existentials =-=[11]-=-), or recursive structures, cannot be written in their language. The types in their language (in essence shown in Figure 1) are separated into two universes, constructors and types. The constructor ca... |

142 | Intensional polymorphism in type erasure semantics
- Crary, Weirich, et al.
- 2002
(Show Context)
Citation Context ...hat the language is sound and that type reduction is strongly normalizing and confluent. In the companion technical report [18], we also show a translation into a language with type erasure semantics =-=[2]-=-. In a type preserving compiler this provides an approach to typed closure conversion which allows generation of certified object code. 2. MOTIVATION The core issue that we address in this paper is th... |

138 | Compiling with Proofs
- Necula
- 1998
(Show Context)
Citation Context ...nd reify runtime types into values at some early stage. However, discarding type information during compilation puts this approach at a serious disadvantage when it comes to generating certified code =-=[13]-=-. Code certification is appealing for a number of reasons. One need not trust the correctness of a compiler generating certified code; instead, one can verify the correctness of the generated code. Ch... |

138 | A type-based compiler for standard ML
- Shao, Appel
- 1995
(Show Context)
Citation Context ...guages like ML, the type of a value may not be known statically; therefore, compilers have traditionally used inefficient, uniformly boxed data representation. To avoid this, several modern compilers =-=[23, 19, 25]-=- use runtime type information to support unboxed data representation. When compiling code which uses runtime type inspections, most existing compilers use untyped intermediate languages, and reify run... |

121 | Derivable type classes
- Hinze, Jones
(Show Context)
Citation Context ... for primitive recursion over types. This allows the user to define new kinds and recursive operations over types of these kinds. This framework also resembles the dictionary passing style in Haskell =-=[12]-=-. The term representation of a type may be viewed as corresponding to the dictionary for that type (for some class). However, the authors consider dictionary passing in an untyped calculus; moreover, ... |

95 | Bananas in Space: Extending Fold and Unfold to Exponential Types
- Meijer, Hutton
- 1995
(Show Context)
Citation Context ...o term-level analysis of types. Our solution for recursive types is based on the idea proposed by Fegaras and Sheard [4] for extending the fold operation to non-inductive datatypes. Meijer and Hutton =-=[10]-=- also propose a method for extending catamorphisms to datatypes with embedded functions; however, their method requires the definition of an anamorphism for every such catamorphism. Necula [13] propos... |

89 | An overview of the FLINT/ML compiler
- Shao
- 1997
(Show Context)
Citation Context ...y this makes typechecking Typerec undecidable. Another serious problem in analyzing quantified types involves both the type-level and the term-level operators. Typed intermediate languages like FLINT =-=[20]-=- and TIL [24] are based on the calculus F# [5, 17], which has higher order type constructors. In a quantified type, say ## : #. # , the quantified variable # is no longer restricted to a base kind# , ... |

76 | Flexible Type Analysis
- Crary, Weirich
- 1999
(Show Context)
Citation Context ...pe language---the application of ## :# . Typerec # of . . . to # would reduce in general to different types if we perform the #-reduction step first or eliminate the iterator first. Crary and Weirich =-=[1]-=- propose another method for solving this problem. Their language LX allows the representation of terms with bound variables using deBruijn notation and an encoding of natural numbers as types. To anal... |

65 | Flexible representation analysis - Shao - 1997 |

54 | Revisiting catamorphism over datatypes with embedded functions
- Fegaras, Sheard
- 1996
(Show Context)
Citation Context ... polymorphic or existential quantifier and those bound in a recursive type. This reasoning leads us to a solution based on the work of Fegaras and Sheard on catamorphisms over non-inductive datatypes =-=[4]-=-. The main idea is to introduce an auxiliary type constructorsPlace of kind# ## which is the right inverse of the iterator, i.e., it holds that Typerec[# ] (Place #) of (# int ; ## ; ## ; # # +; #) # ... |

48 | Design and Implementation of Code Optimizations for a Type-Directed Compilation for Standard ML
- Tarditi
- 1996
(Show Context)
Citation Context ...typechecking Typerec undecidable. Another serious problem in analyzing quantified types involves both the type-level and the term-level operators. Typed intermediate languages like FLINT [20] and TIL =-=[24]-=- are based on the calculus F# [5, 17], which has higher order type constructors. In a quantified type, say ## : #. # , the quantified variable # is no longer restricted to a base kind# , but can have ... |

46 | Subtyping with Singleton Types
- Aspinall
- 1995
(Show Context)
Citation Context ...to be restricted to members of such classes. Yang [15] presents some approaches to enable type-safe programming of type-indexed values in ML which is similar to term level analysis of types. Aspinall =-=[1]-=- studied a typed λ-calculus with subtypes and singleton types. Necula [11] proposed the idea of a certifying compiler and showed the construction of a certifying compiler for a type-safe subset of C. ... |

43 | Inductively Defined Types in the Calculus of Constructions
- Pfenning, Paulin-Mohring
- 1990
(Show Context)
Citation Context ...preserving compiler generating type-safe assembly code is a practical basis for a certifying compiler. The idea of programming with iterators is explained in Pierce's notes [16]. Pfenning and Mohring =-=[15]-=- show how inductively defined types can be represented by closed types. They also construct representations of all primitive recursive functions over inductively defined types. 6. CONCLUSIONS We prese... |

42 | Encoding types in ML-Like languages
- Yang
(Show Context)
Citation Context ...icted to type variables of kind# . Duggan [3] proposes another framework for intensional type analysis; however, he allows the analysis of types only at the term level and not at the type level. Yang =-=[27]-=- presents some approaches to enable type-safe programming of type-indexed values in ML which is similar to term-level analysis of types. Our solution for recursive types is based on the idea proposed ... |

38 | Semantics for communication primitives in an polymorphic language
- OHORI, KATO
- 1993
(Show Context)
Citation Context ...halling One of the examples that Harper and Morrisett [8] use to illustrate the power of intensional type analysis is based on the extension of ML for distributed computing proposed by Ohori and Kato =-=[14]-=-. The idea is to convert values into a form which can be used for transmission over a network. An integer value may be transmitted directly, but a function may not; instead, a globally unique identifi... |

37 |
Extensional polymorphism
- Dubois, Rouaix, et al.
- 1995
(Show Context)
Citation Context ...the dictionary for that type (for some class). However, the authors consider dictionary passing in an untyped calculus; moreover, they do not consider the intensional analysis of types. Dubois et al. =-=[4]-=- also pass explicit type representations in their extensional polymorphism scheme. However, they do not provide a mechanism for connecting a type to its representation. Minamide’s [8] type-lifting pro... |

34 | Typed cross-module compilation
- Shao
- 1998
(Show Context)
Citation Context ...e set of kinds. Both of these approaches are clearly impractical. Recent work on typed compilation of ML and Java has shown that both would require an F# -like calculus with arbitrarily complex kinds =-=[21, 22, 9]-=-. 2.3 Requirements for a solution Before we discuss our solution, let us look at the properties we want it to have. First, our language must support type analysis in the manner of Harper/Morrisett. Th... |

32 | Representing java classes in a typed intermediate language - League, Shao, et al. - 1999 |

29 | Programming in higher-order typed lambda calculi
- Pierce, Dietzen, et al.
- 1989
(Show Context)
Citation Context ...] showed that a fully type-preserving compiler generating type-safe assembly code is a practical basis for a certifying compiler. The idea of programming with iterators is explained in Pierce's notes =-=[16]-=-. Pfenning and Mohring [15] show how inductively defined types can be represented by closed types. They also construct representations of all primitive recursive functions over inductively defined typ... |

28 | Transparent modules with fully syntactic signatures
- Shao
- 1999
(Show Context)
Citation Context ...e set of kinds. Both of these approaches are clearly impractical. Recent work on typed compilation of ML and Java has shown that both would require an F# -like calculus with arbitrarily complex kinds =-=[21, 22, 9]-=-. 2.3 Requirements for a solution Before we discuss our solution, let us look at the properties we want it to have. First, our language must support type analysis in the manner of Harper/Morrisett. Th... |

15 |
A type-based semantics for user-defined marshalling in polymorphic languages
- Duggan
- 1998
(Show Context)
Citation Context ...ntified type variable. Moreover, their type analysis is not fully reflexive since they can not handle arbitrary quantified types; quantification must be restricted to type variables of kind# . Duggan =-=[3]-=- proposes another framework for intensional type analysis; however, he allows the analysis of types only at the term level and not at the type level. Yang [27] presents some approaches to enable type-... |

15 |
Parametricity and variants of Girard’s
- Harper, Mitchell
- 1999
(Show Context)
Citation Context ...arametric, i.e., kind analysis is not possible. This property prevents in particular the construction of non-terminating types based on variants of Girard's J operator using a kind-comparing operator =-=[7]-=-. For analysis of quantified types at the term level we have the new construct # + #. e. This does not result in any additional complexity at the type level---although we introduce a new type construc... |

12 | Full Lifting of Type Parameters
- Minamide
- 1997
(Show Context)
Citation Context ...s. Dubois et al. [4] also pass explicit type representations in their extensional polymorphism scheme. However, they do not provide a mechanism for connecting a type to its representation. Minamide’s =-=[8]-=- type-lifting procedure is also related to our work. His procedure maintains interrelated constraints between type parameters; however, his language does not support intensional type analysis. Duggan ... |

9 |
Safe garbage collection = regions + intensional type analysis
- Wang, Appel
- 1999
(Show Context)
Citation Context ...eserving its structure. This means that the Typerec will map a recursive type into a recursive type. Other applications of type analysis also follow this pattern. Consider a copying garbage collector =-=[14]-=-. Its copying function would use a Typerec to express that data from a particular region has been copied into a different region. Since the structure of the data remains the same after being copied, a... |