Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newshost.marcam.com!usc!howland.reston.ans.net!news.sprintlink.net!EU.net!chsun!usenet
From: Reto Kramer <kramer@al.esec.ch>
Subject: Beginner's question - closed world assumtion ...
Message-ID: <D431D2.294@eunet.ch>
Sender: usenet@eunet.ch
Organization: EUnet AG, Switzerland
Date: Thu, 16 Feb 1995 07:41:26 GMT
Lines: 68

Since I am a novice in Prolog, I have trouble
to express the following:

a) peter may go to zuerich. He may also go
   to new-york. 
   However, peter may not go anywhere else.
b) reto may go to oakland but not anywhere
   else.
c) anybody else may go anywhere !

I tried to map this into the prolog code:

may-go(reto,oakland) :- 
	!.
may-go(peter,chicago).
may-go(peter,new-york) :- 
	!.
may-go(AnyBody,Anywhere).

query-may-go(X,Y) :- 
	may-go(X,Y).

(I separated the query from the facts, since somebody
 recommended this practice in this newsgroup not long ago)
 
ASKING:
?- query-may-go(reto,X).
	X=oakland;
	no
is OK, no further soluations (esp. not Anywhere), 
due to the cut (this is fine).

ASKING:
?- query-may-go(reto,oakland).
	yes
is also OK

ASKING:
?- query-may-go(reto,paris).
	yes
>>>>> this is not OK because reto just may go to oakland !

ASKING:
?- query-may-go(sarah,X).
X = Anywhere6 ;
no
is OK too.

Questions:
- Is this related to the closed world assumption ?
- Is there any other way to express the above ?
- How can I say, frank may go to milano and london
  but not to oslo and vienna ?

Any help is greatly appreciated !

Reto
----
ESEC SA
Reto Kramer
Autoline R&D
Hinterbergstr. 32
CH-6330 Cham
Switzerland
email: {kramer@acm.org, reto.kramer@al.esec.ch}
tel (direct): +41 42 44 52 84
fax	    : +41 42 41 64 84

