## Proof Methods for Structured Corecursive Programs (1999)

### Cached

### Download Links

Citations: | 10 - 3 self |

### BibTeX

@MISC{Gibbons99proofmethods,

author = {Jeremy Gibbons and Graham Hutton},

title = {Proof Methods for Structured Corecursive Programs},

year = {1999}

}

### OpenURL

### Abstract

Corecursive programs produce values of greatest fixpoint types, in contrast to recursive programs, which consume values of least fixpoint types. There are a number of widely used methods for proving properties of corecursive programs, including fixpoint induction, the take lemma, and coinduction. However, these methods are all rather low-level, in the sense that they do not exploit the common structure that is often present in corecursive definitions. We argue for a more structured approach to proving properties of corecursive programs. In particular, we show that by writing corecursive programs using an operator called unfold that encapsulates a common pattern of corecursive de nition, we can then use high-level algebraic properties of this operator to conduct proofs in a purely calculational style that avoids the use of either induction or coinduction.

### Citations

3384 |
Communication and Concurrency
- Milner
- 1989
(Show Context)
Citation Context ...s the operational approach [21], for which a widely-used notion of equivalence for programs is bisimilarity, and the basic proof method for establishing that two programs are bisimilar is coinduction =-=[19]-=-. In this section, we review Gordon’s work [11] on applying bisimilarity and coinduction to prove properties of corecursive functional programs, techniques also advocated by Turner [24]. The operation... |

1358 | 2004): A Structural Approach to Operational Semantics
- Plotkin
(Show Context)
Citation Context ...duction rule.s5 BISIMILARITY AND COINDUCTION Both fixpoint induction and the approximation lemma are based on denotational semantics. Another popular approach to semantics is the operational approach =-=[21]-=-, for which a widely-used notion of equivalence for programs is bisimilarity, and the basic proof method for establishing that two programs are bisimilar is coinduction [19]. In this section, we revie... |

1347 | Imperative functional programming
- Jones, Wadler
- 1993
(Show Context)
Citation Context ...tational semantics of functional programs. Applying fixpoint induction is rather tedious, but for the special case of corecursive programs that produce lists, one can use Bird and Wadler’s take lemma =-=[4]-=-, or the simpler approximation lemma [3]. More recently, Gordon [11] and Turner [24] have argued for the use of coinduction as the basic proof method for corecursive programs, which arises from work o... |

1166 |
Introduction to lattices and order
- Davey, Priestley
- 1992
(Show Context)
Citation Context ...f a definition x = fxfor a value x in terms of itself and some auxiliary function f is given by the limit of the following chain: ? v f ? v f (f ?) v f (f (f ?)) v ::: The well-known fixpoint theorem =-=[6]-=- states that the limit of this chain, denoted by fixf , is the least solution to the equation x = fx(that is, fixf is the least fixpoint of f ), and is hence an appropriate choice for the meaning of x... |

