Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.kei.com!newshost.marcam.com!uunet!in1.uu.net!allegra!alice!pereira
From: pereira@alta.research.att.com (Fernando Pereira)
Subject: Re: symbolic global constants (not)
In-Reply-To: stevew@debretts.comp.vuw.ac.nz's message of 01 May 1995 12:37:13 GMT
X-Nntp-Posting-Host: alta.research.att.com
Message-ID: <PEREIRA.95May1133209@alta.research.att.com>
Sender: usenet@research.att.com (netnews <9149-80593> 0112740)
Reply-To: pereira@research.att.com
Organization: AT&T Bell Laboratories
References: <STEVEW.95Apr27234121@debretts.comp.vuw.ac.nz>
	<3nq7vp$ihl@goanna.cs.rmit.edu.au>
	<STEVEW.95Apr29211022@debretts.comp.vuw.ac.nz>
	<PEREIRA.95Apr29150358@alta.research.att.com>
	<3nvsju$ke6@st-james.comp.vuw.ac.nz>
	<PEREIRA.95Apr30120410@alta.research.att.com>
	<STEVEW.95May2003713@debretts.comp.vuw.ac.nz>
Date: Mon, 1 May 1995 17:32:09 GMT
Lines: 32

In article <STEVEW.95May2003713@debretts.comp.vuw.ac.nz> stevew@debretts.comp.vuw.ac.nz (Stephen Wray) writes:
   > were not typed. However, I disagree that adding typing to Prolog would
   > be a nightmare. 
   Sorry -- I meant that implementing type inference in propog *as it stands*
   would be a nightmare. Not prolog PLUS consistently typed lists et.al.
   > Around 15 years ago Alan Mycroft and Richard O'Keefe
   > designed and implemented a type system for Prolog based on parametric
   > polymorphism a la ML that works pretty well as a layer on top of
   > Prolog.
   Does it performs type inference?
   I can give it something of the form;

   foo(X,Y) :- Y is X + 1.

   and it will infer that X and Y are integers, and if I make a call thus;

   bar(Z,Q) :- foo(Z,Q).

   it will infer that Z and Q also must be integers?
   (a-la haskell)
I believe so. It uses a version of the Hindley-Milner type inference scheme,
best known from ML. Richard O'Keefe (ok@@goanna.cs.rmit.edu.au) often
contributes to this newsgroup, and will be able to tell you more.
--
Fernando Pereira
2B-441, AT&T Bell Laboratories
600 Mountain Ave, PO Box 636
Murray Hill, NJ 07974-0636
pereira@research.att.com
1-908-582-3980


