Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Rule-based Systems (RBS) ..

Basic concept

Dr. Abdullah Almessmar


Rule-based Expert Systems
 Rule-based Expert Systems is a part of Expert
systems.
 What is Expert systems?
 They are computer programs that try to replicate
knowledge and skills of human experts in some area, and
then solve problems in this area (the way human experts
would).
Expert Systems
 Expert Systems take their roots in Cognitive Science
 The study of human mind using combination of AI and
psychology.
 ES were the first successful applications of AI to real-
world problems solving problems in medicine,
chemistry, finance and even in space (Space Shuttle,
robots on other planets).
 In business, ES allow many companies to save $
millions
Rule-based Expert Systems
 Idea: to capture the knowledge of a human expert in a specialized
domain and embody it within a software system.
 The knowledge is stored as rules of the form:
 IF condition THEN action

 Rule-based systems were invented in the early 1970’s and are still
in use today:
 DENDRAL (Buchanan et al, 1969) – an “expert system” for analysing
chemical (intended for studying the soil on Mars)
 MYCIN (Feigenbaum et al, 1972) – system for diagnosis of infectious
blood diseases. Introduced certainty factors for handling uncertainty
Rule-Based Systems Today
 Modern rule-based systems are still based on many of
the ideas of the early pioneers, but are often
integrated within more complex systems.
 Some modern examples of rule based systems:
 The NHS Direct adviser
 The Automobile Diagnosis adviser
 Ikea online assistant
 American Express Authorizer’s Assistant
Architecture of a rule based system
 Knowledge base: contains the rules embodying expert
knowledge about the problem domain
 Database: contains the set of known facts about the problem
currently being solved
 Inference engine: carries out the reasoning process by
linking the rules with the known facts to find a solution
 Explanation facilities: provides information to user about
the reasoning steps that are being followed
 User interface: communication between the user and the
system
Architecture of a rule based system
Rule-based Expert Systems
 In rule-based approach, the symbolic knowledge is divided
into two types:
 Declarative: these are propositions describing facts, objects or
events that are true (i.e. happening or that we observe).
 Procedural: these are logical rules (inferences) that we can use
to reason using the facts and make decisions.
 There is evidence that human brain learns and remembers
these types of knowledge is some different ways. Rules
(procedural knowledge) are usually harder to describe and
forget.
Facts (Propositions)
 Facts usually are represented in a form of logical
propositions:
 Tiger is a Felidae, Felidae has four legs, 4 is a sum of 2 and 2.

 Facts can be True or False.


Rules (Implications)
 Rules have the form:
 IF condition THEN action
 Examples:
 IF Tiger is a Felidae THEN Tiger has four legs
 IF the price is high THEN sell
 Condition can be a fact or a collection of facts, Action
can be adding another fact, asking a question, etc.
Rules (Implications)
 The IF. . . part is called the left-hand-side (or the
antecedent, the premise) of a rule.
 The THEN. . . part is called the right-hand-side (or
the consequent) of a rule.
Example: Weather forecast ES
Complex patterns
 The condition part of a rule may have several facts
connected by logical operators NOT, AND, OR:

 Example:

 Such a complex proposition (pattern) is just a more


complex fact.
 Logical rules for negation (NOT), conjunction (AND) and
disjunction (OR) are used to evaluate the condition.
Inference in a Rule-Based systems
 The inference process used in a rule-based system is
deductive inference.
 This means that the rules of logic are used to deduce
new knowledge from existing knowledge and rules.
 There are various different approaches to managing
deductive inference and the most common ones:
 Forward Chaining
 Backward Chaining
Forward Chaining
 Suppose we have a set of rules of the form
 If A and B Then C
 Then we may apply such rules to reason forwards
from the known facts in our database, to establish
new conclusions (i.e. facts) to add to the database.
 Specifically, if A and B are facts in our database, we
can apply the rule above, and add C to the database.
This is also called data-driven reasoning.
Forward Chaining
 The problem with this approach is controlling it.
 At any given stage there may be many different rules
which may be chosen to apply to extend the body of
knowledge.
 Identifying them all is a potential problem (matching).
 Deciding which one to use is another (conflict resolution).
Forward Chaining
 This problem can be solved by alternative approaches:
 Use the first rule found.

 Attach priorities to rules.

 Use the most specific rule possible.

 Use heuristics to decide which rule will be most

advantageous.
 Investigate in parallel the results of using different rules.

 Forward chaining is useful in RBS where no specific goal is


being explored. It was used in the DENDRAL system for soil
analysis.
Backward Chaining
 We can think of our rules as:
 C If A and B

 We can then think of applying such rules in a goal-driven manner.


 If we have a specific goal in view (e.g., we are trying to confirm
the diagnosis of some disease) then:
 To justify C, apply the rule to generate sub-goals A and B.

 Then attempt to justify the sub-goals in the same manner, by

generating further sub-goals, until ...


 all sub-goals are facts present in the database.
Backward Chaining
 In general, this also requires some control:
 Where alternative rules exist, the order may matter.
 Many dead-ends may be tried before the solution is found.

 Backward chaining was used in the MYCIN diagnosis system


Advantages of Rule-Based systems
 Automated logic and reasoning
 Explain of solutions.

 Example:

 What about Ostrich?


Limitations of Rule-Based systems
 It is hard to describe all cases by rules.
 The knowledge is very task dependent and difficult to
adapt.

You might also like