A simple problem, but a problem ...

From: Andr? I. (ia_at_bluemail.ch)
Date: 12/06/04


Date: 5 Dec 2004 15:04:48 -0800

Hello,

can anyone solve the following problem ?
It looks quite simple to me, but I can't get it right.

The advice suggests the following:

mr(yes).
mr(no).
mrs(yes).
mrs(no).
marcel(yes).
marcel(no).
jacqu(yes).
jacqu(no).
grandpa(yes).
grandpa(no).

but how can I use this to solve the problem ?

thanx a lot
Maxx

Problem:

If Mr. Johnson goes, his wife goes too.
At least one of the children, Marcel or Jacqueline, goes too.
If Marcel goes, grandpa goes too.
If Mrs. Johnson goes, grandpa stays at home.
If Jacqueline goes, Mr. Johnson and Marcel go too.

Write a prolog program, which determines, which members of the
family Johnson, given the mentioned restrictions, will go to the party.

Advice: Create a variable for each member of the family, which can have
the constant values 'yes' or 'no'.



Relevant Pages

  • Re: A simple problem, but a problem ...
    ... > At least one of the children, Marcel or Jacqueline, goes too. ... > If Mrs. Johnson goes, ... variables are capitalized and different arguments to the predicate. ... And we add the constraint to go/5. ...
    (comp.lang.prolog)
  • Re: Trouble with scanf
    ... > Eric A. Johnson wrote: ... >> Do you have any advice for when I wish to thank numerous people for ... >> replying to my post without making multiple replies... ...
    (comp.lang.c)
  • Re: Flapped Glider Recommendations...
    ... an advice: Don't stick too close to numbers. ... glider differ vastly depending on who measured them (Johnson or the ... German Idaflieg), and, more important: ...
    (rec.aviation.soaring)
  • Re: Double log in windows 2000 or 2003 domain
    ... Jimmy Andersson, Q Advice AB ... Microsoft MVP - Directory Services ... "Marcel" wrote in message ...
    (microsoft.public.windows.server.general)
  • Re: Counterexample to t( (c^n - a^n) mod b ) | phi(b)
    ... Doug Goncz blithered: ... > Good advice. ... Daniel W. Johnson ...
    (sci.math)