From diving@nehp.net  Tue Mar 28 05:15:41 2000
Received: from atl3.america.net (atl3.america.net [199.170.121.5])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id FAA01540
	for <prolog@swi.psy.uva.nl>; Tue, 28 Mar 2000 05:15:40 +0200 (MET DST)
Received: from pavilion (dialup-216-180-12-86.nehp.net [216.180.12.86])
	by atl3.america.net (8.9.1/8.9.1) with SMTP id WAA00479
	for <prolog@swi.psy.uva.nl>; Mon, 27 Mar 2000 22:15:50 -0500 (EST)
Message-Id: <3.0.6.32.20000327212221.00830610@mail.nehp.net>
X-Sender: diving@mail.nehp.net
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Mon, 27 Mar 2000 21:22:21 -0600
To: prolog@swi.psy.uva.nl
From: Ada Winters <diving@nehp.net>
Subject: Prolog examples
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

Dear Sirs,
I need help with the following programs:
1.  Write a predicate dislay_list with arity 1 to display an entire list
w/o any user prompts where each list element appears on a spearate line
with its sequence number and it works for the empty list.

2.  Write a predicate tohead with arity 3 that will move an element to the
head of a list:
tohead( c, [a, b, c, d], X ).
X = [c, a, b, d]
tohead (c, [x, y, z], X ).
no

3.  Write a Prolog predicate has_no_intersection of arity 2 that succeeds
if the set intersection of two given list parameters is empty.

4.  Write a Prolog predicate that will find the route from one location to
another.  
intersect( smith, duncan ).
intersect( nashville, asheville ).
intersect( asheville, moses ).
route ( smith, moses, X )
X = [ smith, asheville, moses ]
route( smith, smith, X ).
X = [ smith ]
route( moses, smith, X )
no

Please help immediately.
Thanks.
Ada

