caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Judicael Courant <Judicael.Courant@lri.fr>
To: caml-list@inria.fr
Cc: Dave Berry <Dave@kal.com>, Xavier Leroy <Xavier.Leroy@inria.fr>,
	Andreas Rossberg <rossberg@ps.uni-sb.de>,
	Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
Subject: Re: [Caml-list] Caml 3.01 : pb with include
Date: Wed, 21 Mar 2001 17:15:56 +0100	[thread overview]
Message-ID: <3AB8D3BC.7C386F88@lri.fr> (raw)
In-Reply-To: <DD7356599083414BA450E3DCC4119B8B040EB8@NT.kal.com>

Hi,

I realized I missed an interesting discussion some time ago,
so I am adding a small comment now.

IMHO, the "with module" is a useful notion, but its current theoretical
interpretation is the wrong one: for instance when I write

module X = struct type t = int let compare x y = x-y end
module Y = struct type t = int let compare x y = y-x end

I would not like X and Y to be considered equal.

The problem with this comes from the status of equality of type 
expressions in a modular settings. The often cited paper of Harper,
Mitchell and Moggi about the phase distinction has IMHO been
misinterpreted as the fact that the equality should be extensionnal,
that is F(X).t and F(Y).t should be equal as soon as the types defined
in X and the types defined in Y are equal.

The previous condition indeed ensures that at run time F(X).t and F(Y).t
are equal but it is not restrictive enough: roughly, this is saying that
equality over modules is extensionnal whereas
what the developper need is an intentionnal equality (i.e. if I define
two modules X and Y, my intention is that are different, even if they
define the same types).

Consider the previous example with F = Map.Make. You certainly do not
want F(X).t and F(Y).t to be considered equal by the type-checker! And
in fact, in O'Caml, they are incompatible as the comparison of types
mixes intentionality and extentionality.
That stamp-based generative semantics was also a way to ensure that
F(X).t and F(Y).t are not considered equal by the type-checker.

I proposed a module system (called MC for "module calculus") in my
thesis in which equality is intentional. The semantics of module
equality is precisely defined --- although the thesis itself has been
said hard to read. BTW, Christophe Raffali's example seems to be correct
in MC.

The problem with MC is that, although useful on proof languages (in
which you can strongly normalize expression), it is probably of little
use on Turing-complete programming languages (as you can not decide the
equality of arbitrary expressions). However, I plan to design another
system, tailored for programming languages that would not have this
limitation (maybe soon at a Cristal-LogiCal-Moscova seminar ?). Stay
tuned...

Judicaël.
-- 
Judicael.Courant@lri.fr, http://www.lri.fr/~jcourant/
(+33) (0)1 69 15 64 85
"Montre moi des morceaux de ton monde, et je te montrerai le mien"
Tim, matricule #929, condamné à mort.
http://rozenn.picard.free.fr/tim.html
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-03-21 16:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-21 13:25 Dave Berry
2001-03-21 16:15 ` Judicael Courant [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-23 12:02 Dave Berry
2001-03-27  9:19 ` Judicael Courant
2001-03-11  5:04 [Caml-list] Camlp4 3.01 released Daniel de Rauglaudre
2001-03-12 11:52 ` [Caml-list] Caml 3.01 : pb with include Christophe Raffalli
2001-03-12 17:13   ` Andreas Rossberg
2001-03-13 10:32     ` Xavier Leroy
2001-03-13 11:18       ` Andreas Rossberg
2001-03-13 11:23       ` Christophe Raffalli

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=3AB8D3BC.7C386F88@lri.fr \
    --to=judicael.courant@lri.fr \
    --cc=Christophe.Raffalli@univ-savoie.fr \
    --cc=Dave@kal.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=rossberg@ps.uni-sb.de \
    /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;
as well as URLs for NNTP newsgroup(s).