Help for PROLOG syntax

From: angtc11 (angtc11_at_hotmail-dot-com.no-spam.invalid)
Date: 02/25/05


Date: 25 Feb 2005 13:57:35 -0600

Hi

I am a beginner in PROLOG and have this question. How do I return a
'yes' or a 'no' togther with the answer to a variable?

For eg.

drink(coffee).
drink(tea).
drink(coke).

sweet(coke).

Lets say I wish to query drink(X) and it has to return whether it is
sweet, together with the name, like

X=coffee
no

X=tea
no

X=coke
yes

Is this possbile?
Thanks in advance!

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
                http://www.usenet.com



Relevant Pages

  • Re: Prolog: A Toy For Erudition
    ... Consider, for example, physicists. ... theoretician. ... about Prolog came after students asked suggestions for their homeworks. ... Since it is now necessary, I want to say, finally: I AM A BEGINNER. ...
    (comp.lang.prolog)
  • Re: Prolog: A Toy For Erudition
    ... them online in a better condition. ... about Prolog came after students asked suggestions for their homeworks. ... Since it is now necessary, I want to say, finally: I AM A BEGINNER. ... Why did you remove your oop package from your web site?... ...
    (comp.lang.prolog)
  • Re: Prolog: A Toy For Erudition
    ... Sometimes, between a "call for papers" and an insult, occasions to speak ... about Prolog came after students asked suggestions for their homeworks. ... Since it is now necessary, I want to say, finally: I AM A BEGINNER. ...
    (comp.lang.prolog)
  • Re: CLP(FD) team for the ASP solver competition
    ... I'd love to give a hand, though I am a beginner in Prolog. ... ECLiPSe, SICStus, and SWI (there is a problem running your program ...
    (comp.lang.prolog)