Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 22

Expert Systems

Resources

Wikipedia [link]
handout from AI illuminated, pages
46-50, 75-78, 81-83, 144-152, 267-284
http://www.cs.usfca.edu/www.AlanTuring.net/turing_archive/pages/Referenc
[distance learning link]
AI
 So far: Machine Learning
– Inductive reasoning
 Now: Logical Inference
– Deductive reasoning
 An expert system is a computer program
dedicated to solving problems and giving advice
within a specialised area of knowledge.
 A good system can match the performance of a
human specialist; expert systems are in wide
commercial use.
 Uses include medical diagnosis, chemical
analysis, credit authorization, financial
management, corporate planning, automobile
design and manufacture, camera lens design,
computer installation design, airline scheduling,
cargo placement, and on and on….
Expert Systems
“Common sense” hard to program - just
so broad.

“Deep Knowledge” / Expert System /


Fact-Rich easier to program if the
domain is limited.

Hundreds of applications: medical,


science, business, …

One of great success stories of AI


Expert Systems
 http://www.aiinc.ca/demos/whale.ht

 http://www.myacquire.com/aiinc/sto
edural Knowledge

cision diagram is a kind


xpert system

to implement this
c in a computer program

n knowledge not
cally “stored” in this way
Big View

Knowledge Base

User

Inference Engine
Knowledge Base
 stores facts about a domain
 often in form of “if-then”
rules
 example
 [FROM CS Illuminated p 420]
example rule in
knowledge base
(from MYCIN - bacterial infections -
1972)

If the site of the culture is blood, and the stain of


the organism is gramneg, and the morphology of
the organism is rod, and the patient has been
seriously burned, then there is evidence (.4) that
the identity of the organism is pseudomonas.

 Thousands of rules possible


 Knowledge Engineer works in concert
with domain expert to extract useful
Inference Engine
 Abstractrules of logic showing
what deductions can be made.

Crash course: propositional


logic symbols:

AND (∧), OR (∨), IMPLIES (→),


NOT (¬)
Truth Table for Implies
A B
A →B
F F ?
T F F
T T T
F T ?

Not the same as


“causes” !!
Example Translation
1. If Pat was involved, then
Quinn was too.
2. Pat or Ralph did it.
3. If Ralph did it, then so did
Sam.

4. P → has
Sam Q a good alibi.
• P ∨ R Translation into logic statements
• R → S
• ¬S
example deduction rules
If you know Then you
can
p, p → q conclude
q forward
chaining
p ∧ q p
p p ∨ q
p ∨ q, q → p ∨ r resolution

r
p → q, ¬q ¬p contraposit
ive
p ∨ q, ¬p q
Example Deduction:
“whodunnit”
1. If Pat was involved, then
Quinn was too.
2. Pat or Ralph did it.
3. If Ralph did it, then so did
Sam.

4. P → has
Sam Q a good alibi.
• P ∨ R Translation into logic statements
• R → S
• ¬S
n P → Q
n P ∨ R
n R → S
n ¬S

stmt 3, 4, contrapositive,
gives:
n ¬R
stmt 2, 5 implies
9. P
stmts 6, 1 implies
11. Q

Therefore, Pat and Quinn are guilty.


Inference Engine
 Two methods
– forward chaining (you’ve just seen
it)
 start with known facts
 look for left sides of implications
that are met, and conclude the right
side.
 repeat
– backward chaining (example to
follow)
 goal to conclude some goal “fact” G
 find implication rule with right side
G
RULES (from KB)
n A ∧ B → C
FORWARD CHAINING
n A → D
(b) Facts A, B, and
n C ∧ D → E rule (1) gives
n B ∧ E ∧ F → C
H (c) Fact A, rule (2)
n A ∧ E → G gives D
FACTS (from (d) (a), (b), and (3)
user): gives E
A, B, F (e) Fact A, (c), rule
(5) gives G
GOAL: G
THUS, G is true.
RULES (from KB)
n A ∧ B → C
n A → D BACKWARD CHAINING
n C ∧ D → E (b) Goal G
n B ∧ E ∧ F → H (c) By (5), subgoals:
n A ∧ E → G A, E
(d) Subgoal A met
(FACT)
FACTS (from (e) By (3), subgoals C,
user): D
A, B, F (f) By (2), subgoal D
met
GOAL: G (g) By (1), subgoals A,
B
(h) A, B met (FACTS)
the process

USER SUPPLIED FACTS DOMAIN KNOWLEDGE


system may request
more facts from user Main task in
INFERENCE ENGINE building an
expert
chaining with system
logical rules

MORE FACTS

CONCLUSIONS
Do we have an algorithm
for Logical Inference?
 Input assumptions + G
 Keep applying each rule of
inference.
 Stop when we get to G

Does this terminate?


Which problem does this remind you of?
Can we think of an algorithm that works?
(Yes we can !!)
Explainable results
Nice feature of expert systems
is that typically they can
explain the reasons for their
answers to human users:

“G is true because A and B were


found to be true.”
“A is true because C and D are
true.”

You might also like