Re: exercise in prolog



This could be the syntax... try to implement semantics by yourself.

:- op(500, xfy, says).
:- op(400, yf, lies).
:- op(400, yf, says_the_truth).
:- op(450, xfy, when).

person(a).
person(b).
person(c).

sentence(lies(Who)) :-
person(Who).
sentence(says_the_truth(Who)) :-
person(Who).
sentence(when(If, Then)) :-
sentence(If),
sentence(Then).

says(Who, What) :-
person(Who),
sentence(What).


Ciao



"pachanguero" <boehrs@xxxxxxxxx> ha scritto nel messaggio
news:1179395859.385898.254650@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi!
i got a little problem. we have to implement a program for prolog.
that's the situation:
we got some person who say something about another person. for
example:

a says: b lies when c says the truth.
b says: a says the truth.
c says: b lies.

that's only an example. our task is harder.

anyone has a hint for me? shall I use lists? in addition, we should
use the facts: bool(true) and bool(fail).

thanks for every answer!



.



Relevant Pages

  • Debra Li lies against FL are now fully exposed
    ... These lies are displayed prominently on Fast Larry's web site.... ... Lie #1 - He is a professional billiards and pool player. ... TRUTH - Larry is a liar. ... TRUTH - TASA was an organization started by Fast Larry. ...
    (rec.sport.billiard)
  • Re: Debra Li is the World Champion BS Artist and greatest liar in pool history
    ... These lies are displayed prominently on Fast Larry's web site.... ... Lie #1 - He is a professional billiards and pool player. ... TRUTH - Larry is a liar. ... TRUTH - TASA was an organization started by Fast Larry. ...
    (rec.sport.billiard)
  • Re: Latest News
    ... > Ergo you admit your idealized Socialism is founded on lies. ... They are actually orthogonal, the truth can ... and suppressed evil that contradicted it. ... > Yep, since you can't out-argue anyone, stifle or kill them. ...
    (sci.electronics.cad)
  • Re: Latest News
    ... > Ergo you admit your idealized Socialism is founded on lies. ... They are actually orthogonal, the truth can ... and suppressed evil that contradicted it. ... > Yep, since you can't out-argue anyone, stifle or kill them. ...
    (sci.electronics.misc)
  • Re: Latest News
    ... > Ergo you admit your idealized Socialism is founded on lies. ... They are actually orthogonal, the truth can ... and suppressed evil that contradicted it. ... > Yep, since you can't out-argue anyone, stifle or kill them. ...
    (sci.electronics.design)