Re: Well-typed => closed

From: Assaf Kfoury (kfoury@cs.bu.edu)
Date: Mon Oct 23 2006 - 00:16:02 EDT


Return-Path: <kfoury@cs.bu.edu>
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=-4.4 required=10.0 tests=ALL_TRUSTED,AWL,BAYES_00  autolearn=ham version=3.1.0
X-Spam-Pyzor: 
Received: from [76.19.13.75] ([76.19.13.75]) (authenticated bits=0) by cs3.bu.edu (8.13.6/8.13.6) with ESMTP id k9N4FkTG020877; Mon, 23 Oct 2006 00:15:56 -0400
Message-ID: <453C4202.7060309@cs.bu.edu>
Date: Mon, 23 Oct 2006 00:16:02 -0400
From: Assaf Kfoury <kfoury@cs.bu.edu>
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
X-Accept-Language: en-us, en
To: Michel Machado <michel@digirati.com.br>
CC: cs520@cs.bu.edu
Subject: Re: Well-typed => closed
References: <006d01c6f60a$c534b730$16b6a8c0@dark>
In-Reply-To: <006d01c6f60a$c534b730$16b6a8c0@dark>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Clamav-Status: No
Status: RO
Content-Length: 1803
X-UID: 25
X-Keywords:                                                                                                    

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