344 |
Denotational Semantics: A Methodology for Language Development
- Schmidt
- 1986
(Show Context)
Citation Context ... however, we review and compare the standard proof techniques for corecursive programs. 3 FIXPOINT INDUCTION Recall that in the standard denotational approach to the semantics of functional languages =-=[23]-=-, types are partially ordered sets with a least element ? and limits of all non-empty chains (that is, types are cpos), and programs are functions between cpos that preserve these limits (that is, pro... |

337 | Theorems for free - Wadler - 1989 |

307 | Functional programming with bananas, lenses, envelopes, and barbed wire
- Meijer, Fokkinga, et al.
- 1991
(Show Context)
Citation Context ...that by writing corecursive programs using a simple operator called unfold that encapsulates a common pattern of corecursive definition, we can then use the high-level universal and fusion properties =-=[18, 10, 13]-=- of this operator to conduct proofs in a purely calculational style that avoids the use of inductive or coinductive methods. The unfold operator for lists may be defined as follows: unfold :: (α ! Boo... |

225 |
Introduction to Functional Programming using Haskell
- Bird
- 1998
(Show Context)
Citation Context ...s. Applying fixpoint induction is rather tedious, but for the special case of corecursive programs that produce lists, one can use Bird and Wadler’s take lemma [4], or the simpler approximation lemma =-=[3]-=-. More recently, Gordon [11] and Turner [24] have argued for the use of coinduction as the basic proof method for corecursive programs, which arises from work on the operational semantics of functiona... |

176 | PolyP — a polytypic programming language extension - Jansson, Jeuring - 1997 |

125 |
Bisimilarity as a theory of functional programming
- Gordon
- 1995
(Show Context)
Citation Context ...ion is rather tedious, but for the special case of corecursive programs that produce lists, one can use Bird and Wadler’s take lemma [4], or the simpler approximation lemma [3]. More recently, Gordon =-=[11]-=- and Turner [24] have argued for the use of coinduction as the basic proof method for corecursive programs, which arises from work on the operational semantics of functional programs. In this article ... |

108 |
Recursive programming techniques
- Burge
- 1975
(Show Context)
Citation Context ... or coinductive methods.s1 INTRODUCTION Recursion is a central concept in computing, with applications ranging from the theoretical foundations of computation [22] to practical programming techniques =-=[5]-=-. In recent years, it has become increasingly clear that the dual but less wellknown concept of corecursion is just as central to computing [1, 2, 14, 15]. In this article, we explore methods for prov... |

104 |
Vicious Circles
- Barwise, Moss
- 1996
(Show Context)
Citation Context ... of computation [22] to practical programming techniques [5]. In recent years, it has become increasingly clear that the dual but less wellknown concept of corecursion is just as central to computing =-=[1, 2, 14, 15]-=-. In this article, we explore methods for proving properties of corecursive programs. As yet, there appears to be no standard definition for the notion of corecursion. In this article, we follow Moss ... |

95 |
Algebraically complete categories
- Freyd
- 1990
(Show Context)
Citation Context ...s in the article are written in the standard lazy functional language Haskell [16]. This language has the convenient property that recursive types are simultaneously both least and greatest fixpoints =-=[8]-=-. Hence, in this article, the terms ‘recursive program’ and ‘corecursive program’ simply refer to Haskell functions whose domain and range are recursive types, respectively. The most widely used metho... |

84 | Algebraic Data Types and Program Transformation - Malcolm - 1990 |

80 |
Theories of Programming Languages
- Reynolds
- 1998
(Show Context)
Citation Context ...al style that avoids the use of inductive or coinductive methods.s1 INTRODUCTION Recursion is a central concept in computing, with applications ranging from the theoretical foundations of computation =-=[22]-=- to practical programming techniques [5]. In recent years, it has become increasingly clear that the dual but less wellknown concept of corecursion is just as central to computing [1, 2, 14, 15]. In t... |

61 | A Tutorial on the Universality and Expressiveness of Fold
- Hutton
- 1999
(Show Context)
Citation Context ...nal style that avoids the use of inductive or coinductive methods. This approach is dual to the use of fold and its associated properties in recursive programming, which has recently been surveyed in =-=[12]-=-. The article is aimed at a reader who is familiar with the basics of recursive programming and inductive proof, say to the level of [4, 3]. No prior knowledge of corecursive programming and proof is ... |

49 | The Under-appreciated Unfold
- Gibbons, Jones
- 1998
(Show Context)
Citation Context ...that by writing corecursive programs using a simple operator called unfold that encapsulates a common pattern of corecursive definition, we can then use the high-level universal and fusion properties =-=[18, 10, 13]-=- of this operator to conduct proofs in a purely calculational style that avoids the use of inductive or coinductive methods. The unfold operator for lists may be defined as follows: unfold :: (α ! Boo... |

47 | Elementary Strong Functional Programming
- Turner
- 1995
(Show Context)
Citation Context ...dious, but for the special case of corecursive programs that produce lists, one can use Bird and Wadler’s take lemma [4], or the simpler approximation lemma [3]. More recently, Gordon [11] and Turner =-=[24]-=- have argued for the use of coinduction as the basic proof method for corecursive programs, which arises from work on the operational semantics of functional programs. In this article we review the ab... |

46 |
Non-well-founded sets. Number 14
- Aczel
- 1988
(Show Context)
Citation Context ... of computation [22] to practical programming techniques [5]. In recent years, it has become increasingly clear that the dual but less wellknown concept of corecursion is just as central to computing =-=[1, 2, 14, 15]-=-. In this article, we explore methods for proving properties of corecursive programs. As yet, there appears to be no standard definition for the notion of corecursion. In this article, we follow Moss ... |

37 | The category theoretic solution of recursive domain equations - Smyth, Plotkin |

27 |
et al. Haskell 98: A non-strict, purely functional language
- Jones, Hughes
- 1999
(Show Context)
Citation Context ..., they do not require the use of self-reference in any form), but they will suffice for our purposes here. All the programs in the article are written in the standard lazy functional language Haskell =-=[16]-=-. This language has the convenient property that recursive types are simultaneously both least and greatest fixpoints [8]. Hence, in this article, the terms ‘recursive program’ and ‘corecursive progra... |

23 | Fold and unfold for program semantics
- Hutton
- 1998
(Show Context)
Citation Context ...that by writing corecursive programs using a simple operator called unfold that encapsulates a common pattern of corecursive definition, we can then use the high-level universal and fusion properties =-=[18, 10, 13]-=- of this operator to conduct proofs in a purely calculational style that avoids the use of inductive or coinductive methods. The unfold operator for lists may be defined as follows: unfold :: (α ! Boo... |

14 | The generic approximation lemma
- Hutton, Gibbons
- 2001
(Show Context)
Citation Context ...he approximation lemma [3], which is formally equivalent to the take lemma, but is easier to prove, slightly simpler to apply, and naturally generalises from lists to a large class of other datatypes =-=[9]-=-. The basis of the approximation lemma is the approx function: approx :: Int ! [α] ! [α] approx (n + 1) [] = [] approx (n + 1) (x : xs) = x : approx n xs The approx function is similar to the well-kno... |

13 | On the Foundations of Corecursion
- Moss, Danner
- 1997
(Show Context)
Citation Context ...operties of corecursive programs. As yet, there appears to be no standard definition for the notion of corecursion. In this article, we follow Moss and Danner’s work on the foundations of corecursion =-=[20]-=- and use the term corecursive program for a function whose range is a type defined as a greatest fixpoint, such as the type of infinite lists or streams. Dually, we use the term recursive program for ... |

4 | Algebraic speci of data types: a synthetic approach - Lehmann, Smyth - 1981 |

2 | Semantics of the domain of diagrams - Reynolds - 1977 |

1 | A very simple exercise - Dijkstra - 1982 |

1 | Proving the equality of in sequences - Dijkstra - 1991 |