• The Application-oriented Project
This version of the project is about developing an expert system for solving the farmer problem. For this project, you should write a report that explains how your expert system is implemented and how it works, and give some execution examples.
The expert system has two parts: the knowledge base and the shell that can be fed with different knowledge bases and give an answer (i.e., recommendations) based on the knowledge base fed. For implementing the shell you can either use an existing expert system shell or write your own. For Prolog you can use the EXSHELL presented in Chapter 6 of the textbook companion resource AI Algorithms, Data Structures, and Idioms in Prolog, Lisp, and Java. For the Lisp you can use the Lisp-shell presented in Chapter 17 of the textbook companion resource AI Algorithms, Data Structures, and Idioms in Prolog, Lisp, and Java. Source code for these shells can also be downloaded from internet but it’s your responsibility to make them work on your compiler.
You should also create a knowledge base representing the famous problem of a farmer having a goat, a wolf, and a cabbage. The farmer wants to take them all across the river from the east shore to the west shore, but his boat is small. The boat has space for only the farmer who can row and one of the items: cabbage, wolf, or goat. The farmer cannot leave the wolf alone with the goat or the goat alone with the cabbage. Your program should be able to display for the user the list the possible steps the farmer may take to move his items across river safely and provide an explanation of how the solution was derived. If the user asks for more solutions, your system should also be able to provide them if they exist.
There are many ways to design a knowledge base, and you are free to design your knowledge base as you like, but it should be expressed in terms of facts and rules. For example, you can design the problem in terms of a state space search with an initial value for the tuple (Farmer, Goat, Cabbage, Wolf) and a goal state to reach. The initial state represented in terms of fact would be state (e, e, e, e), which means that all items are on the east shore of the river. The goal state will then be state (w, w, w, w). Each rule will represent a possible move, and when the rule is fired it will change the value of the state until it reaches the goal state (w, w, w, w).
Note: all data about the state space and the initial state of the system should be defined in the knowledge base as facts.
Your system will consist mainly of two parts: the first is the expert system shell, and the second is the knowledge base—production rules—for the farmer problem. The expert system shell when executed will ask for the name of the file containing the knowledge base. When the user enters the name of this file, the shell will seek it from the disk, parse the rules to make sure they are written properly, then start dealing with them.
Your program should list for each solution the possible steps the farmer can take to move his items across the river safely. You should explain how your predicate works and give some execution examples.
You should submit a working system as well as a description of it. Explain the principles and theories you applied, and show where you have programmed them in the coding.
Marking Scheme
Code: 20 marks Documentation: 30 marks Functionality: 50 marks