abby学编程(abby老师学英语)

2023-11-30 00:17:24 数码极客 bianji01

 

人工智能导论prolog编程题目

随便从网上找的一个family tree------------------------------------------------------------------------------------------------------%?Family?Membersmale(tom).male(john).male(adam).male(nike).male(bob).female(alisa).female(abby).female(anne).female(alice).female(betty).female(carry).female(chris).mother(alisa,?alice).mother(alisa,?anne).mother(alice,?carry).mother(abby,?adam).mother(abby,?betty).mother(betty,?chris).mother(betty,?bob).father(tom,?anne).father(tom,?alice).father(john,?adam).father(john,?betty).father(nike,?chris).father(nike,?bob).father(adam,?carry).%%%%%%%%%%%%%%%%%%%%%%%?Parent:?a?father?or?motherparent(A,?B):-father(A,?B);mother(A,?B)%?Child:?a?human?offspring?(son?or?daughter)?of?any?agechild(A,?B):-parent(B,?A).%?Daughter:?a?female?human?offspringdaughter(A,?B):-female(A),child(A,?B).%?Son:?a?male?human?offspringson(A,?B):-male(A),child(A,?B).%?Sibling:?a?persons?brother?or?sistersibling(A,?B):-parent(C,?A),parent(C,?B),A?\=?B.%?Sister:?a?female?person?who?has?the?same?parents%?as?another?personsister(A,?B):-sibling(A,?B),female(A).%?Brother:?a?male?with?the?same?parents?as?someone?elsebrother(A,?B):-sibling(A,?B),male(A).%%%%%%%%%%%%%%%%%%%%%%%%%?Aunt:?the?sister?of?your?father?or?motheraunt(A,?B):-parent(C,?B),sister(A,?C).%?Uncle:?the?brother?of?your?father?or?motheruncle(A,?B):-parent(C,?B),brother(A,?C).%?Cousin:?the?child?of?your?aunt?or?unclecousin(A,?B):-parent(C,?B),sibling(D,?C),child(A,?D).%%%%%%%%%%%%%%%%%%%%%%%%%?Grandparent:?a?parent?of?your?father?or?mothergrandparent(A,?B):-parent(A,?C),parent(C,?B).%?Grandfather:?the?father?of?your?father?or?mothergrandfather(A,?B):-male(A),grandparent(A,?B).%?Grandmother:?the?mother?of?your?father?or?mothergrandmother(A,?B):-female(A),grandparent(A,?B).%?Grandchild:?a?child?of?your?son?or?daughtergrandchild(A,?B):-grandparent(B,?A).%?Grandson:?a?male?grandchildgrandson(A,?B):-male(A),grandchild(A,?B).%?Granddaughter:?a?female?grandchildgrandson(A,?B):-female(A),grandchild(A,?B).------------------------------------------------------

声明:易趣百科所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系315127732@qq.com
广告位招租
横幅广告