From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA06443 for caml-red; Tue, 10 Oct 2000 14:04:53 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA25804; Mon, 9 Oct 2000 16:10:44 +0200 (MET DST) Received: from localhost.localdomain (adsl-216-158-26-151.cust.oldcity.dca.net [216.158.26.151]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e99EAhv12862; Mon, 9 Oct 2000 16:10:43 +0200 (MET DST) Received: from localhost.localdomain (IDENT:bcpierce@localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.9.3/8.9.3) with ESMTP id BAA14197; Mon, 9 Oct 2000 01:51:25 -0400 To: Pierre Weis cc: caml-list@pauillac.inria.fr Reply-to: bcpierce@cis.upenn.edu Subject: Re: WWW Page of Team PLClub (Re: ICFP programming contest: results) In-reply-to: Your message of Sat, 07 Oct 2000 10:35:21 +0200. <200010070835.KAA28303@pauillac.inria.fr> Date: Mon, 09 Oct 2000 01:51:25 -0400 Message-ID: <14194.971070685@localhost.localdomain> From: Benjamin Pierce Sender: weis@pauillac.inria.fr Fanning the fire on deBruijn indices... > - you have to manipulate indices anyway to mimmick alpha-conversion > when performing beta-reduction (the operation is named the ``lifting'' > of De Bruijn indices), and you know that this is at least as difficult > and error prone as performing alpha-renaming. As an example, consider > ... There's an important difference, though, in the ways that these errors show up: bugs in deBruijn-indexing schemes tend to manifest immediately and catastrophically -- if you miss a 'shift' everything quickly gets all screwed up and you can see that you did something wrong and fix it right away -- while name-based implementations of substitution tend to fail only six months later, when someone makes an unlucky choice of variable names. There's a story that a substitution bug in the original LCS theorem prover persisted for six *years* before anybody noticed... > - as a consequence of these two properties, debugging code that > manipulates and transforms lambda code in De Bruijn form is just a > nightmare (each time I had to do it, I ended by writing a > pretty-printer that reverts De Bruijn notation to good old names for > variables!) I usually do this too. The pretty-printer can also do a little consistency checking on the deBruijn indices: each variable is represented as a pair of its index and the expected size of the context; if the printing routine sees that the actual context does not have this size, it complains. One drawback of deBruijn indices that you did not mention is that, at least when implemented naively, they are pretty expensive in terms of the amount of consing that's required to perform substitutions. At the end of the day, I'm not that big a fan of *either* deBruijn or named presentations of terms... both are pretty ugly to work with, in different ways. In fact, I find both distressing and fascinating that, after so many years of thought by so many smart people, we're still in such an unsatisfactory state wrt. binding. B