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)