For this assignment knowledge of prolog required.
11/21/21, 3:07 PM a3 - COMP-3190-A01 - Introduction to Artificial Intelligence https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/viewContent/2677685/View?ou=438433 1/3 a3 Comp 3190 Assignment 3 - More Advanced Prolog Due: November 22, 2021, at 10:30AM (electronic handin via UMLearn). Note: this assignment involves the more advanced Prolog that we covered. Question 1 requires only basic mathematics to keep a counter while recursing beyond what you've done previously. 1) More Prolog Recursion, 5 marks. This link shows you the start of a prolog source file consisting of family (parent/child) relationships. In your prior work for A2, you used parent and grandparent relationships. You may or may not have gone further back, but in case you did not, your grandparent's parents are great-grandparents, their parents are great-great-grandparents and so on. The data in this file goes much deeper than that we worked with in A2. It is also real data (for me, so I am only revealing personal information and I consent to this for the use of this assignment only), but some things must still be redacted (thou shalt not put the maiden name of any living person's mother on the Internet). For this question, I am asking you to write a predicate greatcount(Person1,Person2,N) and add it to this source file. You may also write supporting prediates that you need, but you may not add any new facts to the source file. The three items participating in the greatcount() relationship are two symbols (persons in this system) and an integer, respectively. The purpose of greatcount is to count the number of greats in a relationship between the first person (the older person) and the second person (the younger or more recent person). For example, if X is Y's great-great-grandparent, greatcount(X,Y,N) should produce N=2 if N is unbound. Similarly, in the same setting, greatcount(X,Y,2) should produce Yes. If X is not in a great-...-great grandparent relationship with Y (this includes if x and y were reversed in the above queries), then the predicate should produce No. A No result would also happen, for example, if x was only y's grandparent or parent, or if they were not related at all (e.g. if you picked a name that was not in this system for a query). Your predicate is NOT expected to bind N to 0 in those cases - simply producing No is fine (taking care of 0 for someone that is only a grandparent or parent is more difficult). Your predicate should work for any combination of constants or variables. So, greatcount(N,fred,2) would find person(s) that are fred's great- great grandparent, greatcount(fred,Y,3) would find Y= fred's great-great-great grandchild(ren), greatcount(N,fred,M) would find all the great- possibilities for fred's great grandparents, along with the number of greats for each, and greatcount(X,Y,Z) with all variables unbound would find all persons in any number of greats-grandparent relationship along with the count of greats. You are NOT allowed to use bagof or setof in this, or any equivalent that processes results en mass: let one result be found at a time and hit ; as usual to get others. You do not d t f il b ilt i di t t if i bl i b d t f thi j t b i i d i l l th ti COMP-3190-A01 - Introduction to Artificial Intelligence GJ https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/navigateContent/331/Previous?pId=2626086 https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/navigateContent/331/Next?pId=2626086 http://aalab.cs.umanitoba.ca/~andersj/ragnar.pro https://universityofmanitoba.desire2learn.com/d2l/home/438433 11/21/21, 3:07 PM a3 - COMP-3190-A01 - Introduction to Artificial Intelligence https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/viewContent/2677685/View?ou=438433 2/3 Reflect in ePortfolio Download Print Open with docReader need cut, fail, or any built-in predicate to see if a variable is bound or not for this: just basic recursion and simple prolog mathematics. Add your predicate definitions to the source file provided in the above link, and test this thoroughly, covering the various possibilities of bound and unbound variables. Make sure you include in your tests finding the number of greats in the relationship between Ragnar Lothbrok (ragnarLothbrok - yes, that guy from the popular TV series Vikings, and John Anderson (johnAnderson - yes, that guy). When you are satisfied with your predicate testing, paste the text of your queries and results of tests into the source file as a comment to show your output. Like A2, remember to make sure you try reloading the file to make sure your comment is closed properly and does not affect how the code runs. 2) The main assignment, A Prototype Knowledge-Based System - 20 marks This main part of this assignment involves developing the basics of a knowledge-based system in Prolog (all code must be yours - you cannot use a shell/add-on or components written by someone else). The specific domain is left up to you, but to make life easy on yourself it should be something that involves a natural goal-directed (backward) search, since this is what Prolog wants to work with by default. You are certainly welcome to write your own more advanced search routines to do forward reasoning in Prolog as part of this question if you so desire, but this is not necessary. You are responsible for identifying the knowledge to collect about your topic area, for representing this knowledge, and for performing searches against that knowledge. Your system should be more than a trivial taxonomy/identification system like the rule- based example we went over in class (that is, it needs to be more complex than having a single obvious answer to any query that's asked of it, where that answer can be seen easily before anybody even runs the system). It should have some sort of uncertainty inherent in the domain itself (most domains that are even semi-realistic do!). It will be understood that you will not necessarily have in-depth knowledge of many sophisticated domains (e.g. medicine) but you each do have hobbies and interests that could be adapted to a knowledge-based system (and are likely experts in things related to computer science!). The knowledge you use should not be entirely arbitrary or made up on your own - that is, the markers should be able to see that the system is working properly based on knowledge that is pubicly available if they wanted to look it up. A basic knowledge-based system that does not include any additional processing or more complex knowledge engineering will receive a minimal grade. To improve the quality of the processing, you could include additional features such as default rules, certainty factors (we'll cover these next week), a structured representation (look further ahead in the text on this), or a simple explanation facility. Choosing problems that Prolog does not naturally support (i.e. writing your own search routines) is also worth extra credit. The quality of the knowledge You have viewed this topic Activity Details https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/navigateContent/331/Previous?pId=2626086 https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/navigateContent/331/Next?pId=2626086 javascript:void(0); 11/21/21, 3:07 PM a3 - COMP-3190-A01 - Introduction to Artificial Intelligence https://universityofmanitoba.desire2learn.com/d2l/le/content/438433/viewContent/2677685/View?ou=438433 3/3 Last Visited Nov 12, 2021 6:31 PM