From: Gerard Huet <Gerard.Huet@inria.fr>
To: sumii@saul.cis.upenn.edu
Cc: caml-list@inria.fr
Subject: Re: de Bruijn indices
Date: Tue, 10 Oct 2000 16:04:54 +0200 [thread overview]
Message-ID: <200010101406.e9AE6Fj22755@concorde.inria.fr> (raw)
In-Reply-To: <20001009031955T.sumii@saul.cis.upenn.edu>
In defense of de Bruijn indices :
1. They lead to efficient implementations. My original implementation of
the constructive engine in Coq's early versions used de Bruijn indices, and
performed reasonably well. It leads to a completely applicative
implementation of lambda-calculus, and the cost of lifting may be reduced
by Okasaki-like data structures. I still remember the day when this
super-hacker declared that he was going to replace all this inefficient
stuff by slick hashtables - only to undo everything 2 months later because
he was 30% slower.
2. The apparent complexity of lifting is to my view an inherent complexity
of substitution, which you have better face up rather than put under the
rug of name management of symbol tables, for which you will have to pay the
price in unexpected places. And when the going gets rough, at least your DB
indices behave well in natural recursions. When I set to understand fully
Bohm's theorem, down to programming a running Bohm discriminator, I used DB
indices, which generalise well to Bohm trees (ie potentially infinite
lambda-terms). I do not think I would have succeded in programming this
stuff without this explicit and concrete control on variable references.
And I could even publish the code itself, which is available as commented
Caml code in the paper:
G. Huet An Analysis of Bohm's theorem, Theoretical Computer Science 121
(1993) 145-167.
3. You can do proofs by induction on the corresponding structure, and thus
prove meta-theoretical results in a direct and clean way. You can even hope
to actually mechanise the formal development. See for instance:
G. Huet "Residual theory in lambda calculus: a formal development". J.
Functional programming 4,3 (1994) 371-394.
where a fair portion of the syntactic theory of beta-reduction is done
completely formally, using DB indices again.
Gérard
next prev parent reply other threads:[~2000-10-10 17:04 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-05 10:33 WWW Page of Team PLClub (Re: ICFP programming contest: results) David McClain
2000-10-05 20:20 ` Stefan Monnier
2000-10-06 19:26 ` eijiro_sumii
2000-10-07 8:19 ` automatic translation in Team PLClub ICFP'2000 entry Julian Assange
2000-10-07 16:30 ` eijiro_sumii
2000-10-06 8:07 ` WWW Page of Team PLClub (Re: ICFP programming contest: results) Xavier Leroy
2000-10-07 8:35 ` Pierre Weis
2000-10-07 9:55 ` Markus Mottl
2000-10-07 10:24 ` Pierre Weis
2000-10-08 21:26 ` John Max Skaller
2000-10-10 10:23 ` Pierre Weis
2000-10-09 5:51 ` Benjamin Pierce
2000-10-09 7:19 ` de Bruijn indices (Re: WWW Page of Team PLClub) Eijiro Sumii
2000-10-10 10:36 ` Pierre Weis
2000-10-10 14:04 ` Gerard Huet [this message]
2000-10-10 17:29 ` de Bruijn indices 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
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-10 18:30 John R Harrison
2000-10-11 11:26 Simon Peyton-Jones
2000-10-11 20:12 ` Markus Mottl
2000-10-12 17:33 Greg Morrisett
2000-10-12 19:09 John R Harrison
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=200010101406.e9AE6Fj22755@concorde.inria.fr \
--to=gerard.huet@inria.fr \
--cc=caml-list@inria.fr \
--cc=sumii@saul.cis.upenn.edu \
/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