【发布时间】:2017-03-06 14:11:49
【问题描述】:
我想说,如果他是父亲,他就是男性,否则就是女性
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.
【问题讨论】:
标签: if-statement prolog family-tree