The Tour of Artificial Intelligence

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Intruction to AI

Artificial Intelligence is a kind of technology for simplifying the solving of problem, esspecially for logic problems.

You may have been heared Eight Qeens , The Tower of Hanoi puzzle , and Chinese chess etc. These problems can solved

by AI technology easily . A programing language for logic programing is called Prolog ,which means Program Logicly, You

can Implement your idear by describing the rules of these problems should obey. You can download an IDE of prolog

visual prolog on http://www.visual-prolog.com. You may ask me how to use prolog. For example, you want describe the

relations between your family, you can write

declare: //declare predications

Father(father, child) ; // father is child's father

Mother(mother, child) ; //mother is child's mother

Sister(girl1, girl2) ; //girl1 is girl2 's sister

Son(partent, boy) ; //boy is parent'son

Daughter(partent, girl) ; //girl is parent's daughter

isBoy(child) ; //child is a boy

isGirl(child) ; //child is a girl

Parent(parent, child) ; //parent is the parent of the child

clause: //define the relations between predications

Father(father, child) :-

isBoy(child) ;

Son(father, child) .

Father(father, child) :-

isGirl(child) ;

Daughter(father, child) .

Sister(child1, child2) :-

Parent(a, child1) ,

Parent(a, child2),

isGirl(child1) .

//the fact

Sister(Kate, Jim) ;

Parent(Jam, jim) ;

then run this program, you ask: Parent(Jam, Kate)?

It tell you “yes“.

(200501172225continued)

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航