Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!cs.utexas.edu!utnut!nott!cunews!freenet.carleton.ca!FreeNet.Carleton.CA!ai120
From: ai120@FreeNet.Carleton.CA (Michael Chung)
Subject: help needed again
Message-ID: <CyLHrv.6F5@freenet.carleton.ca>
Sender: news@freenet.carleton.ca (Usenet News Admin)
Reply-To: ai120@FreeNet.Carleton.CA (Michael Chung)
Organization: The National Capital FreeNet
Date: Tue, 1 Nov 1994 15:31:06 GMT
Lines: 19


I forgot to give some examples.

Here they are :

?- height([],Y).                                        Y = 1
 
?- height([a, [d], [c,[f]], [a,[b,c,[d,[f]]]]]], Y).    Y = 5

and the question is :

>  Can someone tell me how to define a predicate height(X,Y) which
>  returns the maximum number,Y, of nested lists in X. X could be
>  a multi-level list.

Can someone help me out (again) ?

--

