lundi 6 mars 2017

Prolog, gender with if_then_else

Blockquote

I would like to say that if he is a father he is a male else is a female

father(pedro-i,beatriz(1347)).
father(pedro-i,joão(1349)).
father(pedro-i,dinis(1354)).
father(pedro-i,joão_grão_mestre_da_ordem_de_avis).
mother(constança(1320),luis).
mother(constança(1320),maria(1342)).


% I want to say that if is the father then is male else is a female

IF_then_else(X,Y,Z) :- father(X,Y),male.
IF_then_else(X,Y,Z) :- female.

Aucun commentaire:

Enregistrer un commentaire