RE: Prototype of cstrGen and unify

From: Rui Shi (shearer@cs.bu.edu)
Date: Fri Nov 24 2006 - 19:07:07 EST


Return-Path: <shearer@cs.bu.edu>
X-Spam-HitLevel: 
X-Spam-DCC: INFN-TO: cs3.bu.edu 1233; 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=-3.2 required=10.0 tests=ALL_TRUSTED,AWL,BAYES_00  autolearn=ham version=3.1.0
X-Spam-Pyzor: 
Received: from SHEARERSHOT (c-24-60-255-210.hsd1.ma.comcast.net [24.60.255.210]) (authenticated bits=0) by cs3.bu.edu (8.13.6/8.13.6) with ESMTP id kAP077BS014796; Fri, 24 Nov 2006 19:07:42 -0500
Message-Id: <200611250007.kAP077BS014796@cs3.bu.edu>
From: "Rui Shi" <shearer@cs.bu.edu>
To: "'Michel Machado'" <michel@digirati.com.br>
Cc: <cs520@cs.bu.edu>
Subject: RE: Prototype of cstrGen and unify
Date: Fri, 24 Nov 2006 19:07:07 -0500
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.5510
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
Thread-Index: AccQHThr7kkxd+UWQ866THwgxp7iYgABwP9Q
In-Reply-To: <014c01c7101d$25587a80$0cb6a8c0@dark>
X-Clamav-Status: No
Status: RO
Content-Length: 1155
X-UID: 60
X-Keywords:                                                                                                    


 

-----Original Message-----
From: Michel Machado [mailto:michel@digirati.com.br]
Sent: Friday, November 24, 2006 6:06 PM
To: cs520@cs.bu.edu
Subject: Prototype of cstrGen and unify

Hi Rui,

    Can we change the prototype of cstrGen and unify functions defined in
typecheck.ml?

    If not, how do you expect we handle the following problem? Let t be just
a variable (i.e. an open term), cstrGen can't apply CT-Var and its prototype
doesn't allow it returns just "None" because the return type is stp *
cstrset.

  - For this case, cstrGen returns a pair in which the first component is
simply a type variable. Then when you are trying to solve the constraints,
you find you can't find
    any substitution for that variable. Then it is a type error.

    Could you give an example or explanation about using TpVar and TpUni? I
don't feel I understand your intention.

  - TpVar is type variables generated during the type-inference. TpUni
stands for universal type variables which are simply place holders. TpUni
are useful when you are implementing let-polymorphism in the more efficient
way as stated in the second part of the assignment.

Rui



This archive was generated by hypermail 2b29 : Thu Dec 14 2006 - 16:31:59 EST