Chapter 4 AI
Chapter 4 AI
Knowledge and
Reasoning
Outline
– Knowledge?
– Logical Agents (Knowledge Based Agents)
– Propositional Logic
– Predicate (First-Order)Logic
– Knowledge Representation
– Knowledge-based Systems (ES)
Knowledge ???
• Data – ???
• Information – ???
• Knowledge – ???
• Wisdom– ???
Knowledge Hierarchy
• Data
– The raw material of information
• Information
– Data organized and presented in a particular
manner
• Knowledge
– “Justified true belief”
– Information that can be acted upon
• Wisdom
– Distilled and integrated knowledge
– Demonstrative of high-level “understanding”
Knowledge Hierarchy
More refined and abstract
Wisdom
Knowledge
Information
Data
Example
• Data
– 98.6º F, 99.5º F, 100.3º F, 101º F, …
• Information
– Hourly body temperature: 98.6º F, 99.5º F,
100.3º F, 101º F, …
• Knowledge
– If you have a temperature above 100º F, you
most likely have a fever
• Wisdom
– If you don’t feel well, go see a doctor
Knowledge-Based Agents
• Hold information about the world
in a Knowledge Base (KB)
• KB is built up of sentences.
• KB contains background
knowledge
Knowledge-Based Agents
• A knowledge-based agent is an agent that
consists of two parts: a knowledge base and
an inference engine
male(david). ?- parent(X,Y).
female(susan). X = david,
parent(david,susan). Y = susan.
Representation, Reasoning and Logic
First-Order Logic
assumes that the
world contains:
E.g. people,
E.g. brother of,
houses, numbers,
Eg. blue, oval, bigger than, has
colors, football E.g. sqrt,
even, large, ... color, occurred
games, wars,
after, owns, …
centuries, …
First-order logic
• First-order logic (FOL) models the world in terms of
– Objects, which are things with individual identities
– Properties of objects that distinguish them from other
objects
– Relations that hold among sets of objects
– Functions, which are a subset of relations where there
is only one “value” for any given “input”
• Examples:
– Objects: Students, lectures, companies, cars ...
– Relations: Brother-of, bigger-than, outside, part-of, has-
color, occurs-after, owns, visits, precedes, ...
– Properties: blue, oval, even, large, ...
– Functions: father-of, best-friend, second-half, one-
more-than ...
Syntax of First-Order Logic
• Constants KingJohn, 2, …
• Predicates Brother, >, …
• Functions Sqrt, LeftArmOf, …
• Variables x, y, a, b, …
• Connectives ¬
• Equality =
• Quantifiers $"
Components of First-Order Logic
• Term
– Constant, e.g. red
– Function of constant, e.g. color(block1) … color of block1
• Sentence
– Predicate relating objects (no variable)
• brother (john, richard)
• married (mother(john), father(john))
• Complex Sentences
– Sentences + logical connectives
• brother (john, richard) brother (john, father(john))
Components of First-Order Logic
• Quantifiers
– Each quantifier defines a variable for the duration of the
following expression, and indicates the truth of the
expression…
isa
has_part
mammal head
isa
size colour
large elephant grey
instance_of instance_of
likes
Clyde Nellie apples
Approaches….
6- Frames: also do play a big role in
representing inheritable knowledge
Mammal:
subclass: Animal
has-part: head
Elephant:
subclass: Mammal
colour: grey
size: large
Nellie:
instance: Elephant
likes: apples
Clyde:
instance: Elephant
Knowledge-base Systems
(Expert Systems)
• Computer software that:
– Emulates human expert
– Deals with well defined domains of expertise
– Is able to solve real-world problems
– Is able to act as a cost-effective consultant
– Can explains reasoning behind any solutions it
finds
– Should be able to learn from experience.
Expert Systems…
An expert system is a system that employs human
knowledge captured in a computer to solve
problems that ordinarily require human expertise.
(Turban)
A computer program that emulates the behaviour of
human experts who are solving real-world
problems associated with a particular domain of
knowledge. (Pigford & Braur)
Expert Systems manipulate knowledge while
conventional programs manipulate data.
Example
• MYCIN was an early expert system that
used artificial intelligence to identify
bacteria causing severe infections, such as
bacteremia and meningitis, and to
recommend antibiotics, with the dosage
adjusted for patient's body weight.
• It was written in LISP as the doctoral
dissertation of Edward Shortliffe.
MYCIN Example
Types of Expert Systems
Classification based on “Expertness”
An assistant፡ used for routine analysis
and points out those portions of the work
where the human expertise is required.
A colleague: the user talks over the
Expert System
Knowledge
Base
User
Interface
Inference
Engine
User
Advantages of Expert Systems
Capture of scarce expertise
Superior problem solving
Reliability
Work with incomplete information
Transfer of knowledge
Disadvantages of ES
High development costs
Only work well in narrow domains
Not all problems are suitable
Expertise is hard to extract from experts
Knowledge not always readily available