From: Greg Morrisett <jgm@cs.cornell.edu>
To: "'Chet Murthy'" <chet@watson.ibm.com>
Cc: caml-list@inria.fr
Subject: RE: de Bruijn indices
Date: Thu, 12 Oct 2000 13:33:23 -0400 [thread overview]
Message-ID: <706871B20764CD449DB0E8E3D81C4D43BFCA51@opus.cs.cornell.edu> (raw)
> It wasn't the substitution that was killing me, but the
> alpha-conversion, and checks for alpa-conversion.
But alpha-conversion is a form of substitution...
> Now, there _is_ possibly one way of doing explicit names that would be
> fast enough to be a contender -- where the names are chosen uniquely,
> using a global counter, so no capture check is required. I can
> imagine that that would be fast.
>
> Of course, it would result in uggggggly names -- uglier than deBruijn
> numbers, unless similar tricks were played in pretty-printing.
This is essentially what we did in TAL -- each variable had
a string-based name and a number field. Numbers defaulted
to zero (and weren't printed). When we needed to alpha-convert
something, we incremented a global counter and used this for
the new number (keeping the string the same.) You do end
up with foo_12349 this way, but only if something has to be
alpha-converted -- and that turned out to be pretty rare.
Again, I haven't re-implemented things with De Bruijn, and
would like too. It may be that TAL would run faster with
a well-implemented scheme.
Two side notes:
1. The reason I can't easily re-implement TAL using de Bruijn
instead of explicit names, is that I exposed my term datatypes
to make pattern matching easy. If I'd been coding in something
like Java, I suspect I would've abstracted terms enough that
re-writing the code would've been easier. One problem with
ML is that the convenience of pattern matching tends to direct
you (or at least me) to expose too much representation information.
Abstract patterns would help a lot...
2. I seem to recall that there are subtle issues with
typed calculi (especially dependently-typed calculi) and
de Bruijn? Certainly explicit substitutions are tricky
in this setting...
-Greg
next reply other threads:[~2000-10-13 11:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-12 17:33 Greg Morrisett [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-10-12 19:09 John R Harrison
2000-10-11 11:26 Simon Peyton-Jones
2000-10-11 20:12 ` Markus Mottl
2000-10-10 18:30 John R Harrison
2000-10-10 18:09 Greg Morrisett
2000-10-12 14:57 ` Chet Murthy
2000-10-12 18:08 ` Benjamin C. Pierce
2000-10-12 18:19 ` Trevor Jim
2000-10-09 7:19 de Bruijn indices (Re: WWW Page of Team PLClub) Eijiro Sumii
2000-10-10 14:04 ` de Bruijn indices Gerard Huet
2000-10-10 17:29 ` Chet Murthy
2000-10-11 22:35 ` John Max Skaller
2000-10-05 23:29 Patrick M Doane
2000-10-06 8:15 ` Markus Mottl
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=706871B20764CD449DB0E8E3D81C4D43BFCA51@opus.cs.cornell.edu \
--to=jgm@cs.cornell.edu \
--cc=caml-list@inria.fr \
--cc=chet@watson.ibm.com \
/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