Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!Germany.EU.net!Munich.Germany.EU.net!ecrc!news
From: joachim@ecrc.de (Joachim Schimpf)
Subject: Re: Mode inference for Prolog programs
Message-ID: <D7E5v3.Luq@ecrc.de>
Sender: news@ecrc.de
Reply-To: joachim@ecrc.de
Organization: European Computer-Industry Research Centre GmbH, Munich, Germany
References: <ZHAO.95Apr16150508@mitsuze.csce.kyushu-u.ac.jp>
Date: Fri, 21 Apr 1995 15:33:01 GMT
Lines: 46

In article 95Apr16150508@mitsuze.csce.kyushu-u.ac.jp, zhao@mitsuze.csce.kyushu-u.ac.jp (Jianjun ZHAO) writes:
>
>Given a Prolog program:
>
>p(X,Y):-q(X,Z),r(Z,Y).
>q(a,_).
>r(b,b).
>
>and the mode <input,output> for p, I would like to know the modes of
>other literals, i.e., q(X,Z), r(Z,Y), q(a,_), and r(a,b) in the
>program. 


If you have ECLiPSe, you can use its mode analysis library:

[eclipse 1]: use_module(library(modes)).
...

yes.
[eclipse 2]: read_source(example).
reading example

yes.
[eclipse 3]: analyze(p(++,-)).

% Analysed 3 call patterns of 3 predicates in 0.01 sec
% Number of pending goals: 16
% Global Stack used:       9376
:- mode p(++, -).
:- mode q(++, -).
:- mode r(-, -).

yes.


-- Joachim

---------------------------------------------------------------------------
 ECLiPSe WWW pages:		http://www.ecrc.de/eclipse/eclipse.html
 ECLiPSe FTP site:		ftp.ecrc.de  (141.1.1.1)  /eclipse
 User group mailing list contributions:		eclipse_users@ecrc.de
 Orders and mailing list administration:	eclipse_request@ecrc.de
 ECLiPSe development team:			eclipse@ecrc.de
 Bug reports:					eclipse_bugs@ecrc.de


