[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: General question about better documentation and specific question
From: |
Vic Bancroft |
Subject: |
Re: General question about better documentation and specific question |
Date: |
Mon, 3 Dec 2001 00:10:16 -0500 (EST) |
n Sat, 1 Dec 2001, Violetta Cavalli-Sforza wrote:
> Thank you. One more question and then I'll stop asking for a while.
You breathe life into the list . . .
> I have the following database of facts and rules.
> ...
>
> can_marry(X,Y) :- X \= Y, not(sibling(X,Y)), not(cousin(X,Y)).
This definition seem a little lax, even fore the west coast ;>
/usr/home/bancroft/src/prolog/can_marry.pl compiled,
32 lines read - 3708 bytes written, 193 ms
(20 ms) yes
| ?- can_marry( john, mary ).
can_marry( john, mary ).
yes
Since this theory of wedding seems to permit any pair except those
that match any in a list of exceptions. You might consider,
ok_marry( X, Y ) :- \+ forbidden( X, Y ).
Then one simply lists the exceptions, as so,
forbidden( X, X ).
forbidden( X, Y ) :- parent( X, Y ).
forbidden( X, Y ) :- cousin( X, Y ).
forbidden( X, Y ) :- sibling( X, Y ).
Of course, this does still allow :
| ?- ok_marry( albert, ann ).
ok_marry( albert, ann ).
yes
Soo, perhaps one could just introduce the ancestor relation,
ancestor( X, Y ) :- parent( X, Y ).
ancestor( X, Y ) :- parent( X, Z ), parent( Z, Y ).
A fairly recently lost taboo one might have conventionally considered,
same_sex( X, Y ) :- father( X, _ ), father( Y, _ ).
same_sex( X, Y ) :- mother( X, _ ), mother( Y, _ ).
> ... (though this definition comes straight out of Clocksin and
> Mellish).
That is a classic text! Perhaps as you work through the examples, we
could build up a gprolog FAQ section on the _Clocksin and Mellish_
examples . . . who are the gprolog FAQ maintainers ?
more,
l8r,
-------------------------------------------------------------------
Victor Bancroft
Fellow, Artificial Intelligence Center (706) 542-0358
Athens, Georgia 30602, U.S.A http://ai.uga.edu/~bancroft
Principal Engineer, Zvolve Systems [v]770.551.4505
1050 Crown Pointe Pkwy, Suite 300, Atlanta GA 30338 [f]770.551.4509
- General question about better documentation and specific question, Violetta Cavalli-Sforza, 2001/12/01
- Re: General question about better documentation and specific question,
Vic Bancroft <=
- GNU Prolog FAQ, Daniel Diaz, 2001/12/03
- Re: GNU Prolog FAQ, Christian, 2001/12/03
- Re: GNU Prolog FAQ, Daniel Diaz, 2001/12/03
- Re: GNU Prolog FAQ, Christian, 2001/12/03
- Re: GNU Prolog FAQ, Daniel Diaz, 2001/12/03
- Re: GNU Prolog FAQ, Christian, 2001/12/03
- Re: GNU Prolog FAQ, K. Ari Krupnikov, 2001/12/04
- Re: GNU Prolog FAQ, Christian, 2001/12/04
- Re: consult from command-line (was GNU Prolog FAQ), Daniel Diaz, 2001/12/04
seg violation compiling gprolog under x86 mandrake 8.1, Erick Alphonse, 2001/12/03