## Subtyping, Declaratively An Exercise in Mixed Induction and Coinduction

### Cached

### Download Links

Citations: | 1 - 0 self |

### BibTeX

@MISC{Danielsson_subtyping,declaratively,

author = {Nils Anders Danielsson and Thorsten Altenkirch},

title = {Subtyping, Declaratively An Exercise in Mixed Induction and Coinduction},

year = {}

}

### OpenURL

### Abstract

Abstract. It is natural to present subtyping for recursive types coinductively. However, Gapeyev, Levin and Pierce have noted that there is a problem with coinductive definitions of non-trivial transitive inference systems: they cannot be “declarative”—as opposed to “algorithmic ” or syntax-directed—because coinductive inference systems with an explicit rule of transitivity are trivial. We propose a solution to this problem. By using mixed induction and coinduction we define an inference system for subtyping which combines the advantages of coinduction with the convenience of an explicit rule of transitivity. The definition uses coinduction for the structural rules, and induction for the rule of transitivity. We also discuss under what conditions this technique can be used when defining other inference systems. The developments presented in the paper have been mechanised using Agda, a dependently typed programming language and proof assistant. 1

### Citations

318 | Subtyping recursive types
- AMADIO, CARDELLI
- 1993
(Show Context)
Citation Context ...on where it is necessary. We illustrate this idea by using mixed induction and coinduction to define a subtyping relation for recursive types; such relations have been studied repeatedly in the past (=-=Amadio and Cardelli 1993-=-; Kozen et al. 1995; Brandt and Henglein 1998, and others). The rule which defines when a function type is a subtype of another is defined coinductively, following Brandt and Henglein (1998) and Gapey... |

127 |
Bisimilarity as a theory of functional programming
- Gordon
- 1995
(Show Context)
Citation Context ... potentially infinite, including streams and other (potentially) infinite data types (Coquand 1994; Giménez 1996; Turner 2004), process congruences (Milner 1990), congruences for functional programs (=-=Gordon 1999-=-), closures (Milner and Tofte 1991), semantics for divergence of programs (Cousot and Cousot 1992; Hughes and Moran 1995; Leroy and Grall 2009; Nakata and Uustalu 2009), and subtyping relations for re... |

