Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RE: [Caml-list] Coinductive semantics
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Don Syme <Don.Syme@m...>
Subject: RE: [Caml-list] Coinductive semantics

I find it helpful to think of induction as simply a process of
"repeatedly adding new members to a set according to a set of rules",
and co-induction as a process of "repeatedly taking away members from a
set according to what's excluded by a set of rules, and seeing what's

For example, divergence is defined by repeatedly taking away the
convergent programs from the set of all programs.

To take a very non-serious example, think of the rules that parents lay
down for their children (which are often recursively referential, let
alone contradictory :-)).  Induction corresponds to "you may only do
what follows from the rules", whereas co-induction corresponds to "you
may do anything that is not excluded by the rules".  For an empty set of
rules an inductive child can do nothing, a co-inductive child can do

This all shows my unfashionable set-theoretic biases :-)


-----Original Message-----
[] On Behalf Of David Baelde
Sent: 05 January 2006 20:48
To: Alessandro Baretta
Cc: Ocaml
Subject: Re: [Caml-list] Coinductive semantics

In short,

An inductive type is the least fixpoint of some equations. The
coinductive type is the greatest fixpoint. For "t = nil | cons of
e*t", the elements of the inductive type are the lists, but the
coinductive type also contains the infinite lists.

Now for induction and coinduction, not so easy to tell... The
induction is the process building inductive types, the coinduction
builds coinductive types. In theory, the induction always terminates
and build a finite object. The coinduction should be seen as a lazy
process, since it potentially builds an infinite object: running it
builds the beginning of the object, then the process freezes and waits
for you to inspect the object deep enough.

Hope this helps... at least that's a try.

Caml-list mailing list. Subscription management:
Beginner's list:
Bug reports: