From: William Lovas <wlovas@stwing.upenn.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Coinductive semantics
Date: Fri, 20 Jan 2006 13:59:15 -0500 [thread overview]
Message-ID: <20060120185911.GA22920@coruscant.stwing.upenn.edu> (raw)
In-Reply-To: <43D0B413.1060806@andrej.com>
On Fri, Jan 20, 2006 at 10:57:39AM +0100, Andrej Bauer wrote:
> William Lovas wrote:
> > A thought: products and sums are duals, classically, but not
> > intuitionistically.
>
> This is false. Products and sums are dual concepts, both classically and
> intuitionistically.
Perhaps you can explain this in more detail; my training is in type theory,
not category theory, and i had deMorgan duals in mind.
> > Since O'Caml lacks classical control constructs like
> > callcc, there's no redundancy having both products and sums: neither is
> > representable solely using the other.
>
> The above statement is rather vague and I am tempted to ignore it. If I
> try to interpet it the best I can, it looks as if William is confusing
> sums and products with unions and intersections (and is thus thinking
> that complements might help in representing sums as products, using laws
> of Boolean algebra).
It is well-known that control constructs like callcc correspond via
Curry-Howard to classical axioms like Peirce's law. I was referring to
the fact that in the presence of such control operators, one can devise a
sound and complete encoding of products in terms of sums or sums in terms
of products. For example, section 7 of Tom Murphy's 2005 CSL paper
"Distributed Control Flow with Classical Modal Logic" showed how to define
sums in terms of products using deMorgan duality and letcc.
Maybe what i mean when i say "product" and "sum" is something different
from what you mean? I *have* been thinking about deMorgan duality using
negation as you mentioned, but it's unrelated to union and intersection
types.
> > Also, O'Caml's datatypes are much more than just sums: they also include
> > recursive types, polymorphism, pattern matching, and a degree of
> > abstraction.
>
> So? What is the point here?
The point is that even if sums were encodable using products, the inclusion
of datatypes in O'Caml would not be redundant as skaller suggests, since
they bring with them access to several other important features whose
behavior would not otherwise be expressible.
> type person = Programmer of char | Mathematician of float
> [...]
> type person' = int * char * float
> [...]
> type person'' = int * t
These encodings do not have the same force as the original type; they are
complete, but unsound -- every value of person has a corresponding value in
person', but not every value of person' has a corresponding person value
(like (3, 'c', 0.0), for example). To do this sort of encoding correctly,
wouldn't you need dependent types in the language? So you could write
something like:
type person''' = Sigma x:bool. if x then char else float
with
Programmer(c) =def= (true, c)
Mathematician(x) =def= (false, x)
> where t is a type large enough to hold both char and float. This is
> precisely how people who use "lesser" languages work with sums, and
> precisely how sums are represented in compiled ocaml code (modulo
> optimizations). Of course, it does not provide a water-tight duality
> between products and sums at the level of datatypes, but a certain
> realizability construction gets you to a category (built on top of
> datatypes) in which the above trick is precisely how sums are
> constructed--all that is added as an aftertaught is the definition of
> the subobject of person' consisting of those triples whcich represent
> valid values of the corresponding sum type.
Perhaps this afterthought subobject is similar to what i'm referring to
above, but i don't know enough category theory to be certain.
cheers,
William
next prev parent reply other threads:[~2006-01-20 18:59 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
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 [this message]
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=20060120185911.GA22920@coruscant.stwing.upenn.edu \
--to=wlovas@stwing.upenn.edu \
--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