B. Ross Cosc 4f79 1 Explanation An important feature of expert systems is their ability to explain : - why questions are being asked - how certain conclusions.

Slides:



Advertisements
Similar presentations
Modelling with expert systems. Expert systems Modelling with expert systems Coaching modelling with expert systems Advantages and limitations of modelling.
Advertisements

Software Development Languages and Environments. Programming languages High level languages are problem orientated contain many English words are easier.
EXPERT SYSTEMS AND KNOWLEDGE REPRESENTATION Ivan Bratko Faculty of Computer and Info. Sc. University of Ljubljana.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
Justification-based TMSs (JTMS) JTMS utilizes 3 types of nodes, where each node is associated with an assertion: 1.Premises. Their justifications (provided.
B. Ross Cosc 4f79 1 Frames Knowledge bases can be enhanced by using principles from frame knowledge representation (similar to object orientation) This.
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Expert System Shells - Examples
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
B. Ross Cosc 4f79 1 Forward chaining backward chaining systems: take high-level goal, and prove it by reducing it to a null goal - to reduce it to null,
CSE 425: Logic Programming I Logic and Programs Most programs use Boolean expressions over data Logic statements can express program semantics –I.e., axiomatic.
2 We need programming languages to communicate with a computer. The two broad classifications of programming languages are: Low-level and High- level.
Chapter 12: Expert Systems Design Examples
Expert System Human expert level performance Limited application area Large component of task specific knowledge Knowledge based system Task specific knowledge.
Artificial Intelligence CAP492
Proof System HY-566. Proof layer Next layer of SW is logic and proof layers. – allow the user to state any logical principles, – computer can to infer.
Rules and Expert Systems
Marakas: Decision Support Systems, 2nd Edition © 2003, Prentice-Hall Chapter Chapter 1: Introduction to Decision Support Systems Decision Support.
EXPERT SYSTEMS Part I.
1 CILOG User Manual Bayesian Networks Seminar Sep 7th, 2006.
Introduction • Artificial intelligence: science of enabling computers to behave intelligently • Knowledge-based system (or expert system): a program.
Russell Taylor Lecturer in Computing & Business Studies.
Artificial Intelligence CSC 361
The Basic Tools Presented by: Robert E., & Jonathan Chase.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
An expert system is a package that holds a body of knowledge and a set of rules on a subject that has been gained from human experts. An expert system.
Chapter 3 Software Two major types of software
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Expert Systems Expert systems are AI programs that solve a highly technical problem in some domain Expert systems are AI programs that solve a highly technical.
Sepandar Sepehr McMaster University November 2008
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
1 Software Development Topic 2 Software Development Languages and Environments.
Artificial Intelligence Lecture No. 15 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
B. Ross Cosc 4f79 1 Prototyping Pure Prolog is ideal for prototyping expert systems (as well as other applications) For a prototype, the idea is to get.
Software Engineering 2003 Jyrki Nummenmaa 1 CASE Tools CASE = Computer-Aided Software Engineering A set of tools to (optimally) assist in each.
COSC 2P93 Logic Programming Instructor: Brian Ross Instructor: Brian Ross Texts: Texts: Prolog Programming for Artificial Intelligence,4e, Ivan Bratko,
Explanation Facility دكترمحسن كاهاني
Production Systems A production system is –a set of rules (if-then or condition-action statements) –working memory the current state of the problem solving,
School of Computer Science and Technology, Tianjin University
UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.
15/11/04 AIPP Lecture 14: Database Manipulation1 Database Manipulation Artificial Intelligence Programming in Prolog Lecturer: Tim Smith Lecture 14 15/11/04.
Cohesion and Coupling CS 4311
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Introduction From: Chapter 1, Building Expert Systems in Prolog, htm.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
B. Ross Cosc 4f79 1 Inference mechanisms Backward chaining - goal-driven reasoning which gathers data as needed - Prolog's default mechanism - good for.
Component 4: Introduction to Information and Computer Science Unit 6a Databases and SQL.
Programming Languages. A Logic Programming Language: Prolog This lesson describes the basic structures and functions of the logic programming language:
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
A Machine Learning Approach to Programming. Agenda Overview of current methodologies. Disadvantages of current methodologies. MLAP: What, Why, How? MLAP:
ES component and structure Dr. Ahmed Elfaig The production system or rule-based system has three main component and subcomponents shown in Figure 1. 1.Knowledge.
Review: computing list results Many programs require list results to be computed, built and returned Many programs require list results to be computed,
Prolog Program Style (ch. 8) Many style issues are applicable to any program in any language. Many style issues are applicable to any program in any language.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
MB: 26 Feb 2001CS Lecture 11 Introduction Reading: Read Chapter 1 of Bratko Programming in Logic: Prolog.
Fall 2008Programming Development Techniques 1 Topic 17 Assignment, Local State, and the Environment Model of Evaluation Section 3.1 & 3.2.
Knowledge Based Information System
Of An Expert System.  Introduction  What is AI?  Intelligent in Human & Machine? What is Expert System? How are Expert System used? Elements of ES.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Getting ready. Why C? Design Features – Efficiency (C programs tend to be compact and to run quickly.) – Portability (C programs written on one system.
Artificial Intelligence
Chapter – 8 Software Tools.
Done By :- -Nesreen Basem -Sara nabil -Rawan Prolog Program.
16 April 2011 Alan, Edison, etc, Saturday.. Knowledge, Planning and Robotics 1.Knowledge 2.Types of knowledge 3.Representation of knowledge 4.Planning.
Architecture Components
Intro to Expert Systems Paula Matuszek CSC 8750, Fall, 2004
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

B. Ross Cosc 4f79 1 Explanation An important feature of expert systems is their ability to explain : - why questions are being asked - how certain conclusions were reached - why other conclusions were not reached - trace the inference engine for debugging purposes - give "human level" explanation of rules Implementing explanation involves keeping a record of the inference steps that resulted in a computation: - the rules that were executed: (i) rule #’s, (ii) symbolic images of rules - the order in which rules were executed --> ie. keep a record of the computation tree explanation utilities merely access this computation tree record, and print out text accordlingly

B. Ross Cosc 4f79 2 Explanation (cont) There are various methods for recording the computation tree: a) assert and retract facts recording level, step, and rule numbers - this adds complexity to knowledge base: rule numbers, "enter_rule" goal,... - KB becomes less declarative b) new arguments record explanation in KB rules; rules keep tabs on this arg - still makes KB less declarative c) Meta-interpreters: - because KB should be declarative, we write a simple meta-interpreter to execute it - this meta-interpreter will keep track of the computation tree via an added argument - advantage: KB remains declarative and simple to maintain - also, one can encode fairly sophisticated explanation facility

