ft228/4 knowledge based decision support systems frame-based expert systems ref: artificial...

31
FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky – Aungier St. Call No. 006.3

Upload: sammy-tolton

Post on 31-Mar-2015

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

FT228/4 Knowledge Based Decision Support Systems

Frame-Based Expert Systems

Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky – Aungier St. Call No. 006.3

Page 2: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Knowledge Representation

In building a knowledge base, the programmer must select the significant objects and relations in the domain and map these into formal languageThe resulting program must contain sufficient knowledge to solve the problem of the domain, it must make correct inferences and it must do so quicklyWe can consider a knowledge base as a mapping between objects and relations in a problem domain and the computational objects and relations in a programThe results of inferences on the knowledge base should correspond to the results of actions or observations in the worldThe computational objects, relations and inferences are determined by the knowledge representation language the programmer selects.

Page 3: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Knowledge RepresentationGeneral principles and issues Class hierarchies are found in both scientific and

common sense classification schemes How do we provide a general mechanism for

representing them? How may we represent definitions? How may we represent exceptions? When should a knowledge based system make default

assumptions about missing information, and how should it adjust its reasoning if these assumptions prove wrong?

How may we best represent time? How may we best represent causality? How may we best represent uncertainty?

Page 4: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Knowledge Representation

Medium of representation is the languageScheme is how we use the languageClassification of schemes Logical representation schemes: Use expressions

in formal logic to represent a knowledge base. Inference rules and proof procedures apply this knowledge to problem instances

Procedural representation schemes: Knowledge represented as a set of instructions for solving a problem. In a rule based system, an if…then may be seen as a procedure for solving a goal in a problem domain, by solving the premises in order.

Page 5: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Knowledge Representation

Classification of schemes (contd.) Network representation schemes: Network

representations capture knowledge as a graph in which the nodes represent objects or concepts in the problem domain and the arcs represent relations or associations between them

Structured representation schemes: Extension of networks by allowing each node to be a complex data structures consisting of slots with attached values. These values may be simple numeric or symbolic data, pointers to other frames or even procedures for performing a particular task.

Page 6: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Issues in Knowledge Representation

Most of the issues in knowledge representation are motivated by the effort to program a computer to understand natural languages such as English.Issues raised:

Exactly what things can be represented by the objects and relations in the language. E.g. if a predicate relates an object to a value, such as hascolour(car,red) how can that be used to represent “John’s car is redder than Mary’s”.

What level of complexity is required for our objects. How do we distinguish between intensional and extensional

knowledge? The intension determines what a concept means at an abstract level (ball is round). The extension is the set of all things denoted by the object (set of all balls).

A database denotes the extension of the object, whereas an expert system includes the intension of the object.

Page 7: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Issues in Knowledge Representation

Issues raised (contd.): How do we represent meta-knowledge, or

knowledge about the objects and structures of the representation language itself? This type of knowledge helps us represent things such as “George believes thaty Tom knows that Mary’s car is red”

How do we represent into class hierarchies, use inheritance, excpetions, overriding, overloading, default values etc.

Page 8: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Frames

“Thinking always begins with suggestive but imperfect plans and images; these are progressively replaced by better–but usually still imperfect–ideas”

Page 9: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

What is a frame ?

Minsky 1975 : “When one encounters a new situation (or makes a substantial change in one’s view of a problem) one selects from memory a structure called a ‘frame’. This is a remembered framework to be adapted to fit reality by changing details as necessary”

Page 10: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

What is a frame ?

Complex unit that represent situations or objects in our domain of interestData structure with typical knowledge about a particular object or conceptProposed by Marvin Minsky in 1970sUsed to capture and represent knowledge in frame-based expert systems

Page 11: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

ExampleJohn kicked the ball John

Person Male 6’4”

Ball Round White Black spots

Page 12: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Frame Examples

Quantas Boarding Pass

Carrier: QuantasName: Mr. BlackFlight: Q 101Date: 12 DecSeat: 24AFrom: MelbourneTo: SydneyBoarding: 0600Gate: 4

Air New Zealand Boarding Pass

Carrier: Air New ZealandName: Mr. WhiteFlight: NZ 101Date: 13 DecSeat: 25AFrom: MelbourneTo: ChristchurchBoarding: 1800Gate: 7

Page 13: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Frames

Has a nameA set of attributes or slots associated with it E.g. Frame Boarding Pass has attributes Carrier,

Name, Flight, Date,Seat,From, To, Boarding,Gate

Each slot has a value associated with itSlot may have a procedure associated with it to determine its valueSlot may be a pointer to another frame or set of rules

Page 14: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Frames

Rule Based systems may work with facts scattered through the knowledge baseMay have to search through knowledge that is not relevantSearch may be slow

Page 15: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

SlotsFrame is a collection of slots.May include information such as Frame name Relationship of frame to other frames

E.g. frame DELL Laptop may be member of class Computer which may belong to class Hardware

Slot Value Can be symbolic, numeric or Boolean. Can be assigned when

the frame is created or during an expert system session Default Slot Value

Taken to be true when no evidence to contrary is found. Range of Slot Value

Determines where a particular object or concept complies with the stereotype requirements

Procedural Information Procedure executed when the slot is changed or needed

Page 16: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

FacetsA facet is a means of providing extended knowledge about an attribute of a frameUsed to establish the attribute value, control end-user queries and tell the inference engine how to process the attributeValue facet Specify default and initial values

Prompt facet Enable the end-user to enter the attribute online

Inference facet Allow us to stop the inference process when a value of

a specified attribute changes

Page 17: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Classes and Instances

Frame may refer to a particular object or a group of similar objectsClass-frame describes a group of objects with common attributesInstance-frame refers to a particular instance of an objectEach frame ‘knows’ its classImplicit property of the frame

Page 18: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Class and Instance Example

INSTANCE: Quantas Boarding PassCarrier: QuantasName: Mr. BlackFlight: Q 101Date: 12 DecSeat: 24AFrom: MelbourneTo: SydneyBoarding: 0600Gate: 4

INSTANCE: Air New Zealand Boarding PassCarrier: Air New ZealandName: Mr. WhiteFlight: NZ 101Date: 13 DecSeat: 25AFrom: MelbourneTo: ChristchurchBoarding: 1800Gate: 7

CLASS: Boarding PassCarrier: [Str]Name: [Str]Flight: [Str]Date: [Str]Seat: [Str]From: [Str]To: [Str]Boarding: [Num]Gate: [Num]

Page 19: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Class Inheritance

Attributes of a class-frame represent things that are typically true for all objects in the classSlots and default values of a class frame are inherited across the class/sub-class and class/member hierarchy.Slots in instance-frames can be filled with actual data uniquely specified for each instance

Page 20: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Relationships among classes

Subclass is related to its superclass by an ‘is-a’ relationAn instance-frame can overwrite some of the typical attribute values in the hierarchyThe instance-frame remains a member of the class with access to properties further up the hierarchy even if it violates the typical value in its classRelationships in such a hierarchy constitute a process of specialisationFrame at the top of the hierarchy represents some generic concept, frames further down represent more restricted concepts

Page 21: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Relationships among objects

Generalisation denotes ‘a-kind-of’ or ‘is-a’ relationship. E.g. car is a vehicle, boat is a vehicleAggregation denotes a ‘part-of’ or ‘part-whole’ relationship in which subclasses representing components are associated with a superclass representing a whole. E.g. an engine is part of a carAssociation describes some semantic relationship between different classes unrelated otherwise. Usually appear as verbs and are bi-directional. E.g. Mr. Black owns a house, Mr. Black owns a car,

John kicked a ball

Page 22: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

More about inheritance

Inheritance is the process by which all characteristics of a class-frame are assumed by an instance frame.Instance-frame inherits from its parent-frame.Can have multiple inheritance All parents must have unique attribute names Means code reuse Reduces number of independent and specific

features of an expert system

Page 23: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Disadvantages

Cannot distinguish between essential properties and accidental propertiesMay become impossible to construct composite concepts when using multiple inheritanceLeave the knowledge engineer with difficult decisions to make about the hierarchical structure of the systems and its inheritance paths

Page 24: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Methods and DemonsA method is a procedure associated with a frame attribute that is executed whenever requestedMethod can determine an attributes specific value or execute a series of actions when the value changesA demon generally has an IF-THEN structure Executed when attribute in IF statement changes

Two types of method WHEN CHANGED

Executed immediately when an attribute value changes WHEN NEEDED

Used to obtain attribute value only when needed

Page 25: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Interaction of Rules and Frames – Inference Engine

Rule-Based Expert System Inference engine links rules in knowledge base

with data in database When goal is set up, inference engine searches

knowledge base to find rule with that goal in its consequent

If it finds such a rule and if part matches data in database, rule is fired and goal obtains its value.

If no such rule found , the queries user for value

Page 26: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Inference Engine

Frame-Based System Inference engine also searches for goal Rules play auxiliary role. Frames

represent major source of knowledge. Methods and demons used to add

actions to frames. Goal can be established either in

method or demon.

Page 27: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Inference engine

Frame-based system Based on goal, inference engine finds rules

whose consequents find goal of interest Examines these rules one at a time in order

they appear in the rule base Examines the validity of each antecedent in

the first rule This may require the If all antecedents are valid, concludes the goal If any of the antecedents are invalid, concludes

goal is invalid and will proceed to next rule

Page 28: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Inference engine

Has to obtain value from WHEN NEEDED method only when it has not been determined from rule baseSearch order for attribute value has to be determined firstAttach a SEARCH ORDER facet to an attribute to indicate where and in what order to obtain attribute value E.g. set the order so that it first searches the

rule base and only when this fails executes when needed

Page 29: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Rule-Based Expert Systems

Set of rules represents the domain knowledge useful for problem solving.Each rule captures some heuristic of the problem.Each rule adds some new knowledge and thus makes the system smarter.Rule base can be easily modified by changing, adding and subtracting rules.

Page 30: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Frame-based Expert Systems

Overall hierarchical structure of knowledge is decided first.Classes and attributes are identified.Hierarchical relationship between frames are established.Architecture allows us to add actions to the frames through methods and demons.

Page 31: FT228/4 Knowledge Based Decision Support Systems Frame-Based Expert Systems Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky

Building Frame-based Expert System

Specify the problem and define the scope of the systemDetermine the classes and their attributesDefine instances.Design displays.Define WHEN CHANGED and WHEN NEEDED methods, and demons.Define rules.Evaluate and expand the system.