Re: Siblings of parents
Roelof Wobben <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Thanks, I changed it to this: male(roelof). male(mans). male(jan). female(chantal). female(tamara). female(marie). parent(roelof,tamara). parent(mans, roelof). parent(jan, chantal). parent(marie, roelof). parent(chantal, tamara). is_mother(Child,Mother):- parent(Mother, Child), female(Mother), is_father(Child, Father):- parent(Father, Child), male(Father), siblings(Father,Mother) :- is_father(X, Father), is_mother(X, mother). So father and mother has siblings if father is the father of X and mother is the mother of X. But still errors like this: User throw: error(system_error, [type = exec, rc = 427, message = `Syntax error: Probable missplaced period around: (is_mother(H223, H224) :- parent(H224, H223) , female(H224) , is_father(H223, H240)) :- parent(H240, H223) , male(H240) , siblings(H240, H224)`, predicate = `err$exec/4`, callstack = `- catch/3;+ catch/3;- consult/1;--- top of stack ---`]) Roelof ---------------------------------------- > Subject: Re: [SWIPL] Siblings of parents > From: [email protected] > Date: Sat, 8 Mar 2014 17:35:22 +0100 > To: [email protected] > > > On 8 Mar 2014, at 17:29 , Roelof Wobben <[email protected]> wrote: > >> siblings(F,M) :- >> >> father(X) >> >> mother(X). >> >> >> >> So I thougth to display if parents have siblings X have to have a father and a mother. > > Check the meaning of these clauses. Do they express what you want to express? > > Another suggestion: Have a look at http://www.learnprolognow.org to get the basics of Prolog. > > --- nef >