Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!ames!hookup!news.moneng.mei.com!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!cam.news.pipex.net!pipex!edi.news.pipex.net!pipex!demon!btnet!news.compulink.co.uk!cix.compulink.co.uk!usenet
From: alanw@cix.compulink.co.uk ("Alan Westwood")
Subject: Re: Missionary and Cannibal Problem
Message-ID: <DAIMJ1.GoB@cix.compulink.co.uk>
Organization: Compulink Information eXchange
References: <3rsi58$8l2@chuangtsu.acns.carleton.edu>
Date: Wed, 21 Jun 1995 09:04:13 GMT
X-News-Software: Ameol
Lines: 24

nelsonb@mathcs.carleton.edu writes:

> 
> We have just been tinkering around with Prolog, coding the Missionary 
and  
> Cannibal Problem.  We get the answer but Prolog isn't providing us with 
 
> option of typing ';' in order to see if there are other solutions; it  
> simply says yes and gives us a query prompt.  Does anybody know why 
this  
> is happening, that is, what sort of goal would cause this?  Thanks.

You need a variable in the goal:

        ?- foo(fred). % Will not backtrack interactively
        ?- foo( F ) . % May backtrack interactively.

Alternatively:
        
        ?- foo(fred), fail. % This will backtrack through all solutions.

Alan Westwood
LPA Ltd
alanw@cix.compulink.co.uk
