From leavens@larch.cs.iastate.edu Wed Sep 27 22:19:04 2006 Date: Wed, 27 Sep 2006 22:19:04 -0500 (CDT) From: Gary T. Leavens To: Steve Shaner Subject: Re: CS 342: HW5/RSS discrepancy Hi Steve, On Wed, 27 Sep 2006, Steve Shaner wrote: > I just noticed that hw5.txt says problems 1-3 & 6 are due on Oct. 3rd, > whereas the RSS feed says just problems 1-3 for that day. Which of > these is correct? Thanks for noticing that. The homework is correct. I'm fixing the RSS file. :-) Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ------------------------------ From smshaner@iastate.edu Fri Sep 29 13:28:23 2006 Date: Fri, 29 Sep 2006 13:28:23 -0500 From: Steve Shaner To: CS 342 students Cc: Dr. Gary Leavens Subject: CS 342: lexical-address correction Yesterday in lecture, we defined the lexical address of a varref V to be the coordinates lexical-address(V) = (d p), where d is the lexical depth of the varref, and p is the zero-indexed position of the *varref* within its contour Upon referring to the text, I've found this definition to be in error. Particularly, the definition of p should read: p is the zero-indexed position *of the declaration* within its declaring lambda So, within the 1-argument lambda calculus we were using in class, all lexical addresses would have position zero. If a lambda allowed declaring multiple variables (as in Scheme), we could see a larger range of position values. An annotated example, where varrefs are labeled with their lexical addresses: (lambda (a b) (lambda (x) ((a : 1 0) (lambda (x) ((x : 0 0) (b : 2 1))) ) (x : 0 0)))) which means for the expression (lambda (a b) (lambda (x) (a (lambda (x) (x b)) x))) The lexical addresses for the varrefs in the third line, going from left to right, are: lexical-address(a) = (1 0) lexical-address(x) for the x in "(x b)" = (0 0) lexical-address(b) = (2 1) lexical-address(x) for the x just before the closing parentheses = (0 0) Even though both x's have the same lexical address, they point to different declarations of x because they fall in contours that bind them to different scopes. If this example seems unclear, draw the contours & arrows for the unannotated expression and compute region, scope & lexical-depth as we did in lecture. -Steve Shaner ------------------------------ From leavens@larch.cs.iastate.edu Sun Oct 1 12:34:36 2006 Date: Sun, 1 Oct 2006 12:34:36 -0500 (CDT) From: Gary T. Leavens To: Michael Roberts Cc: Steve Shaner Subject: Re: HW5 problem 1 Hi Michael, On Sun, 1 Oct 2006, Michael Roberts wrote: > I'm not quite sure what part b of problem one is asking for. Am I just > supposed to use the observers to get a y out of the expressions defined in > part a? Yes, but it has to be the varref y, not just any symbol y. > I've attached my interactions and definitions so you can see if I've > got the right idea. Yes, although I didn't look at the details. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 --------------------------------- From leavens@larch.cs.iastate.edu Mon Oct 2 15:55:48 2006 Date: Mon, 2 Oct 2006 15:55:48 -0500 (CDT) From: Gary T. Leavens To: Adam Weber Cc: Steve Shaner Subject: Re: Hw5 problem 1 Hi Adam, On Mon, 2 Oct 2006, Adam Weber wrote: > I am not sure if I completely understand what is wanted in part a or b of > question 1. Clarification would be appreciated. What is meant by transcript? By a "transcript" I just mean a printout of the contents of the interactions window in DrScheme. You can save it to a file and then print it or print directly from DrScheme. Both of these are items in the "File" menu. Is there anything else about that problem you want clarified? Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 -----------------------------