R.
Sai Sindhu Theja
III CSE, sindhu_theja@[Link] pavani_508@[Link]
[Link]
III CSE,
EXPERT SYSTEMS PAGE NO 1
ABSTRACT Computer science education suffers from the recent increasing enrolment, lack of instructors, rapidly changing technologies, and costly equipment upgrades. This crisis can be partially resolved by providing student centered, self-paced, highly interactive learning in engineering computer education and introducing automatic and asynchronous teaching methods based on cost-effective computer and information technologies. The Internet has made it possible for students to have access to materials at any time, from any location, presented in numerous forms including static text, animation and interactive learning tools. Expert systems provide an excellent alternative to private tutoring. The implementation of an expert system embedded into a web page is presented in this paper. Through this combination of formats, instructors can use their own expertise to create interactive tutorials that students can access over the Internet. We take up the presentation of an Internet-based expert system for teaching introductory data structures as an example. This paper presents the implementation of such expert system accessible over the Internet.
EXPERT SYSTEMS PAGE NO 2
EXPERT SYSTEMS EXPANDING HORIZONS IN CLASS ROOM TEACHING
EXPERT SYSTEMS PAGE NO 3
CONTENTS
ABSTRACT
1. INTRODUCTION 2. EXPERTSYSTEMS 3. USES AS A TEACHING TOOL 4. EXPERT SYSTEMS AND THE INTERNET A. Domain B. Implementation 5. DEVELOPMENT A. Shells B. Inference Engine C. Knowledge Base D. Fact List E. Viability 6. EXAMPLES 7. FUTURE DEVELOPMENT 8. CONCLUSION 9. REFERENCES 10. ACKNOWLEDGEMENTS Keywords: Expert systems, Internet, Tutorial, Data Structures
EXPERT SYSTEMS PAGE NO 4
1. INTRODUCTION Expert systems are beneficial as teaching tools because they have a unique feature which allows users to ask for information or pose questions, such as How, Why and What if. Often students are reluctant to ask for assistance from teachers for fear of appearing stupid or even somehow implying that the material was not adequately explained. The use of an automated system to provide clarification bridges the gap in the students learning without involving a possible confrontation between student and teacher. There are various benefits to Internet- accessible materials in the teaching process. One of these is the possibility of learning within any time and at any place, it is found that not only is there access to more exciting ways of material presentation, but also the possibility of adapting the materials to different learning styles. Currently instructional systems available over the Internet utilize primarily HTML documents, which provide little in the way of interaction. The expanded use of Java is making it possible to include animations in web pages, thereby bringing concepts to life. An added benefit of the marriage of the Internet and the Java virtual machine is the elimination of platform dependence for learning materials. This often provided difficulties for students who wanted to use the materials but were without access to these machines. 2. EXPERT SYSTEMS
EXPERT SYSTEMS PAGE NO 5
FACT LIST inferences are made data items on which The fact list contains
EXPERT of BASE KNOWLEDGErules represented as if-then which areSYSTEMS It consistsusually statements
INFERENCE ENGINE found and determine if a suitable uses Controls the respond toandmatch is the rules to execution a query
Expert systems are not a new concept but rather a specialized branch of Artificial intelligence. Expert systems are essentially symbolic computer models of human expertise in a specific domain of work. They have peak performance in areas that are generally difficult for humans, in areas where the knowledge is narrow but deep. They are capable of offering advice and decision support, related to specific problem solving, in a well-defined knowledge domain. Such domains tend to have a great number of rules upon which to base decisions. These expert systems are used in such domains to make out decisions not only quickly but also according to users requirement. They are essentially a way to containerize the knowledge of human experts and make the information accessible to a large number of people. An expert system is comprised of three Basic Components The Fact list The Knowledge base The Inference engine
Expert Systems
Fact List
Knowledge Base
Inference Engine
The Fact List contains the data items on which inferences are made
The Knowledge Base contains the rules, which are usually represented as if-then statements
The Inference Engine controls the execution and uses the rules to respond to a query
The Fact List contains the data items on which inferences are made. For example, the statements Barbara is Anns mother, Billie is Gails
EXPERT SYSTEMS PAGE NO 6
mother and Valerie is Juliennes mother constitute a fact list of motherdaughter relationships. The Knowledge Base contains the rules, which are usually represented as if-then statements (if X is a female parent, then X is a mother). The Inference Engine controls the execution and uses the rules to respond to a query and determine if a suitable match can be found in the fact list. This is done through either backward- or forward-chaining. Backwardchaining is the method of starting with the goal (Who is Anns mother?) and working through a potential hypothesis until it reaches the facts that support that hypothesis. Forward-chaining involves reasoning from facts to conclusions based on those facts. 3. USES AS A TEACHING TOOL Expert systems are beneficial as teaching tools because they have a unique feature which allows users to ask for information or pose questions, such as How, Why and What if. When used in addition to a classroom setting, the student is able to ask the expert system to detail its methods for generating the reasoning behind the particular choices. Sometimes, due to their expertise in the field, humans are less able to exactly describe their reasons for making choices. Expert systems are the opposite of humans in this instance, able to show the reasoning behind the choices made and have the added benefit of endless repetition without losing patience. 4. EXPERT SYSTEMS AND THE INTERNET A. Domain The relative lack of expert systems implemented on the Internet is perhaps due to the apparently opposing nature of each arena. Expert systems are often costly to create as they can involve serious investments in , Time for research and development of the knowledge base, specialized knowledge required for understanding both the environment and the programming tools and, historically, specialized machines on which to run. The Internet is the EXPERT SYSTEMS PAGE NO 7
ultimate free zone, and unless an area is password protected and/or requires a subscription, the material is available to the general public. Generally, the placement of an expert system on the Internet would be a costly endeavor, and unlikely to see a return on investment which runs contrary to the practice of most businesses. Universities, however, are in a unique position as their business is education. The faculty members are often already experts in their respective fields. Having prior knowledge about other programming languages reduces the enormity of this task. It is for these reasons that the creation of various expert system-based tutorials would be more accessible to educational community, and the accessibility of tutorials over the Internet within the realm of financial possibility. B. Implementation This paper presents the implementation of an expert system accessible over the Internet. It discusses the tools and building blocks of the expert system, along with the design, inclusion of the expert system, data structures and additional resources available in the tutorial. The goal for the tutorial is to have it accessible to as many people as possible. This is achieved through the creation of an introduction to basic data structures for computer science students. The topic addresses some difficulties encountered by students new to this topic in computer science. Often students are reluctant to ask for assistance from teachers for fear of appearing stupid or even somehow implying that the material was not adequately explained. The use of an automated system to provide clarification bridges the gap in the students learning without involving a possible confrontation between student and teacher. 5. DEVELOPMENT A. Shells
EXPERT SYSTEMS PAGE NO 8
There are a variety of expert system shells available for the development of a system. We used CLIPS and JESS as software for implementation because of their ease of availability of both the software and documentation and other supporting materials. Another deciding factor is stability. It is important to select a shell that has been around long enough to have been proven powerful and able to stand the test of time. The language of CLIPS is similar to LISP, as it utilizes list processing. The inference engine of CLIPS supports forward chaining. It is able to represent knowledge in the form of rules, deffunctions (defined functions), generic functions and object-oriented programming. Jess was written specifically to be compatible with CLIPS and is actually a programmers library written in Java. Using Jess, it is possible to build or run Java applets and applications that have the capacity to reason using knowledge supplied in the form of declarative rules. As some Java applets are included in the Jess library, it seems only natural that the expert system be implemented on the Internet. B. Inference Engine The inference engine is the driving force behind the expert system. It decides which rules should be executed and when .It places rules from the knowledge base on the agenda for activation. Rules are activated when all patterns of a rule are matched by facts. The reset command asserts the facts by bringing them into the active workspace. The run command then begins execution of the program. C. Knowledge Base The knowledge base contains fact templates and rules. These fact templates are user-defined and, have the following syntax Syntax:
EXPERT SYSTEMS PAGE NO 9
(deftemplate
<relation-name>
[<optional-comment>]
<slot-definition>*). Within a single template there can be multiple slot-definitions; therefore, it is very important that the order of the pieces within a node be maintained. Also, the number of templates is not restricted within a system, so it is possible to have multiple templates for different types of elements. Table 1 contains the fact template section of the knowledge base for this implementation.
(deftemplate node (slot name) (slot type) (slot question) (slot yes-node) (slot no-node) (slot answer))
Table 1. Fact Template. The knowledge base also contains a set of rules. The syntax for a CLIPS rule is Syntax:
(defrule <rule-name> [<comment>]
<patterns>* ; Left-Hand Side (LHS) of the rule => <actions>*) ; Right-Hand Side (RHS) of the rule This generic
form can be read as For the rule called <rule-name> if the <patterns> are matched to the facts, then perform these <actions>. The comment section of the rule is completely optional, although the rule must be enclosed in parentheses. It is important to note that the fact list is separate from the rules. This is significant because it is possible to retain the same rules while supplying different facts. This modularity allows the expert system to be highly flexible. The inference engine always fires rules in order. Thus, the first rule initializes the system. The other rules in the knowledge base control movement through the decision tree (Figure 1).
EXPERT SYSTEMS PAGE NO 10
Table 2 shows a rule called proceed-to-yes-branch. This particular rule fires if the student answers yes to a query. D. Fact List The final part of the expert system is the fact list, which contains a series of nodes. The syntax for these nodes is specific to the fact template stored in the knowledge base. In this implementation the nodes are of the types decision and answer. Table 3 shows the fact list for this implementation. Each node must be self-contained within parentheses, yet there are no external parentheses around the entire list. The fact list can be graphically represented as a decision tree. The decision nodes query the user, and the user-entered response provides the movement through the tree. If the response is yes the left sub tree is accessed, and if the response is no the right subtree is accessed. The leaf nodes provide the answer to the consultation. When the answer node is reached, the value is printed to the screen.
(defrule proceed-to-yes-branch ?node <- (current-node ?name) (node (name ?name) (type decision)(yes-node ?yes-branch)) ?answer <- (answer yes) => (retract ?node ?answer) (answer (current-node ?yes-branch)))
Table 2. The proceed-to-yes-branch Rule...
EXPERT SYSTEMS PAGE NO 11
Figure 1. The Decision Tree. E. Viability The question-and-answer session of the expert system consultation provides students the opportunity to directly affect what is being presented. This interactivity generally keeps students interested longer. In addition to the significant number of data structures, there are subtleties involved in choosing from among the varieties of individual implementations. These additional structures are more advanced topics in computer science. The knowledge base for this system is small in order to focus on the expert system implementation of the tutorial and its use via the Internet.
EXPERT SYSTEMS PAGE NO 12
(node (name root) (type decision) (question "Is all of your data of the single type?") (yes-node node1) (no-node node2)(answer nil)) (node (name node1) (type decision) (question "Is your data made up of only characters?") (yes-node node3) (no-node node4) (answer nil)) (node (name node4) (type decision) (question "Do you want to have direct access to each piece of data?") (yes-node node5) (no-node node6) (answer nil)) (node (name node6) (type decision) (question "Do you want the first item in to be the first item out?") (yes-node node7) (no-node node8) (answer nil)) (node (name node2) (type answer) (question nil) (yes-node nil) (no-node nil) (answer linked-list)) (node (name node3) (type answer) (question nil) (yes-node nil) (no-node nil) (answer string)) (node (name node5) (type answer) (question nil) (yes-node nil) (no-node nil) (answer array)) (node (name node7) (type answer) (question nil) (yes-node nil) (no-node nil) (answer stack)) (node (name node8) (type answer) (question nil) (yes-node nil) (no-node nil) (answer queue))
Table 3. The Fact List. 6. Example This is much better explained through a simple example. (You should maybe look back at the notes on rule-based system if it is unclear.) Suppose that we have the following rules: 1. IF engine_getting_petrol AND engine_turns_over THEN problem_with_spark_plugs 2. IF NOT engine_turns_over AND NOT lights_come_on THEN problem_with_battery 3. IF NOT engine_turns_over AND lights_come_on THEN problem_with_starter
EXPERT SYSTEMS PAGE NO 13
4. IF petrol_in_fuel_tank THEN engine_getting_petrol Our problem is to work out what's wrong with our car given some observable symptoms. There are three possible problems with the car: problem_with_spark_plugs, problem_with_battery, problem_with_starter. We'll assume that we have been provided with no initial facts about the observable symptoms. A complete interaction with our very simple system might be: System: Is it true that there's petrol in the fuel tank? User: Yes. System: Is it true that the engine turns over? User: No. System Is it true that the lights come on? User: No. System: I conclude that there is a problem with battery.
7. FUTURE DEVELOPMENT A potential area for expansion is in the knowledge base of the expert system, as there are a variety of other questions which might be presented. These include, but are not limited to, prior knowledge of the data size, if the data will be presorted, if access speed is a major concern, the most common type of access (i.e., insert, delete, read-only) and the type of search activities that will be performed. The questions, while taken into consideration, did not bring further clarity to the data structure selection for this implementation. There are a significant variety of data structures and numerous subtleties involved in selecting the proper structure. The development of an expert system for computer science students with more advanced knowledge of data structures, that incorporates these questions and presents more complex data structures, is an area for future development.
EXPERT SYSTEMS PAGE NO 14
8. CONCLUSION This paper discusses the implementation of an Internet-based expert system. With the expanded use of the Java virtual machine, it is possible to successfully create interactive learning materials that are accessible by a wide audience. The implementation of this small, expert system-driven tutorial exploits the interactivity of the Internet, while providing one-on-one instruction in introductory data structures for computer science students. This includes a potentially global population and has the added benefit of being able to be accessed at any time of day. It is possible to develop an expert system in any area, provided the knowledge base can be sufficiently restricted. Using the expert system tools CLIPS and Jess simplifies the development process. The separation of fact list and knowledge base provides reusability for the system allowing the creation of additional rules without rewriting the entire system. This implementation has shown the viability of an expert system that is accessible over the Internet. Whether the tutorial is used alone, or to supplement classroom instruction, extra insight is gained into the process of selecting the appropriate introductory data structure for a particular application. The student benefits from the expert system's ability to divulge its reasoning process, thus providing the students a greater insight into the concepts.
EXPERT SYSTEMS PAGE NO 15
9. REFERENCES 1. The software accompanying this paper is downloaded from the following URL [Link] [Link] (The software is free to distribute and hence no copyrights are violated for sending the software.) 2. Boroni, C.M., Goosey, F.W., Grinder, M.T., and Ross, R.J., A paradigm shift! The Internet, the web, browsers, Java and the future of computer science education, Proceedings of the Twenty-ninth SIGCSE Technical Symposium on Computer Science Education. 3. McFarland, T.D., and Parker, R., Expert Systems in Education and Training. Educational Technology Publications. 4. Definitions are extracted from the site: [Link] [Link] [Link] [Link] 5.
Eliot, L. "Expert Systems in a Graduate Level Course: A BusinessApproach," Association for Information Decision 1986, pp. 22-24
Oriented Sciences, Proceedings,
EXPERT SYSTEMS PAGE NO 16
6.
Medsker, L. R.; Morrel, J. H. and Medsker, K. L. "Expert Systems:
Meeting the Educational Challenge," Collegiate Microcomputer, Vol. 5, No. 3, August 1987, pp. 223-229.
7.
General References :
[Link]
EXPERT SYSTEMS PAGE NO 17