From vaithan@hotmail.com Sat Nov 17 07:05:22 2001
Received: from hotmail.com (f16.law12.hotmail.com [64.4.19.16])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id fAH65Lt15866
	for <prolog@swi.psy.uva.nl>; Sat, 17 Nov 2001 07:05:22 +0100 (MET)
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Fri, 16 Nov 2001 22:05:15 -0800
Received: from 172.130.167.25 by lw12fd.law12.hotmail.msn.com with HTTP;
	Sat, 17 Nov 2001 06:05:12 GMT
X-Originating-IP: [172.130.167.25]
From: "Vaithan Param" <vaithan@hotmail.com>
To: prolog@swi.psy.uva.nl
Date: Sat, 17 Nov 2001 06:05:12 +0000
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Message-ID: <F16lqzUrIz8Ut65BVEp00002cbf@hotmail.com>
X-OriginalArrivalTime: 17 Nov 2001 06:05:15.0477 (UTC) FILETIME=[D3722850:01C16F2D]
Subject: [SWIPL] HELP : IMPLEMENTATION

I have a real hard time implementing  codes for these problems as I have 
just started working on prolog. Can anyone of u , figure it out for me ? 
Appreciate it.

allbutlast(X,L) if list X consists of all of list L except for its
last element.  allbutlast(X,[]) should fail.
Define allbutlast(X,L) (to find X given L).

allbutmaybelast(X,L) if X consists of all of list L except for its
last element if there is one.  (So allbutmaybelast([],[]) should
succeed).Define allbutmaybelast(X,L) (to find X given L).


threecopies(X,L) if list L consists of three copies of X appended
together.Define threecopies(X,L) (to find L given X).
For example the query threecopies([1,2],L) returns L=[1,2,1,2,1,2].

even(L) if list L has an even number of elements.
Define even(L).

threeappend(X,Y,Z,L)  if L is the result of appending the lists X,Y and
Z.Define threeappend(X,Y,Z,L).

Thanks a lot,


Vaithan

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

