AI Session 5 Slides
AI Session 5 Slides
Session 5 Slides
Case studies
In this session we are going to look at a number of scenarios
which can be handled using Prolog
We will start with the family tree
Here we will define family relationships using Prolog
Prolog here we solve problems that involve objects and their
relations
Case studies
Family tree
Case studies
Here Maria and John are parents of Bob
John is also a parent of Elizabeth
Bob is a parent of Anna and Peter
Peter is a parent of Jim
This is what l get and this shows that there is another variable
left with the ? For the other parent
So l can press semi-colon and the other parent shows
Execution in Prolog
And we can see that Maria and John are parents of Bob.
Execution in Prolog