## Rank 2 types for term graph rewriting (2003)

Venue: | IN TIP’02, VOLUME 75 OF ENTCS |

Citations: | 2 - 1 self |

### BibTeX

@INPROCEEDINGS{Bakel03rank2,

author = {Steffen van Bakel},

title = {Rank 2 types for term graph rewriting},

booktitle = {IN TIP’02, VOLUME 75 OF ENTCS},

year = {2003},

publisher = {Elsevier}

}

### OpenURL

### Abstract

We define a notion of type assignment with polymorphic intersection types of rank 2 for a term graph rewriting language that expresses sharing and cycles. We show that type assignment is decidable through defining, using the extended notion of unification from [5], a notion of principal pair which generalizes ML’s principal type property.

### Citations

1115 |
The Lambda Calculus: Its Syntax and Semantics
- Barendregt
- 1981
(Show Context)
Citation Context ...ably important that type assignment is formally defined as close to the actual language as possible. Furthermore, many aspects of those languages are not easily dealt with in the Lambda Calculus (LC) =-=[8]-=-, or not expressible at all, like patterns, sharing, and cyclic structures. This motivated the investigation of type assignment for Term Rewriting Systems (TRS) [35] and Term Graph Rewriting Systems (... |

945 |
A machine-oriented logic based on the resolution principle
- Robinson
- 1965
(Show Context)
Citation Context ...s of Rank 2, but only an algorithm that finds the most general unifying chain for demanded and provided type. It is defined as a natural extension of Robinson’s well-known unification algorithm unify =-=[40]-=-, and can be seen as an extension of the notion of unification as presented in [4], in that it deals with quantification as well. Definition 6.1 (UNIFICATION) Unification of Curry types (extended with... |

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ... are added to the system. In the past, many notions of type assignment have been studied for (functional) programming languages, all based on (extensions of) the Hindley-Milner type assignment system =-=[27, 37]-=-. Moreover, almost all notions of type assignment as proposed for use in functional programming, in reality are developed on (enriched) lambda calculi, and little work is available that discusses and ... |

751 | Rewrite systems
- Dershowitz, Jouannaud
- 1992
(Show Context)
Citation Context ...typeable terms have a principal typing. Finally, Section 8 contains some concluding remarks regarding implementation aspects and overloading. We assume the reader to be familiar with LC [8], refer to =-=[35, 23]-=- for rewrite systems, and to [12, 10, 11, 30, 38, 42] for definitions of TGRS. The system defined here is aimed to be similar to those, although their relation is not studied here. We will use a vecto... |

565 | Term Rewriting Systems
- Klop
- 1992
(Show Context)
Citation Context ...lt with in the Lambda Calculus (LC) [8], or not expressible at all, like patterns, sharing, and cyclic structures. This motivated the investigation of type assignment for Term Rewriting Systems (TRS) =-=[35]-=- and Term Graph Rewriting Systems (TGRS) [10] presented in various papers [7, 6, 4, 13, 5], and the system presented in this paper is developed in much the same way as the systems studied there. As an... |

364 |
Towards a theory of type structure
- Reynolds
- 1974
(Show Context)
Citation Context ...r TRS was presented that uses intersection types of rank 2. Another direction in the area of types is that of quantified or polymorphic types. This field originated in the context of LC with System F =-=[26, 39]-=-, which provides a general notion of polymorphism, but lacks principal typings. Moreover, type inference in System F is undecidable in general [44], although it is decidable for some sub-systems, in p... |

216 |
A filter lambda model and the completeness of type assignment. J.Symbolic Logic, 48:931--940
- Barendregt, Coppo, et al.
- 1983
(Show Context)
Citation Context ...2, 24, 30, 42] for discussions of term graph rewriting and its suitability for programming. The main point of focus for [6, 5] was normalisation, which motivated the choice to use intersections types =-=[9]-=-. This implied, however, that type assignment for those systems is undecidable. It is by now well-known that there are decidable restrictions of the intersection type assignment system [21, 34, 28, 4,... |

160 | A non-strict functional language with polymorphic types - Miranda - 1985 |

141 |
The system F of variable types, fifteen years later. Theoretical Computer Science 45
- Girard
- 1986
(Show Context)
Citation Context ...r TRS was presented that uses intersection types of rank 2. Another direction in the area of types is that of quantified or polymorphic types. This field originated in the context of LC with System F =-=[26, 39]-=-, which provides a general notion of polymorphism, but lacks principal typings. Moreover, type inference in System F is undecidable in general [44], although it is decidable for some sub-systems, in p... |

138 | A calculus for overloaded functions with subtyping
- Castagna, Ghelli, et al.
- 1995
(Show Context)
Citation Context ...g The concept of overloading in programming languages is normally used to express that different objects (typically procedures) can have the same identifier. (For another approach to overloading, see =-=[17, 16]-=-.) At first sight this seems to be nothing but a tool to obtain programming convenience, but the implementation aspects of languages with overloading are not at all trivial. In functional programming ... |

108 |
The principal type scheme of an object in combinatory logic
- Hindley
- 1969
(Show Context)
Citation Context ... are added to the system. In the past, many notions of type assignment have been studied for (functional) programming languages, all based on (extensions of) the Hindley-Milner type assignment system =-=[27, 37]-=-. Moreover, almost all notions of type assignment as proposed for use in functional programming, in reality are developed on (enriched) lambda calculi, and little work is available that discusses and ... |

106 |
graph rewriting
- Barendregt
- 1987
(Show Context)
Citation Context ...ot expressible at all, like patterns, sharing, and cyclic structures. This motivated the investigation of type assignment for Term Rewriting Systems (TRS) [35] and Term Graph Rewriting Systems (TGRS) =-=[10]-=- presented in various papers [7, 6, 4, 13, 5], and the system presented in this paper is developed in much the same way as the systems studied there. As an example, take the problem of I/O in the cont... |

106 | Lazy functional state threads
- Launchbury, Jones
- 1994
(Show Context)
Citation Context ...s also Jim’s system P2 [29], which is a combination of ML-types and Rank 2 intersection types. Having Rank 2 quantified types in the system allows us to type, for instance, the constant runST used in =-=[36]-=-, which cannot be typed in P2. Our system also generalises the system of [20] that combines rank 2 intersection types and shallow polymorphism, so does not have polymorphic types of rank 2. The Rank 2... |

103 | Complete restrictions of the Intersection Type Discipline
- Bakel
- 1992
(Show Context)
Citation Context ...τi, otherwise. τ ′ i Closure is extended to types by: 〈ϕ〉(σ) = (τ), if 〈ϕ, σ〉(〈∅, σ〉) = 〈∅, τ〉. Expansion The variant of expansion used in the Rank 2 system is quite different from that normally used =-=[2, 3, 41]-=-. The reason for this is that expansion, normally, increases the rank of a type: 〈ϕ1, 2〉(〈{x:ϕ1→ϕ2}, ϕ1〉)(ϕ1→ϕ2) = (ϕ 1 1 ∩ϕ2 1)→ϕ2, a feature that is of course not allowed within a system that limits... |

102 | et a!. Principles of OBJ2 - Futatsugi |

94 |
Type Assignment in Programming Languages
- Damas
- 1984
(Show Context)
Citation Context ...l typings. Moreover, type inference in System F is undecidable in general [44], although it is decidable for some sub-systems, in particular if we consider types of rank 2 [33]. The type system of ML =-=[19]-=- uses (shallow) polymorphic types and has principal types. Since its polymorphism is limited, some programs that arise naturally cannot be typed, and it does not have principal typings [29], a propert... |

93 | What are principal typings and what are they good for
- Jim
- 1996
(Show Context)
Citation Context ...tions types [9]. This implied, however, that type assignment for those systems is undecidable. It is by now well-known that there are decidable restrictions of the intersection type assignment system =-=[21, 34, 28, 4, 29, 22, 20, 31, 32]-=-, making the definition of notions of type assignment using those types feasible. In particular, in [4] a notion of type assignment for TRS was presented that uses intersection types of rank 2. Anothe... |

78 | A direct algorithm for type inference in the rank-2 fragment of the second-order λ-calculus
- Kfoury, Wells
- 1994
(Show Context)
Citation Context ...tions types [9]. This implied, however, that type assignment for those systems is undecidable. It is by now well-known that there are decidable restrictions of the intersection type assignment system =-=[21, 34, 28, 4, 29, 22, 20, 31, 32]-=-, making the definition of notions of type assignment using those types feasible. In particular, in [4] a notion of type assignment for TRS was presented that uses intersection types of rank 2. Anothe... |

71 | An introduction to term graph rewriting
- KENNAWAY, KLOP, et al.
- 1993
(Show Context)
Citation Context ...in that, as far as assignable types are concerned, the systems are incompatible. We will now formally introduce term graphs, as done in [10]. Following [13], graphs are written in an equational style =-=[10, 1]-=-, rather than using drawings or 4-tuples (as in [10]). Definition 1.2 (GRAPHS) [13, 24] A graph (over F) is a pair g = 〈r | G〉, where r is a variable and stands for the root of the graph, and G is a s... |

69 | Conventional and Uniqueness Typing in Graph Rewrite Systems
- Barendsen, Smetsers
- 1996
(Show Context)
Citation Context ...rns, sharing, and cyclic structures. This motivated the investigation of type assignment for Term Rewriting Systems (TRS) [35] and Term Graph Rewriting Systems (TGRS) [10] presented in various papers =-=[7, 6, 4, 13, 5]-=-, and the system presented in this paper is developed in much the same way as the systems studied there. As an example, take the problem of I/O in the context of functional programming: only when repr... |

61 | Intersection Type Assignment Systems
- Bakel
- 1995
(Show Context)
Citation Context ...τi, otherwise. τ ′ i Closure is extended to types by: 〈ϕ〉(σ) = (τ), if 〈ϕ, σ〉(〈∅, σ〉) = 〈∅, τ〉. Expansion The variant of expansion used in the Rank 2 system is quite different from that normally used =-=[2, 3, 41]-=-. The reason for this is that expansion, normally, increases the rank of a type: 〈ϕ1, 2〉(〈{x:ϕ1→ϕ2}, ϕ1〉)(ϕ1→ϕ2) = (ϕ 1 1 ∩ϕ2 1)→ϕ2, a feature that is of course not allowed within a system that limits... |

60 | Clean: A language for functional graph rewriting - Brus, Eekelen, et al. - 1987 |

60 | Concurrent Clean
- Nöcker, Smetsers, et al.
- 1991
(Show Context)
Citation Context ...g. Finally, Section 8 contains some concluding remarks regarding implementation aspects and overloading. We assume the reader to be familiar with LC [8], refer to [35, 23] for rewrite systems, and to =-=[12, 10, 11, 30, 38, 42]-=- for definitions of TGRS. The system defined here is aimed to be similar to those, although their relation is not studied here. We will use a vector notation g ⇀ as an abbreviation for g1, . . . , gn,... |

58 |
Principal type schemes for an extended type theory
- Rocca, S, et al.
- 1984
(Show Context)
Citation Context ...τi, otherwise. τ ′ i Closure is extended to types by: 〈ϕ〉(σ) = (τ), if 〈ϕ, σ〉(〈∅, σ〉) = 〈∅, τ〉. Expansion The variant of expansion used in the Rank 2 system is quite different from that normally used =-=[2, 3, 41]-=-. The reason for this is that expansion, normally, increases the rank of a type: 〈ϕ1, 2〉(〈{x:ϕ1→ϕ2}, ϕ1〉)(ϕ1→ϕ2) = (ϕ 1 1 ∩ϕ2 1)→ϕ2, a feature that is of course not allowed within a system that limits... |

51 | Principality and decidable type inference for finite-rank intersection types
- Kfoury, Wells
- 1999
(Show Context)
Citation Context ...tions types [9]. This implied, however, that type assignment for those systems is undecidable. It is by now well-known that there are decidable restrictions of the intersection type assignment system =-=[21, 34, 28, 4, 29, 22, 20, 31, 32]-=-, making the definition of notions of type assignment using those types feasible. In particular, in [4] a notion of type assignment for TRS was presented that uses intersection types of rank 2. Anothe... |

27 |
A complete type inference algorithm for simple intersection types
- Coppo, Giannini
- 1992
(Show Context)
Citation Context ...r example the first and second. This in particular is troublesome, since it is not obvious at all what in this case the type of G H should be. One solution for this problem would be to allow, like in =-=[18]-=-, for more than one principal pair for a term (notice that this is not the same as saying that a principal type can be an intersection). Another would be to introduce – formally – an extra type constr... |

26 | Towards an intermediate language based on graph rewriting - Barendregt, Eekelen, et al. - 1987 |

26 | Rank 2 type systems and recursive definitions
- Jim
- 1993
(Show Context)
Citation Context |

23 | Normalisation Results for Typeable Rewrite Systems
- Bakel, Fernández
- 1997
(Show Context)
Citation Context ...d there is a chain Ch such that Ch(〈P, π〉) = 〈B, σ〉. This property, together with the result that all operations are sound, is used to prove the subject reduction result. (The same method was used in =-=[7, 6, 5]-=-.) Definition 4.3 (TYPE ASSIGNMENT ON REWRITE RULES) symbol F is typeable with respect to E, if there are P , and π ∈ T2 such that: a) 〈P, π〉 is a principal pair (Def. 7.1) for left with respect to E.... |

22 | Rank 2 Intersection Type Assignment in Term Rewriting Systems
- Bakel
- 1996
(Show Context)
Citation Context ...rns, sharing, and cyclic structures. This motivated the investigation of type assignment for Term Rewriting Systems (TRS) [35] and Term Graph Rewriting Systems (TGRS) [10] presented in various papers =-=[7, 6, 4, 13, 5]-=-, and the system presented in this paper is developed in much the same way as the systems studied there. As an example, take the problem of I/O in the context of functional programming: only when repr... |

21 | Relating Typability and Expressibility in Finite-Rank Intersection Type Systems
- Kfoury, Mairson, et al.
- 1999
(Show Context)
Citation Context |

17 | A meta-language for typed object-oriented languages
- Castagna
- 1995
(Show Context)
Citation Context ...g The concept of overloading in programming languages is normally used to express that different objects (typically procedures) can have the same identifier. (For another approach to overloading, see =-=[17, 16]-=-.) At first sight this seems to be nothing but a tool to obtain programming convenience, but the implementation aspects of languages with overloading are not at all trivial. In functional programming ... |

15 |
de Vries. The adequacy of term graph rewriting for simulating term rewriting
- Kennaway, Klop, et al.
- 1993
(Show Context)
Citation Context ...ration will generate a connected graph. Of course it is also possible to define term graphs and term graph rewrite rules directly, without first taking a term or term rewrite rule and lifting it; see =-=[10, 11, 12, 24, 30, 42]-=- for discussions of term graph rewriting and its suitability for programming. The main point of focus for [6, 5] was normalisation, which motivated the choice to use intersections types [9]. This impl... |

13 |
A Decidable Intersection Type System based on Relevance
- Damiani, Giannini
- 1994
(Show Context)
Citation Context |

12 |
Type reconstruction in finite-rank fragments of the second-order λcalculus
- Kfoury, Tiuryn
- 1992
(Show Context)
Citation Context ...morphism, but lacks principal typings. Moreover, type inference in System F is undecidable in general [44], although it is decidable for some sub-systems, in particular if we consider types of rank 2 =-=[33]-=-. The type system of ML [19] uses (shallow) polymorphic types and has principal types. Since its polymorphism is limited, some programs that arise naturally cannot be typed, and it does not have princ... |

11 | Partial Type Assignment in Left Linear Applicative Term Rewriting Systems
- Bakel, Smetsers, et al.
- 1992
(Show Context)
Citation Context ...rns, sharing, and cyclic structures. This motivated the investigation of type assignment for Term Rewriting Systems (TRS) [35] and Term Graph Rewriting Systems (TGRS) [10] presented in various papers =-=[7, 6, 4, 13, 5]-=-, and the system presented in this paper is developed in much the same way as the systems studied there. As an example, take the problem of I/O in the context of functional programming: only when repr... |

9 |
Detecting and Removing Dead-Code using Rank 2 Intersection
- Damiani, Prost
- 1998
(Show Context)
Citation Context |

8 | J.W.: Equational term graph rewriting. Fundamentae Informaticae 26 - Ariola, Klop - 1996 |

8 | Typing local definitions and conditional expressions with rank 2 intersection - Damiani - 2000 |

7 |
Some computational properties of intersection types
- Bucciarelli, Lorenzis, et al.
- 1996
(Show Context)
Citation Context ...C type exactly the same set of terms [45], their combination results in a system with more expressive power: the set of assignable types increases, and types can better express the behaviour of terms =-=[15]-=-. Also, polymorphism can be expressed directly (using the universal quantifier) and, moreover, every typeable expression in [5] has a principal typing. This principal typing property does not hold in ... |

5 | Graph Rewriting Semantics for Functional Programming Languages
- Eekelen, Smetsers
- 1996
(Show Context)
Citation Context ...ration will generate a connected graph. Of course it is also possible to define term graphs and term graph rewrite rules directly, without first taking a term or term rewrite rule and lifting it; see =-=[10, 11, 12, 24, 30, 42]-=- for discussions of term graph rewriting and its suitability for programming. The main point of focus for [6, 5] was normalisation, which motivated the choice to use intersections types [9]. This impl... |

4 | Polymorphic Intersection Type Assignment for Rewrite Systems with Abstraction and β-rule
- Bakel, Barbanera, et al.
- 2000
(Show Context)
Citation Context ...nk 2 intersection types and shallow polymorphism, so does not have polymorphic types of rank 2. The Rank 2 system as used in this paper can be seen as a combination of the systems of [4] and [33]. In =-=[5]-=- an incomplete notion of polymorphic intersection type assignment was presented for a language that is a combination of LC and CuTRS; it contains a definition of a Rank 2 system for that combined calc... |

3 | Extending Graph Rewriting with Copying
- Barendsen, Smetsers
- 1993
(Show Context)
Citation Context ...ration will generate a connected graph. Of course it is also possible to define term graphs and term graph rewrite rules directly, without first taking a term or term rewrite rule and lifting it; see =-=[10, 11, 12, 24, 30, 42]-=- for discussions of term graph rewriting and its suitability for programming. The main point of focus for [6, 5] was normalisation, which motivated the choice to use intersections types [9]. This impl... |

3 |
Eekelen, editors, Term Graph Rewriting - Theory and Practice, chapter 9
- Plasmeijer, van
- 1993
(Show Context)
Citation Context |