Return-Path: <michel@digirati.com.br> X-Spam-HitLevel: X-Spam-DCC: sonic.net: cs3.bu.edu 1156; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on cs3.bu.edu X-Spam-Level: X-Spam-Status: No, score=-2.6 required=10.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Pyzor: Received: from mta4.k8.com.br (mta4.k8.com.br [200.185.109.104]) by cs3.bu.edu (8.13.6/8.13.6) with ESMTP id k9NDlxS4025103; Mon, 23 Oct 2006 09:48:10 -0400 Received: from localhost (localhost [127.0.0.1]) by smtpa.k8.com.br (Postfix) with ESMTP id 86E933000196; Mon, 23 Oct 2006 10:47:58 -0300 (BRT) Received: from smtpa.k8.com.br ([127.0.0.1]) by localhost (mta4.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25657-01-9; Mon, 23 Oct 2006 10:47:58 -0300 (BRT) Received: from dark (c-71-232-158-11.hsd1.ma.comcast.net [71.232.158.11]) by smtpa.k8.com.br (Postfix) with ESMTP id 80BB030001C8; Mon, 23 Oct 2006 10:47:55 -0300 (BRT) Message-ID: <005a01c6f6a9$e26566c0$24b6a8c0@dark> From: "Michel Machado" <michel@digirati.com.br> To: "Assaf Kfoury" <kfoury@cs.bu.edu> Cc: <cs520@cs.bu.edu> References: <006d01c6f60a$c534b730$16b6a8c0@dark> <453C4202.7060309@cs.bu.edu> Subject: Re: Well-typed => closed Date: Mon, 23 Oct 2006 09:48:06 -0400 Organization: Digirati Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Virus-Scanned: amavisd-new at k8.com.br X-Clamav-Status: No Status: RO Content-Length: 2564 X-UID: 27 X-Keywords:
Hi Assaf,
Thank you. I was struggling with that because I've thought that stuck
terms like (x true) wouldn't be well-typed. So, the idea that "well-typed
programs never goes wrong" implicitly means that a program is closed term.
I've not taken that for granted because the error message "Unbound value" is
common in a language with this static check, and terrible in many script
languages because they only come out in run time.
[ ]'s
Michel Machado
----- Original Message -----
From: "Assaf Kfoury" <kfoury@cs.bu.edu>
To: "Michel Machado" <michel@digirati.com.br>
Cc: <cs520@cs.bu.edu>
Sent: Monday, October 23, 2006 12:16 AM
Subject: Re: Well-typed => closed
> Michel,
>
> I respond to each of your questions in turn, and send a cc to the class
> list for the benefit of everyone.
>
> (1) Yes, a well-typed term does not have to be closed. An example of a
> well-typed term which is not closed is (x true). "Well-typed" means there
> is a typing derivation for the term, and here is one for the preceding
> term:
>
> (a) x : Bool -> Nat |- x : Bool -> Nat
> (b) x : Bool -> Nat |- true : Bool
> (c) x : Bool -> Nat |- (x true) : Nat
>
> where (c) is obtained from (a) and (b) as premises, using the rule (T-App)
> in Figure 9-1.
>
> (2) The Progress Theorem requires the term to be closed because its
> conclusion states that if the term is either a value or can be evaluated
> one step further. If the term is *not* closed, this conclusion may fail.
> An example is provided by the term (x true) above, which is not a value
> *and* cannot be evaluated further.
>
> (3) Yes, you are right in saying that (x true) is not well-typed from the
> empty context. But (x true) is nevertheless well-typed, which means there
> exists at least one typing context Gamma together with a type T such that
> the judgement
>
> Gamma |- (x true) : T
>
> is derivable. A particular case of such a Gamma and T is given in (1)
> above.
>
> I think I answered all your questions.
>
> Assaf
>
> Michel Machado wrote:
>
>> Hi Assaf,
>>
>> The hypothesis of the progress theorem (section 9.3.5, pag 109 in
>> Pierce, or page 7 in handout 7), asks for a term t to be closed and
>> well-typed. Can a well-typed term be not closed? In other words, if t is
>> well-typed, t is closed. If so, why is t asked to be closed?
>>
>> The handout points the progress theorem fails if t is not closed, and
>> give the term (x true) as an example. However, that term isn't well-typed
>> from an empty context.
>>
>> [ ]'s
>> Michel Machado
>
>
>
This archive was generated by hypermail 2b29 : Thu Dec 14 2006 - 16:31:59 EST