B. Ross Cosc 4f79 3 Explanation explain line of reasoning: why - why query is being asked how - how a conclusion was reached why_not - why another conclusion wasn't reached trace - computation trace dump - dump one or all rules in a readable format Requires keeping track of computation tree - identify rules: rule numbers, or symbolically - keep track of computation tree i) assert step/rule info in active database ii) an extra argument to a meta-interpreter Type of explanation generated: 1. print the rule - dump Prolog clause - print a rule number - print "attribute : value" - print a "english"-style version of rule

B. Ross Cosc 4f79 4 Explanation (cont) 2. print special text incorporated into the rule eg. defect(12, 'the heater blower', is, defective) :- cause(13, 'the blower', is, stuck), cause(14, 'the motor', is, 'out of whack'). eg. meta-interpreter bird(barn_swallow, 'the name of the bird') :- family(swallow, _ ), tail(square, _). tail(square, X) :- X = 'the shape of the tail', ask(tail, square, X). then: (1) ask will use this 3rd argument when querying the user (2) meta-interpreter's "prove" predicate will include this text in its history argument, which is then available for any explanation required

B. Ross Cosc 4f79 5 Explanation (cont) 3. Associate some canned text with each rule eg. rule numbers: bird(26,barn_swallow) :- family(_,swallow), tail(_,square). elsewhere... big_explanation(26) :- write('Barn swallows have the following unique characteristics..."). The shell utility will match this explanation with the rule for which a big explanation is sought. Could also have a text file for the rule: bird('barnswallow.txt', barn_swallow) :-.....

B. Ross Cosc 4f MTA working data base: step(0) [1,2,3,...] <-- step in inference tree(0,0) [ (1,_), (2,_),...] <-- inference tree record level(0) <-- keeps track of which level in tree is currently being explained advantages: - high-level explanation of rules disadvantages: - rules themselves are not printed (useful for debugging) - KB has more control info * - step, tree, level predicates work as side-effects: a very nasty way to do logic programming!

B. Ross Cosc 4f Bowen toy system (ch.8) should_take(Person, Drug, Reason) :- complains_of(Person, Symptom, ComplainsReason), suppresses(Drug, Symptom, SuppressesReason), not unsuitable_for(Person, Drug, UnsuitReason), append(SuppressesReason, UnsuitReason, InterReason), append(ComplainsReason, InterReason, Reason). suppresses(Drug, Symptom, [relieves(Drug, Symptom)]) :- relieves(Drug, Symptom). etc - 3rd arguments are lists of reasons why goals succeed - need to append them together: ruins declarativity of KB run :- write ('Name='), read(Person), should_take(Person, Drug, Reason), write_list(['Recommend taking ', Drug, nl]), write('Explanation:'), nl, write_nl_list(Reason).

B. Ross Cosc 4f Bird ID meta-interpreter keeps a list of the successfully solved goals this list is printed as part of explanation Note that prov(G, [G | H ]) same as append([G], H, H2), prov(G, H2) to add "why" to our toy system: - add a history argument to "prov" to keep a growing list of successful goals (represents the branch of computation tree) - modify "ask" to recognize "why" from user (already reads "yes" and "no"); will also take history argument, and print it out when "why" is seen advantage: - KB is kept simple & declarative disadvantage: - the explanation written is terse --> solutions: (i) add phrase arguments, pretty printing (ii) add canned text predicates for why

B. Ross Cosc 4f79 9 Comparing these styles - MTA KB is more difficult to maintain ; meta-interp'ed KB is more declarative - MTA shell code is side-effect driven, while Meta-interp is more straight-forward eg. compare MTA's write_explanation with bird's process_ans - each repeated "why" in MTA will retract/assert new level clause, which is a side effect - process_ans can be made to print elements in history list for each why given by user Bowen's ch. 8 method is better, but it still complicates the KB - when Kb rules have "append", something is amiss meta-interpreter: ideal method, because we can in essence design our own KB language, whose explanation, I/O, inference scheme, etc, is tailored to our needs - can keep KB as pure as possible

B. Ross Cosc 4f79 10 User interface user interface should provide a variety of user commands - standard explanation ones: why, how, why_not, trace,... - query input: yes, no, ( values - white, long, etc...) menus - choices, numeric input, windows,... unsure - not certain how to determine query answer unknown - a definite answer is not possible when recording input: assert(fact(Attribute, Value, X)), where X is one of yes, no, unknown unknown can mean that some rules are possible eligible if user types "unsure", can give guidance as to how to proceed. This is called "test" advice in text.