Return-Path: <kfoury@cs.bu.edu> Received: from cs.bu.edu (cs [128.197.12.2]) by cs3.bu.edu (8.12.11/8.12.11) with ESMTP id i8ONS6Z2004301; Fri, 24 Sep 2004 19:28:06 -0400 Received: from cs.bu.edu (h000c41248e2b.ne.client2.attbi.com [24.34.20.189]) (authenticated bits=0) by cs.bu.edu (8.12.2/8.12.2) with ESMTP id i8ONS68p002927; Fri, 24 Sep 2004 19:28:06 -0400 (EDT) Message-ID: <4154AD8D.7010202@cs.bu.edu> Date: Fri, 24 Sep 2004 19:28:13 -0400 From: Assaf Kfoury <kfoury@cs.bu.edu> Organization: Boston University User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en To: ashwin thangali <tvashwin@cs.bu.edu>, cs520@cs.bu.edu Subject: Re: question about Exercise 5.3.7 References: <Pine.SOL.4.20.0409232211080.18738-100000@csa.bu.edu> In-Reply-To: <Pine.SOL.4.20.0409232211080.18738-100000@csa.bu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-HitLevel: xx X-Spam-DCC: neonova: cs3.bu.edu 1127; Body=19 Fuz1=19 Fuz2=19 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on cs3.bu.edu X-Spam-Level: ** X-Spam-Status: No, hits=2.4 required=10.0 tests=AWL,RCVD_IN_DSBL, RCVD_IN_NJABL_PROXY autolearn=no version=2.64 X-Spam-Pyzor: Reported 0 times. Status: RO X-Mozilla-Status: 8011 X-Mozilla-Status2: 00000000 X-UIDL: 411f69ec00000bf3
For your question 1, a "stuck" term is a term that cannot be evaluated
further. But not every term that cannot be evaluated further is said to
be "stuck".
Put differently, the collection of terms that cannot be evaluated
further (i.e., the terms in "normal form") are divided into two groups:
(1) stuck terms and (2) values. Any normal-form term that is not
classified as a "value" is "stuck". So, it all depends on your
definition of "value".
For your question 2, the evaluation produces (c d) (a b) which is the
same as c d (a b) by the parenthesization conventions. To write c d a b,
which is equivalent to ((c d) a) b, is wrong.
Assaf
ashwin thangali wrote:
>asaf,
>
> probably a stupid question, does this mean that the propsed extension
>of lamdaNB should never get stuck and always result in "wrong" for
>incorrect programs? i ask this since in pure lamda calculus its not clear
>what stuck terms mean, there is no precise way to characterize stuck terms
>unlike in NB.
>
> my second question is, are parenthesis retained in evaluation of a
>lamda expression,
>
>for example does
>
> ( lambda x. lambda y. yx ) (ab)(cd)
>
>evaluate to (cd)(ab) OR cdab ?
>
> if the parenthesis are retained how to remove them? i.e how to convert
>"(cd) (ab)" into " cd (ab)" for example?
>
>ashwin
>
>Ashwin V. Thangali
>111 Cummington Street,MCS 263,
>Computer Science Dept,
>Boston University,
>Boston, MA 02215
>Office: 617 358 1139
>Home: 617 734 6209
>Homepage: http://cs-people.bu.edu/tvashwin
>
>
>
>On Thu, 23 Sep 2004, Assaf Kfoury wrote:
>
>
>
>>Kanishka Gupta wrote:
>>
>>
>>
>>>Prof. Kfoury,
>>>
>>>I have a question on Excercise 5.3.7. Whwn chaging the semantics to handle
>>>the run-time errors in lambdaNB, do we declare a run-time error whenever
>>>there is some mismatch (for example a lambda term in the guard of an
>>>if-then-else statement) OR do you want us to look further(for example if
>>>the lambda term in the guard of the if-then-else is the church boolean
>>>fls then execute the else part of the statement). The second part seems
>>>extremely hard to imlement and I am also not sure whether it is even
>>>correct to do soemething like this.
>>>
>>>Thanks.
>>>Kanishka
>>>
>>>
>>>
>>>
>>>
>>My recommendation: Before anything else, read Exercise 3.5.16 and its
>>solution in the book. Then, you will define the call-by-value
>>semantics, which in particular means you do not evaluate within the
>>scope of a lambda binding. The expression should evaluate to "wrong"
>>whenever there is a mismatch.
>>
>>Assaf
>>
>>
>>
>
>
>
This archive was generated by hypermail 2b29 : Fri Nov 19 2004 - 17:00:43 EST