AI-LEC-3-Expert Systems
AI-LEC-3-Expert Systems
Lecture No. 3
Expert Systems
• ES perform tasks for specific domains that require
human expertise
– Medical diagnosis, fault diagnosis, status monitoring, data
interpretation, computer configuration, etc.
• ES solve problems using domain-specific knowledge
• Domain knowledge is acquired by interviewing human
experts
• ES cannot operate in situations requiring common sense
• The expert systems are the computer applications
developed to solve complex problems in a particular
domain, at the level of extra-ordinary human
intelligence and expertise.
Structure of a rule-based expert system
Z1 If ?x has hair
Then ?x is a mammal
Z2 If ?x gives milk Database
Then ?x is a mammal ------------
Z3 If ?x has feathers
Then ?x is a bird F1) Stretch has hair
Z6 If ?x is a mammal F2) Stretch chews cud
?x has pointed teeth F3) Stretch has long legs
?x has claws F4) Stretch has a long neck
?x has forward-pointing eyes F5) Stretch has tawny color
Then ?x is a carnivore F6) Stretch has dark spots
Z8 If ?x is a mammal
?x chews cud
Then ?x is an ungulate
Z11 If ?x is an ungulate
?x has long legs
?x has long neck
?x has tawny color
?x has dark spots
Forward Chaining
• Reason FORWARD from facts/rules to (hopefully) a needed goal
• generate new facts
• Rule antecedents are compared with facts from database
• If match, add consequents to database
• Repeat as long as needed
• Forward chaining is “data driven”
• It is a strategy of an expert system to answer the question, “What’s next?
Approach 1 Approach 2
1) ON(A,B) 1) ON(B,C)
1) Try PutOn(C,Table) to clear A 1) Try PutOn(B,C)
2) PutOn(A,B) to achieve first goal 2) ON(A,C)
2) ON(B,C) We are farther from this goal now than
To achieve this goal, B will be re-cleared, we were in the initial state!
undoing first goal!
Sussman’s Anomaly
A C
B
Sussman’s Anomaly
• This problem can be solved, but it cannot be
attacked by first applying all the operators to
achieve one goal, and then applying operators to
achieve another goal.
• The problem is that we have forced an ORDERING
on the operators. Sometimes steps for multiple
goals need to be interleaved.
• Partial-order planning is a type of plan generation
in which ordering is imposed on operators ONLY
when it has to be imposed in order to achieve the
goals.
Plan Space Planning
• Node (state space): world state
• Node (plan space): partial plan
• Operator (state space): next step in plan sequence
• Operator (plan space)
– Add a link from existing action to open condition (precondition
that is not yet fulfilled)
– Add a plan step to fulfill open condition
– Order a step in the sequence
• Gradually move from incomplete/vague plans to complete
plans.
We call planners that use this type of approach partial-order
planners
• Example: Have shoes on both feet.
Partially-Ordered Plans
• The initial plan has only two steps (Start and
Finish), 1 ordering (Start before Finish).
• A sock must be put on before a shoe.
Summery of Today’s Lecture
• Structure of a rule-based expert system
• Expert Systems Shells
• Characteristics of an expert system
• Comparison of expert systems with
conventional systems and human experts