samth/test-bugs — Issue #77: Variable capture in stepper's substitution
Author: racket-bug-submit
Created: 2012-03-07 19:38:36+00:00
State: open
Labels: anon-submit, enhancement, gnats-migrated, stepper

###### Originally submitted on: Wed Oct 31 14:20:02 -0400 2007

When substituting a lambda term M into the body of another lambda term N, the stepper doesn't alpha-rename to avoid capturing free variables in M.

##### Steps to Reproduce:

Stepping the program

(define x 42)

(define f
(lambda (g)
(lambda (x)
(g x))))

((f (lambda (y) x)) 0)

reaches the term

(((lambda (g)
(lambda (x) (g x)))
(lambda (y) x))
0)

which the stepper reduces to

((lambda (x)
((lambda (y) x) x))
0)

capturing the free occurence of x.

##### Release:

371.3-svn31oct2007

##### Environment:

unix "Linux radius.cs.uchicago.edu 2.6.18-5-686-bigmem #1 SMP Sun Aug 12 23:05:22 UTC 2007 i686 GNU/Linux" (i386-linux/3m) (get-display-depth) = 16
Docs Installed:
(("/var/tmp/plt/share/plt/doc" "r5rs" "mzscheme" "mred" "help" "tour" "drscheme" "srfi" "mzlib" "misclib" "mrlib" "framework" "foreign" "mzc" "tools" "insidemz" "web-server" "swindle" "plot" "gui" "guide" "quick" "reference" "release-notes" "scribble" "t-y-scheme" "tex2page" "beginning" "beginning-abbr" "intermediate" "intermediate-lambda" "advanced" "teachpack" "teachpack-htdc" "profj-beginner" "profj-intermediate" "profj-intermediate-access" "profj-advanced"))
Human Language: english
(current-memory-use) 95969284

Collections:
(("/home/clklein/.plt-scheme/371.3/collects" non-existent-path) ("/var/tmp/plt/lib/plt/collects" "afm" "big" "ffi" "net" "sgl" "xml" "eopl" "help" "htdp" "html" "lang" "lazy" "make" "r5rs" "mred" "plot" "srfi" "wxme" "framework" "teachpack" "handin-client" "mzscheme" "games" "icons" "htdch" "mrlib" "mzcom" "mzlib" "graphics" "profj" "setup" "tests" "trace" "xelda" "combinator-parser" "waterworld" "preprocessor" "sirmail" "test-box-recovery" "skipper" "handin-server" "tex2page" "texpict" "scribblings" "profjWizard" "stepper" "scribble" "web-server" "config" "compiler" "swindle" "dynext" "hierlist" "macro-debugger" "frtime" "defaults" "guibuilder" "drscheme" "syntax-color" "mrflow" "srpersist" "mztake" "planet" "mysterx" "errortrace" "slatex" "syntax" "version" "algol60" "honu-module" "parser-tools" "openssl" "embedded-gui" "slideshow" "repos-time-stamp" "info-domain" "readline" "launcher" "string-constants" "browser"))
Computer Language: (("Teaching Languages" "How to Design Programs" "Intermediate Student with lambda") (#6(#t quasiquote repeating-decimal #f #t none) #f ()))

###### This bug was converted from Gnats bug [9030](http://bugs.racket-lang.org/query/?cmd=view&pr=9030).

[anon-submit clklein AT cs.uchicago.edu]