From: "Francisco J. Valverde Albacete" <fva@tsc.uc3m.es>
To: Andrej Bauer <Andrej.Bauer@andrej.com>
Cc: Alessandro Baretta <a.baretta@barettadeit.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Coinductive semantics
Date: Tue, 10 Jan 2006 12:10:53 +0100 [thread overview]
Message-ID: <43C3963D.5030601@tsc.uc3m.es> (raw)
In-Reply-To: <43BE6CAB.2030503@andrej.com>
Hi
although I may be out on a limb here, I recall reading *somewhere* :(
that while initial algebras where good models for stateless abstract
data types (and (structural) induction the way to work over terms in the
free algebra defined by constructors modulo the laws of the ADT), final
algebras where good models for *stateful* datatypes (and coinduction the
way to work over the finer "state descriptors" modulo the laws of state
equivalence), hence they *might* be better models for *objects* (as
stateful datatypes) than initial algebras.
Has anybody read anything proving or disproving this?
Regards,
Francisco Valverde - DTSC
Univ. Carlos III de Madrid
Andrej Bauer wrote:
>Alessandro Baretta wrote:
>
>
>>Is there anyone around who can help?
>>
>>
>
>Induction is about initial algebras. It says that an initial algebra
>does not have any non-trivial SUB-algebras. General induction principle
>for the initial algebra A with operations f_1, ..., f_n (some of which
>may be 0-ary operations, i.e., constants) goes as follows:
>
>INDUCTION PRINCIPLE:
>Suppose S is a subset of A which is closed under operations f_i, meaning
>that if x_1, ..., x_{k_i} are in S then also f_i(x_1, ..., x_{k_i}) is
>in S (here k is the arity of operation f_i). Then S = A.
>
>If we apply this to the case when we have one constant f_0=Empty and one
>binary operation f_1=Tree, we get as A all finite binary trees and the
>induction principle:
>
>INDUCTION PRINCIPLE FOR FINITE BINARY TREES:
>Suppose S is a set of finite binary trees such that the empty tree is in
>S, and whenever x and y are in S then also tree Tree(x,y) is in S. Then
>S is the set of all finite binary trees.
>
>Now coinduction is about final coalgebras. It says that a final
>coalgebra does not have any non-trivial QUOTIENT coaglebras. This is
>usually expressed as follows: if F is the final coalgebra for operations
>f_1, ..., f_n, and E is an equivalence relation on F which respects the
>operations, then E is the identity relation (because if it were not, we
>could form a nontrivial quotient coaglebra F/E). The actual coinduction
>principle may be stated for an arbitrary relation R (think of E as the
>equivalence relation generated by R):
>
>COINDUCTION PRINCIPLE:
>Suppose R is a relation on the final coalgebra F which respects the
>operations, i.e., if x_1 R y_1, ...., x_{k_i} R y_{k_i} then
>f_i(x_1, ..., x_{k_i}) R f_i(y_1, ..., y_{k_i}) for all x's, y's and
>f_i's. Then R(x,y) implies x = y.
>
>An R satisfying the above condition generates the trivial equivalence
>relation (equality) and so the quotient F/R is just F.
>
>We take again as example the final coalgebra F with one constant
>f_0=Empty and one binary operation f_1=Tree. This is the set of finite
>and infinite binary trees.
>
>COINDUCTION FOR (FINITE AND INFINITE) BINARY TREES:
>Suppose R is a relation on trees such that:
>(1) Empty R Empty
>(2) if x R y and x' R y' then Tree(x,y) R Tree(x',y').
>Then x R y implies x = y.
>
>It takes some practice to get used to coinduction and to figure out how
>to prove properties of final coalgebras with it. If this was too terse,
>let me know (and tell me which bits to expand upon).
>
>Andrej
>
>_______________________________________________
>Caml-list mailing list. Subscription management:
>http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>Archives: http://caml.inria.fr
>Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>
next prev parent reply other threads:[~2006-01-10 11:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-05 18:23 Alessandro Baretta
2006-01-05 19:48 ` [Caml-list] " David Baelde
2006-01-06 13:12 ` Andrej Bauer
2006-01-10 11:10 ` Francisco J. Valverde Albacete [this message]
2006-01-11 8:34 ` Hendrik Tews
2006-01-11 12:19 ` skaller
2006-01-11 14:54 ` Andrej Bauer
2006-01-12 2:10 ` skaller
2006-01-12 14:03 ` Andrej Bauer
2006-01-12 21:54 ` skaller
2006-01-13 10:23 ` Hendrik Tews
2006-01-13 14:42 ` skaller
2006-01-18 12:58 ` Hendrik Tews
2006-01-18 14:22 ` skaller
2006-01-20 0:49 ` William Lovas
2006-01-20 9:57 ` Andrej Bauer
2006-01-20 18:59 ` William Lovas
2006-01-20 20:59 ` skaller
2006-01-21 18:36 ` Andrej Bauer
2006-01-22 3:16 ` skaller
2006-01-22 12:23 ` Andrej Bauer
2006-01-22 15:35 ` skaller
2006-01-22 17:26 ` Kenn Knowles
2006-01-22 21:52 ` Andrej Bauer
2006-01-21 19:06 ` Andrej Bauer
2006-01-13 10:40 ` Andrej Bauer
[not found] ` <43C7B17A.1070503@barettadeit.com>
2006-01-14 16:53 ` Andrej Bauer
2006-01-05 20:38 Don Syme
2006-01-06 15:33 ` Alessandro Baretta
2006-01-08 10:02 ` Andrej Bauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43C3963D.5030601@tsc.uc3m.es \
--to=fva@tsc.uc3m.es \
--cc=Andrej.Bauer@andrej.com \
--cc=a.baretta@barettadeit.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox