negnevitsky, pearson education, 2002 1 introduction, or what is knowledge? knowledge is a...

27
Negnevitsky, Pearson Education, 2002 Negnevitsky, Pearson Education, 2002 Introduction, or what is Introduction, or what is knowledge? knowledge? Knowledge Knowledge is a theoretical or is a theoretical or practical understanding of a practical understanding of a subject or a domain. Knowledge is subject or a domain. Knowledge is also the sum of what is currently also the sum of what is currently known, and apparently knowledge is known, and apparently knowledge is power. Those who possess power. Those who possess knowledge are called experts. knowledge are called experts. Anyone can be considered a Anyone can be considered a domain domain expert expert if he or she has deep if he or she has deep knowledge (of both facts and knowledge (of both facts and rules) and strong practical rules) and strong practical experience in a particular domain. experience in a particular domain. The area of the domain may be The area of the domain may be

Upload: isabella-johnson

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

 Negnevitsky, Pearson Education, The term rule in AI, which is the most commonly used type of knowledge representation, can be defined as an IF-THEN structure that relates given information or facts in the IF part to some action in the THEN part. A rule provides some description of how to solve a problem. Rules are relatively easy to create and understand. The term rule in AI, which is the most commonly used type of knowledge representation, can be defined as an IF-THEN structure that relates given information or facts in the IF part to some action in the THEN part. A rule provides some description of how to solve a problem. Rules are relatively easy to create and understand. Any rule consists of two parts: the IF part, called the antecedent (premise or condition) and the THEN part called the consequent (conclusion or action). Any rule consists of two parts: the IF part, called the antecedent (premise or condition) and the THEN part called the consequent (conclusion or action). Rules as a knowledge representation technique

TRANSCRIPT

Page 1: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 1

Introduction, or what is knowledge?Introduction, or what is knowledge? KnowledgeKnowledge is a theoretical or practical is a theoretical or practical

understanding of a subject or a domain. Knowledge understanding of a subject or a domain. Knowledge is also the sum of what is currently known, and is also the sum of what is currently known, and apparently knowledge is power. Those who apparently knowledge is power. Those who possess knowledge are called experts.possess knowledge are called experts.

Anyone can be considered a Anyone can be considered a domain expertdomain expert if he or if he or she has deep knowledge (of both facts and rules) she has deep knowledge (of both facts and rules) and strong practical experience in a particular and strong practical experience in a particular domain. The area of the domain may be limited. In domain. The area of the domain may be limited. In general, an expert is a skilful person who can do general, an expert is a skilful person who can do things other people cannot.things other people cannot.

Page 2: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 2

The human mental process is internal, and it is too The human mental process is internal, and it is too complex to be represented as an algorithm. complex to be represented as an algorithm. However, most experts are capable of expressing However, most experts are capable of expressing their knowledge in the form of their knowledge in the form of rulesrules for problem for problem solving.solving.

IFIFthe ‘traffic light’ is greenthe ‘traffic light’ is greenTHENTHEN the action is gothe action is go

IFIFthe ‘traffic light’ is redthe ‘traffic light’ is redTHENTHEN the action is stopthe action is stop

Page 3: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 3

The term The term rulerule in AI, which is the most commonly in AI, which is the most commonly used type of knowledge representation, can be used type of knowledge representation, can be defined as an IF-THEN structure that relates given defined as an IF-THEN structure that relates given information or facts in the IF part to some action in information or facts in the IF part to some action in the THEN part. A rule provides some description the THEN part. A rule provides some description of how to solve a problem. Rules are relatively of how to solve a problem. Rules are relatively easy to create and understand.easy to create and understand.

Any rule consists of two parts: the IF part, called Any rule consists of two parts: the IF part, called the the antecedentantecedent ( (premisepremise or or conditioncondition) and the ) and the THEN part called the THEN part called the consequentconsequent ( (conclusionconclusion or or actionaction).).

Rules as a knowledge representation techniqueRules as a knowledge representation technique

Page 4: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 4

IFIF antecedentantecedentTHENTHEN consequentconsequent

A rule can have multiple antecedents joined by the A rule can have multiple antecedents joined by the keywords keywords ANDAND ( (conjunctionconjunction), ), OROR ( (disjunctiondisjunction) or ) or a combination of both.a combination of both.

IFIF antecedent 1antecedent 1 IF IF antecedent 1antecedent 1 AND AND antecedent 2antecedent 2 OR OR antecedent 2antecedent 2 .. . . .. . . .. . .

AND AND antecedent antecedent nn OR OR antecedent antecedent nnTHEN THEN consequentconsequent THEN THEN consequentconsequent

Page 5: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 5

The antecedent of a rule incorporates two parts: an The antecedent of a rule incorporates two parts: an objectobject ( (linguistic objectlinguistic object) and its) and its valuevalue. The object and . The object and its value are linked by an its value are linked by an operatoroperator..

The operator identifies the object and assigns the The operator identifies the object and assigns the value. Operators such as value. Operators such as isis, , areare, , is notis not, , are notare not are are used to assign a used to assign a symbolic valuesymbolic value to a linguistic object. to a linguistic object.

Expert systems can also use mathematical operators Expert systems can also use mathematical operators to define an object as numerical and assign it to the to define an object as numerical and assign it to the numerical valuenumerical value..

IFIF ‘age of the customer’ < 18‘age of the customer’ < 18ANDAND ‘cash withdrawal’ > 1000‘cash withdrawal’ > 1000THENTHEN ‘signature of the parent’ is required‘signature of the parent’ is required

Page 6: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 6

Rules can represent relations, recommendations, Rules can represent relations, recommendations, directives, strategies and heuristics:directives, strategies and heuristics:

RelationRelationIFIF the ‘fuel tank’ is emptythe ‘fuel tank’ is emptyTHENTHEN the car is deadthe car is dead

RecommendationRecommendationIFIF the season is autumnthe season is autumnANDAND the sky is cloudythe sky is cloudyANDAND the forecast is drizzlethe forecast is drizzleTHENTHEN the advice is ‘take an umbrella’the advice is ‘take an umbrella’

DirectiveDirectiveIFIF the car is deadthe car is deadANDAND the ‘fuel tank’ is emptythe ‘fuel tank’ is emptyTHENTHEN the action is ‘refuel the car’the action is ‘refuel the car’

Page 7: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 7

StrategyStrategyIFIF the car is deadthe car is deadTHENTHEN the action is ‘check the fuel tank’;the action is ‘check the fuel tank’;

step1 is completestep1 is complete

IFIF step1 is completestep1 is completeANDAND the ‘fuel tank’ is fullthe ‘fuel tank’ is fullTHENTHEN the action is ‘check the battery’;the action is ‘check the battery’;

step2 is completestep2 is complete HeuristicHeuristic

IFIF the spill is liquidthe spill is liquidANDAND the ‘spill pH’ < 6the ‘spill pH’ < 6ANDAND the ‘spill smell’ is vinegarthe ‘spill smell’ is vinegarTHENTHEN the ‘spill material’ is ‘acetic acid’the ‘spill material’ is ‘acetic acid’

Page 8: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 8

The The domain expertdomain expert is a knowledgeable and skilled is a knowledgeable and skilled person capable of solving problems in a specific person capable of solving problems in a specific area or area or domaindomain. This person has the greatest . This person has the greatest expertise in a given domain. This expertise is to be expertise in a given domain. This expertise is to be captured in the expert system. Therefore, the captured in the expert system. Therefore, the expert must be able to communicate his or her expert must be able to communicate his or her knowledge, be willing to participate in the expert knowledge, be willing to participate in the expert system development and commit a substantial system development and commit a substantial amount of time to the project. The domain expert amount of time to the project. The domain expert is the most important player in the expert system is the most important player in the expert system development team.development team.

Page 9: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 9

In the early seventies, Newell and Simon from In the early seventies, Newell and Simon from Carnegie-Mellon University proposed a production Carnegie-Mellon University proposed a production system model, the foundation of the modern rule-system model, the foundation of the modern rule-based expert systems.based expert systems.

The production model is based on the idea that The production model is based on the idea that humans solve problems by applying their knowledge humans solve problems by applying their knowledge (expressed as production rules) to a given problem (expressed as production rules) to a given problem represented by problem-specific information. represented by problem-specific information.

The production rules are stored in the long-term The production rules are stored in the long-term memory and the problem-specific information or memory and the problem-specific information or facts in the short-term memory.facts in the short-term memory.

Structure of a rule-based expert systemStructure of a rule-based expert system

Page 10: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 10

Production system modelProduction system model

Conclusion

REASONING

Long-term Memory

Production Rule

Short-term Memory

Fact

Page 11: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 11

Basic structure of a rule-based expert systemBasic structure of a rule-based expert system

Inference Engine

Knowledge Base

Rule: IF-THEN

Database

Fact

Explanation Facilities

User Interface

User

Page 12: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 12

The The knowledge baseknowledge base contains the domain contains the domain knowledge useful for problem solving. In a rule-knowledge useful for problem solving. In a rule-based expert system, the knowledge is represented based expert system, the knowledge is represented as a set of rules. Each rule specifies a relation, as a set of rules. Each rule specifies a relation, recommendation, directive, strategy or heuristic recommendation, directive, strategy or heuristic and has the IF (condition) THEN (action) structure. and has the IF (condition) THEN (action) structure. When the condition part of a rule is satisfied, the When the condition part of a rule is satisfied, the rule is said torule is said to fire fire and the action part is executed. and the action part is executed.

The The databasedatabase includes a set of facts used to match includes a set of facts used to match against the IF (condition) parts of rules stored in the against the IF (condition) parts of rules stored in the knowledge base.knowledge base.

Page 13: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 13

The The inference engineinference engine carries out the reasoning carries out the reasoning whereby the expert system reaches a solution. It whereby the expert system reaches a solution. It links the rules given in the knowledge base with the links the rules given in the knowledge base with the facts provided in the database.facts provided in the database.

The explanation facilities enable the user to ask the expert system how a particular conclusion is reached and why a specific fact is needed. An expert system must be able to explain its reasoning and justify its advice, analysis or conclusion.

The user interface is the means of communication between a user seeking a solution to the problem and an expert system.

Page 14: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 14

Complete structure of a rule-based expert systemComplete structure of a rule-based expert system

User

ExternalDatabase External Program

Inference Engine

Knowledge Base

Rule: IF-THEN

Database

Fact

Explanation Facilities

User Interface DeveloperInterface

Expert System

Expert

Knowledge Engineer

Page 15: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 15

An expert system is built to perform at a human An expert system is built to perform at a human expert level in a expert level in a narrow, specialised domainnarrow, specialised domain. . Thus, the most important characteristic of an expert Thus, the most important characteristic of an expert system is its high-quality performance. No matter system is its high-quality performance. No matter how fast the system can solve a problem, the user how fast the system can solve a problem, the user will not be satisfied if the result is wrong. will not be satisfied if the result is wrong.

On the other hand, the speed of reaching a solution On the other hand, the speed of reaching a solution is very important. Even the most accurate decision is very important. Even the most accurate decision or diagnosis may not be useful if it is too late to or diagnosis may not be useful if it is too late to apply, for instance, in an emergency, when a apply, for instance, in an emergency, when a patient dies or a nuclear power plant explodes.patient dies or a nuclear power plant explodes.

Characteristics of an expert systemCharacteristics of an expert system

Page 16: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 16

Expert systems apply Expert systems apply heuristicsheuristics to guide the to guide the reasoning and thus reduce the search area for a reasoning and thus reduce the search area for a solution.solution.

A unique feature of an expert system is its A unique feature of an expert system is its explanation capabilityexplanation capability. It enables the expert . It enables the expert system to review its own reasoning and explain its system to review its own reasoning and explain its decisions.decisions.

Expert systems employ Expert systems employ symbolic reasoningsymbolic reasoning when when solving a problem. Symbols are used to represent solving a problem. Symbols are used to represent different types of knowledge such as facts, concepts different types of knowledge such as facts, concepts and rules.and rules.

Page 17: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 17

In expert systems, In expert systems, knowledge is separated from its knowledge is separated from its processingprocessing (the knowledge base and the inference (the knowledge base and the inference engine are split up). A conventional program is a engine are split up). A conventional program is a mixture of knowledge and the control structure to mixture of knowledge and the control structure to process this knowledge. This mixing leads to process this knowledge. This mixing leads to difficulties in understanding and reviewing the difficulties in understanding and reviewing the program code, as any change to the code affects both program code, as any change to the code affects both the knowledge and its processing.the knowledge and its processing.

When an expert system shell is used, a knowledge When an expert system shell is used, a knowledge engineer or an expert simply enters rules in the engineer or an expert simply enters rules in the knowledge base. Each new rule adds some new knowledge base. Each new rule adds some new knowledge and makes the expert system smarter.knowledge and makes the expert system smarter.

Page 18: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 18

Inference engine cycles via a match-fire procedureInference engine cycles via a match-fire procedure

Knowledge Base

Database

Fact: A is x

Match Fire

Fact: B is y

Rule: IF A is x THEN is y

Page 19: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 19

An example of an inference chainAn example of an inference chain

A X

B

E

Y

DZ

Page 20: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 20

Forward chainingForward chaining Forward chaining is the Forward chaining is the data-driven reasoningdata-driven reasoning. .

The reasoning starts from the known data and The reasoning starts from the known data and proceeds forward with that data. Each time only proceeds forward with that data. Each time only the topmost rule is executed. When fired, the rule the topmost rule is executed. When fired, the rule adds a new fact in the database. Any rule can be adds a new fact in the database. Any rule can be executed only once. The match-fire cycle stops executed only once. The match-fire cycle stops when no further rules can be fired.when no further rules can be fired.

Page 21: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 21

Forward chainingForward chaining

Match FireKnowledge Base

Database

A B C D E

X

Match FireKnowledge Base

Database

A B C D E

LX

Match FireKnowledge Base

Database

A C D E

YL

B

X

Match FireKnowledge Base

Database

A C D E

ZY

B

LX

Cycle 1 Cycle 2 Cycle 3

X & B & E YZY & D

LCL & M

A X

N

X & B & E YZY & D

LCL & M

A X

N

X & B & E YZY & D

LCL & M

A X

N

X & B & E YZY & D

LCL & M

A X

N

Page 22: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 22

Backward chainingBackward chaining Backward chaining is the Backward chaining is the goal-driven reasoninggoal-driven reasoning. .

In backward chaining, an expert system has the goal In backward chaining, an expert system has the goal (a (a hypothetical solutionhypothetical solution) and the inference engine ) and the inference engine attempts to find the evidence to prove it. First, the attempts to find the evidence to prove it. First, the knowledge base is searched to find rules that might knowledge base is searched to find rules that might have the desired solution. Such rules must have the have the desired solution. Such rules must have the goal in their THEN (action) parts. If such a rule is goal in their THEN (action) parts. If such a rule is found and its IF (condition) part matches data in the found and its IF (condition) part matches data in the database, then the rule is fired and the goal is database, then the rule is fired and the goal is proved. However, this is rarely the case.proved. However, this is rarely the case.

Page 23: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 23

Natural knowledge representationNatural knowledge representation.. An expert An expert usually explains the problem-solving procedure usually explains the problem-solving procedure with such expressions as this: “In such-and-such with such expressions as this: “In such-and-such situation, I do so-and-so”. These expressions can situation, I do so-and-so”. These expressions can be represented quite naturally as IF-THEN be represented quite naturally as IF-THEN production rules.production rules.

Uniform structureUniform structure.. Production rules have the Production rules have the uniform IF-THEN structure. Each rule is an uniform IF-THEN structure. Each rule is an independent piece of knowledge. The very syntax independent piece of knowledge. The very syntax of production rules enables them to be self-of production rules enables them to be self-documented.documented.

Advantages of rule-based expert systemsAdvantages of rule-based expert systems

Page 24: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 24

Separation of knowledge from its processingSeparation of knowledge from its processing.. The structure of a rule-based expert system The structure of a rule-based expert system provides an effective separation of the knowledge provides an effective separation of the knowledge base from the inference engine. This makes it base from the inference engine. This makes it possible to develop different applications using the possible to develop different applications using the same expert system shell. same expert system shell.

Dealing with incomplete and uncertain Dealing with incomplete and uncertain knowledgeknowledge.. Most rule-based expert systems are Most rule-based expert systems are capable of representing and reasoning with capable of representing and reasoning with incomplete and uncertain knowledge.incomplete and uncertain knowledge.

Advantages of rule-based expert systemsAdvantages of rule-based expert systems

Page 25: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 25

Opaque relations between rulesOpaque relations between rules.. Although the Although the individual production rules are relatively simple and individual production rules are relatively simple and self-documented, their logical interactions within the self-documented, their logical interactions within the large set of rules may be opaque. Rule-based large set of rules may be opaque. Rule-based systems make it difficult to observe how individual systems make it difficult to observe how individual rules serve the overall strategy.rules serve the overall strategy.

Ineffective search strategyIneffective search strategy.. The inference engine The inference engine applies an exhaustive search through all the applies an exhaustive search through all the production rules during each cycle. Expert systems production rules during each cycle. Expert systems with a large set of rules (over 100 rules) can be slow, with a large set of rules (over 100 rules) can be slow, and thus large rule-based systems can be unsuitable and thus large rule-based systems can be unsuitable for real-time applications.for real-time applications.

Disadvantages of rule-based expert systemsDisadvantages of rule-based expert systems

Page 26: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 26

Inability to learnInability to learn.. In general, rule-based expert In general, rule-based expert systems do not have an ability to learn from the systems do not have an ability to learn from the experience. Unlike a human expert, who knows experience. Unlike a human expert, who knows when to “break the rules”, an expert system cannot when to “break the rules”, an expert system cannot automatically modify its knowledge base, or adjust automatically modify its knowledge base, or adjust existing rules or add new ones. The knowledge existing rules or add new ones. The knowledge engineer is still responsible for revising and engineer is still responsible for revising and maintaining the system.maintaining the system.

Disadvantages of rule-based expert systemsDisadvantages of rule-based expert systems

Page 27: Negnevitsky, Pearson Education, 2002 1 Introduction, or what is knowledge? Knowledge is a theoretical or practical understanding of a subject or a domain

Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 27