POV-Ray : Newsgroups : povray.off-topic : Somehow I always think of Andrew : Re: Somehow I always think of Andrew Server Time
5 Sep 2024 15:26:37 EDT (-0400)
  Re: Somehow I always think of Andrew  
From: Orchid XP v8
Date: 21 Jun 2009 15:40:22
Message: <4a3e8ca6$1@news.povray.org>
>> In a stunning turn of events, I was just in the middle of having a 
>> conversation about whether assigning unique indicies to every variable 
>> in a Lambda expression enables its reduction sequence to be computed 
>> without name clashes. :-P
>
> There is alpha conversion to prevent that, but I guess you are talking 
> about an implementation not the theory. ;)

Indeed. It's significantly less trivial than you'd imagine... o_O

> I seem to remember that labelling just with the level of the nesting is 
> enough.

That would be de Bruijn indices. And I'm hoping to avoid needing to go 
that far... (But we'll see!)

> If you have unique identifiers throughout your program, that 
> certainly works.

Ah, but wait. Simply renaming all the variables before you start is 
insufficient. Unfortunately.

   (\x -> x x) (\y -> y)

Make 'em all unique:

   (\x1 -> x1 x1) (\y2 -> y2)

Now beta-reduce:

   (\y2 -> y2) (\y2 -> y2)

Oh noes! No longer unique...

(In this instance it doesn't matter, but somebody showed me a slightly 
more complicated example where it actually goes wrong.)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.