90 | Infinite objects in type theory
- Coquand
- 1993
(Show Context)
Citation Context ...1 Introduction Coinduction and corecursion are useful techniques for defining and reasoning about things which are potentially infinite, including streams and other (potentially) infinite data types (=-=Coquand 1994-=-; Giménez 1996; Turner 2004), process congruences (Milner 1990), congruences for functional programs (Gordon 1999), closures (Milner and Tofte 1991), semantics for divergence of programs (Cousot and C... |

81 |
Co-induction in relational semantics
- Milner, Tofte
- 1991
(Show Context)
Citation Context ...ncluding streams and other (potentially) infinite data types (Coquand 1994; Giménez 1996; Turner 2004), process congruences (Milner 1990), congruences for functional programs (Gordon 1999), closures (=-=Milner and Tofte 1991-=-), semantics for divergence of programs (Cousot and Cousot 1992; Hughes and Moran 1995; Leroy and Grall 2009; Nakata and Uustalu 2009), and subtyping relations for recursive types (Brandt and Henglein... |

70 | A Categorical Programming Language - Hagino - 1987 |

69 | Coinductive axiomatization of recursive type equality and subtyping
- Brandt, Henglein
- 1998
(Show Context)
Citation Context ...lner and Tofte 1991), semantics for divergence of programs (Cousot and Cousot 1992; Hughes and Moran 1995; Leroy and Grall 2009; Nakata and Uustalu 2009), and subtyping relations for recursive types (=-=Brandt and Henglein 1998-=-; Gapeyev et al. 2002). However, the use of coinduction can lead to values which are “too infinite”. For instance, a non-trivial binary relation defined as a coinductive inference system cannot includ... |

69 | Inductive Definition in Type Theory - Mendler - 1988 |

66 |
On the semantics of fair parallelism
- Park
- 1979
(Show Context)
Citation Context ...ollowing Brandt and Henglein (1998) and Gapeyev et al. (2002), while the rule of transitivity is defined inductively. The technique of mixing induction and coinduction has been known for a long time (=-=Park 1980-=-; Barwise 1989; Raffalli 1994; Giménez 1996; Hensel and Jacobs 1997; Müller et al. 1999; Barthe et al. 2004; Levy 2006; Bradfield and Stirling 2007; Abel 2009; Hancock et al. 2009), but we feel that i... |

63 |
Techniques of ‘weak bisimulation up to
- Sangiorgi, Milner
- 1992
(Show Context)
Citation Context ..., and avoid relying on results or intuitions which are only valid in the inductive case. Note that the problem with ∼ = is closely related to the problem of weak bisimulation up to weak bisimilarity (=-=Sangiorgi and Milner 1992-=-); presumably some of the techniques which have been developed to address the latter problem are also applicable to the former. There are actually several different ways in which one can close a coind... |

49 | T.: Type-based termination of recursive definitions - Barthe, Frade, et al. - 2004 |

42 | Recursive subtyping revealed - Gapeyev, Levin, et al. - 2002 |

36 | Coinductive Big-step Operational Semantics - Leroy, Grall |

31 | Total functional programming - Turner - 2004 |

30 | General recursion via coinductive types - Capretta - 2005 |

27 | Modal mu-calculi
- Bradfield, Stirling
- 2007
(Show Context)
Citation Context ...ue of mixing induction and coinduction has been known for a long time (Park 1980; Barwise 1989; Raffalli 1994; Giménez 1996; Hensel and Jacobs 1997; Müller et al. 1999; Barthe et al. 2004; Levy 2006; =-=Bradfield and Stirling 2007-=-; Abel 2009; Hancock et al. 2009), but we feel that it deserves to be more well-known in the programming language community. We hope that this paper provides an example of the use of mixed induction a... |

24 | Proof methods for corecursive programs
- Gibbons, Hutton
- 2005
(Show Context)
Citation Context ...e termination checker ensures that these proofs are productive. Elements of coinductively defined relations can be constructed using corecursion. As an example, let us prove the map-iterate property (=-=Gibbons and Hutton 2005-=-): map S f (iterate f x) ≈ iterate f (f x). The function iterate repeatedly applies a function to a seed element and collects the results in a stream: iterate f x = x :: ♯ (f x :: ♯ (f (f x) :: . . .)... |

16 | Representations of stream processors using nested fixed points
- Hancock, Pattinson, et al.
(Show Context)
Citation Context ...as been known for a long time (Park 1980; Barwise 1989; Raffalli 1994; Giménez 1996; Hensel and Jacobs 1997; Müller et al. 1999; Barthe et al. 2004; Levy 2006; Bradfield and Stirling 2007; Abel 2009; =-=Hancock et al. 2009-=-), but we feel that it deserves to be more well-known in the programming language community. We hope that this paper provides an example of the use of mixed induction and coinduction which is appealin... |

9 | Making Choices Lazily
- Hughes, Moran
- 1995
(Show Context)
Citation Context ...96; Turner 2004), process congruences (Milner 1990), congruences for functional programs (Gordon 1999), closures (Milner and Tofte 1991), semantics for divergence of programs (Cousot and Cousot 1992; =-=Hughes and Moran 1995-=-; Leroy and Grall 2009; Nakata and Uustalu 2009), and subtyping relations for recursive types (Brandt and Henglein 1998; Gapeyev et al. 2002). However, the use of coinduction can lead to values which ... |

8 | Mixed inductive/coinductive types and strong normalization
- Abel
- 2007
(Show Context)
Citation Context ...induction has been known for a long time (Park 1980; Barwise 1989; Raffalli 1994; Giménez 1996; Hensel and Jacobs 1997; Müller et al. 1999; Barthe et al. 2004; Levy 2006; Bradfield and Stirling 2007; =-=Abel 2009-=-; Hancock et al. 2009), but we feel that it deserves to be more well-known in the programming language community. We hope that this paper provides an example of the use of mixed induction and coinduct... |

8 | Calcul de Constructions Infinies et son Application la Vrification des Systmes Communicants - Un - 1996 |

8 | Co-induction in relational semantics, Theoretical Computer Science 87 - Milner, Tofte - 1991 |

6 |
Infinitary Howe’s method
- Levy
- 2006
(Show Context)
Citation Context ...The technique of mixing induction and coinduction has been known for a long time (Park 1980; Barwise 1989; Raffalli 1994; Giménez 1996; Hensel and Jacobs 1997; Müller et al. 1999; Barthe et al. 2004; =-=Levy 2006-=-; Bradfield and Stirling 2007; Abel 2009; Hancock et al. 2009), but we feel that it deserves to be more well-known in the programming language community. We hope that this paper provides an example of... |

6 | Trace-based coinductive operational semantics for while
- Nakata, Uustalu
- 2009
(Show Context)
Citation Context ... 1990), congruences for functional programs (Gordon 1999), closures (Milner and Tofte 1991), semantics for divergence of programs (Cousot and Cousot 1992; Hughes and Moran 1995; Leroy and Grall 2009; =-=Nakata and Uustalu 2009-=-), and subtyping relations for recursive types (Brandt and Henglein 1998; Gapeyev et al. 2002). However, the use of coinduction can lead to values which are “too infinite”. For instance, a non-trivial... |

6 | Beating the productivity checker using embedded languages - Danielsson - 2010 |

5 | Danielsson, Thorsten Altenkirch, Mixing induction and coinduction - Anders - 2009 |

3 |
The Situation in Logic, volume 17 of CSLI Lecture Notes, chapter Mixed Fixed Points
- Barwise
- 1989
(Show Context)
Citation Context ...andt and Henglein (1998) and Gapeyev et al. (2002), while the rule of transitivity is defined inductively. The technique of mixing induction and coinduction has been known for a long time (Park 1980; =-=Barwise 1989-=-; Raffalli 1994; Giménez 1996; Hensel and Jacobs 1997; Müller et al. 1999; Barthe et al. 2004; Levy 2006; Bradfield and Stirling 2007; Abel 2009; Hancock et al. 2009), but we feel that it deserves to ... |

2 |
Code accompanying the paper. Currently available from http://www.cs.nott.ac.uk/~nad
- Danielsson
(Show Context)
Citation Context ...aper have been formalised using the dependently typed, total 1 functional programming language Agda (Norell 2007; Agda Team 2009), and the source code is at the time of writing available to download (=-=Danielsson 2009-=-). The rest of the paper is structured as follows: Section 2 gives an introduction to induction and coinduction in the context of Agda. Section 3 defines a small language of recursive types, and Sect.... |