0% found this document useful (0 votes)
51 views42 pages

Chapter 4 AI

The document discusses knowledge representation and different approaches to representing knowledge including rules, logic, natural language, databases, semantic nets, and frames. It also covers propositional logic and first-order logic, their syntax, semantics, and inference capabilities.

Uploaded by

beyagetu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views42 pages

Chapter 4 AI

The document discusses knowledge representation and different approaches to representing knowledge including rules, logic, natural language, databases, semantic nets, and frames. It also covers propositional logic and first-order logic, their syntax, semantics, and inference capabilities.

Uploaded by

beyagetu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Chapter 4

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

knowledge base Domain-Specific content

Inference engine Domain-independent algorithm


Knowledge-Based Agents
• The knowledge base contains the domain-
specific knowledge that the agent has of its
environment.
• knowledge base can consist of facts, but
also rules that describe the structure of the
environment.
– male(abebe). ………. fact
– brotherof(X,Y):-parentof(Z,X),parentof(Z,Y),
not(X=Y), male(X). ……… rule
Knowledge-Based Agents
• The inference engine is domain-
independent.
• It consists of algorithms that take the
contents of the knowledge base and infer
(i.e. deduce) new knowledge about the
world.
Knowledge-Based Agents
• Knowledge based agents are particularly
useful in partially observable environments,
• If the agent cannot directly perceive parts of
the environment it may be able to infer
some knowledge about it based on the
things that it does know.
• The knowledge in the knowledge base (KB)
must be represented as sentences in some
formal logical language. (Ex. Prolog)
Knowledge-Based Agents
• Whenever the agent receives percepts from
the environment they will be converted into
sentences and added to the KB.
• When the inference engine generates new
knowledge it is also added to the KB.
• In addition, when the agent needs to make
an action, the agent must ask the KB what
the optimal action will be at that time.
Knowledge-Based Agents
• Therefore a KB must define two operations:
– there must be some way of telling the KB a
new piece of information;
– and there must be some way of asking the KB
some question about the environment.

male(david). ?- parent(X,Y).
female(susan). X = david,
parent(david,susan). Y = susan.
Representation, Reasoning and Logic

• Syntax: Describes the symbols in a


language and how they can be used
together.
• Semantics: Gives meaning to the syntax.
Defines how the symbols in the syntax
relate to in the real world.
• Entailment: If x entails y, then if x is true y
is true.
KB ╞ α if and only if (KB  α) is valid
Logic
• Basically there are two types of logics.
• Propositional logic: Also called Boolean
Logic. Very simple logic. Not very useful
for real situations.
• And, Or, Implies, Equivalent, and Not are
the only connectives.
• First order logic (FoL): More complex
logic. Useful for real world examples.
Propositional Logic
• Syntax
• Semantics
• Inference
• Example-Wumpus World
Syntax
• Constant:
– True, False
• Symbols:
– P, Q, …
• Parentheses:
– ()
• Logical connectives:
 (and),  (or),  (implication), 
(equivalence),  (not)
Syntax (cond.)
• The proposition symbols P1, P2 etc are
sentences
– If S is a sentence, S is a sentence (negation)
– If S1 and S2 are sentences, S1  S2 is a sentence
(conjunction)
– If S1 and S2 are sentences, S1  S2 is a sentence
(disjunction)
– If S1 and S2 are sentences, S1  S2 is a sentence
(implication)
– If S1 and S2 are sentences, S1  S2 is a sentence
Semantics
• All the connectives are defined in a truth
table
• For example:
P Q PQ PQ
0 0 1 1
0 1 1 0
1 0 0 0
1 1 1 1
Truth Table
Sematics
• S is true iff S is false
• S1  S2 is true iff S1 is true and S2 is
true
• S1  S2 is true iff S1is true or S2 is true
• S1  S2 is true iff S1 is false or S2 is true
i.e., is false iff S1 is true and S2 is
false
• S1  S2 is true iff S1S2 is true
andS2S1 is true
Inference
• It is a conclusion reached on the basis of
evidence and reasoning.
• Inferences are steps in reasoning, moving
from premises to conclusions.
• Human inference (i.e. how humans draw
conclusions) is traditionally studied within
the field of cognitive psychology;
• artificial intelligence researchers develop
automated inference systems to emulate
human inference.
First-Order Logic
• Much more powerful than
propositional (Boolean) logic
–Greater expressive power than
propositional logic
–Allows for objects, Properties,
relations and functions.
• In programming terms; allows
classes, functions and variables
Problems with Propositional Logic
Propositional logic is a weak language
• has very limited expressive power
• Hard to identify “individuals” (e.g., Mary, 3)
• Can’t directly talk about properties of individuals or
relations between individuals (e.g., “Bill is tall”)
• Generalizations, patterns, regularities can’t easily be
represented (e.g., “all triangles have 3 sides”)
• First-Order Logic (abbreviated FOL) is expressive
enough to concisely represent this kind of
information
FOL adds relations, variables, and quantifiers, e.g.,
• “Every elephant is gray”:  x (elephant(x) → gray(x))
• “There is a white alligator”:  x (alligator(X) ^ white(X))
First-Order Logic

First-Order Logic
assumes that the
world contains:

Objects Properties Relations Functions

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…

• Universal quantifier “for all” 


– The expression is true for every possible value of the
variable

• Existential quantifier “there exists” 


– The expression is true for at least one value of the variable
Knowledge Representation
• In the representation there are two different
entities that must be considered:-

– Facts: truths in some relevant world. These are


things that we want to represent

– Representation of facts in some chosen


formalism. These are things that can actually be
manipulated.
Approaches to Knowledge Representation

• There are multiple techniques for knowledge


representation.
• Different knowledge representation approaches
1) Rules
2) Logic
3) Natural language
4) Database systems
5) Semantic nets
6) Frames
• Many programs rely on more than one technique.
Approaches….
1. Rules
If
pulse is absent and breathing is absent
Then
person is dead.
2. Logical representation is a language with some concrete rules which deals with
propositions and has no ambiguity in representation. Logical representation
means drawing a conclusion based on various conditions. This representation
lays down some important communication rules. It consists of precisely defined
syntax and semantics which supports the sound inference. Each sentence can be
translated into logics using syntax and semantics.
3. Natural languages
Approaches….
4. Databases: are used in representing Simple Relation Knowledge which is in
declarative facts and can be said as a set of relations of the same sort within
database systems.

5. Semantic nets: are useful for representing


inheritable knowledge.
animal

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

problem with the system until a “joint


decision” is reached.
 A true expert: the user accepts the

system’s advice without a question.


Architecture of an Expert System.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy