AI Lec2

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

Artificial Intelligence

Knowledge Representation
Knowledge Representation
• When we use search to solve a problem we must
• Capture the knowledge needed to formalize the problem
• Apply a search technique to solve problem
• Execute the problem solution

UTZ.Hadil Emam 2
• Importance of KR:
• KR way highly affects system:

• Development
• Efficiency
• Speed9and maintenance.
• ES shells are designed for specific
type of KR such as rules or logic
• Meta-knowledge is one step over,
it is known as knowledge about
knowledge

UTZ.Hadil Emam 3
Knowledge Classes
Procedural knowledge:
Knowing how to do something, e.g. Knowing how to boil a pot of water.
Declarative knowledge:
Know that something is true or false, stated in a form of declarative
statements, e.g. Don't put your fingers in a pot of boiling water.‰
Tacit knowledge:
Is something called unconscious knowledge, because it cannot be expressed
by language, e.g. Knowing how to move your hand or how to eat, walk, ride a
bicycle

UTZ.Hadil Emam 4
Representation
Different knowledge representation techniques have been devised e.g.
Rules, commonly used.
Semantic nets
Frames
Scripts
Conceptual graphs

UTZ.Hadil Emam 5
Role of KR
• The first step is the role of “knowledge representation” in AI.
• Formally,
• The intended role of knowledge representation in artificial
intelligence is to reduce problems of intelligent action to search
problems.
• A good description, developed within the conventions of a
good KR, is an open door to problem solving
• A bad description, using a bad representation, is a brick wall
preventing problem solving

UTZ.Hadil Emam 6
A Knowledge-Based Agent
• We previously talked about applications of search but not about methods of
formalizing the problem.
• Now we look at extended capabilities to general logical reasoning.
• Here is one knowledge representation: logical expressions.
• A knowledge-based agent must be able to
• Represent states, actions, etc.
• Incorporate new percepts
• Update internal representations of the world
• Deduce hidden properties about the world
• Deduce appropriate actions
• We will
• Describe properties of languages to use for logical reasoning
• Describe techniques for deducing new information from current information
• Apply search to deduce (or learn) specifically
UTZ.Hadil Emam needed information 7
Representation, Reasoning and Logic
• Semantics: Mapping from sentences to facts in the
• Sentence: Individual piece of knowledge
world
- English sentence forms one piece of - They define the truth of a sentence in a “possible
world”
knowledge in English language - Add the values of 2 and 3, store them in the
- Statement in C forms one piece of memory location indicated by variable a
knowledge in C programming language • In the language of arithmetic:

x + 2 >= y is a sentence
• Syntax: Form used to represent sentences x2 + y > is not a sentence
- Syntax of C indicates legal combinations x + 2 >= y is true in all worlds where the number
x + 2 is
of symbols no less than the number y
- a = 2 + 3; is legal x + 2 >= y is true in a world where
x = 7, y = 1
- a = + 2 3 is not legal x + 2 >= y is false in a world where
- Syntax alone does not indicate meaning x = 0, y = 6
UTZ.Hadil Emam 8
Semantic Nets
• ‰A classical AI representation • Semantic Nets Structure‰
technique used for propositional • A semantic net is shown
information. Some times called a graphically in a form of directed
propositional net.‰ graph, consisting of nodes and arcs
connecting.
• Statement that either true or false • Nodes ≡objects
is called a proposition e.g. “the • Arcs ≡links/edges‰.
sky is blue”, or “UofK is not • Nodes represent physical objects,
inside Khartoum”.‰ where links represent relationships
• First developed to between objects.
model/represent human memory
and language (analyzing meanings
of words within sentences).
UTZ.Hadil Emam 9
UTZ.Hadil Emam 10
UTZ.Hadil Emam 11
• Semantic nets‰
• Semantic nets are referred to as associative nets, because they associate or relate nodes or objects
represented by nodes to each others.‰
• Some useful relationships are IS-A, A-KIND-OF, and HAS-A, (ISA,AKO,HSA). The first two
associate a member or an object to a class, and the third relates two objects .e.g.
• “balloon AKO aircraft”,
• “car HAS-A tire”
• “car ISA vehicle”

• Limitations of Semantic Nets‰


• Lack of link names standards, makes it difficult to understand the net meaning.‰
• Similarly the nodes naming, e.g. If a node is labeled “car” this may mean:
• the class of car
• a specific car
• the concept of a car‰
• Semantic nets are logically inadequate because they can not define knowledge in a way
that logic can.
UTZ.Hadil Emam 12
• Limitations of Semantic Nets
• Answering negative query such as “is ABC is a car”, takes a very long
time.
• Logic enhancement have been made and heuristic enhancements have
been tried by attaching procedures to nodes. The procedure will be
executed when the node is activated. The resulting system gained a
little at the expense of natural expressive ness of semantic nets.
• Semantic nets can be used better in representing binary relations, but
not all types of relations.

UTZ.Hadil Emam 13
• Some product rules problems
• To represent a comprehensive grammar for even a subset of a natural
language one needs a very large set of product rules.
• When following a grammar definition one can end out with sentences
that make no sense. e.g. the simple grammar:
<sentence> →<determiner><noun><verb><noun>
<determiner> →a | the | an | this
<noun> →man | woman | food | car
<verb> →greet | drive | eat
• May produce the following three valid sentences:
the man eat the food
the car drive the man
the food ate the woman

UTZ.Hadil Emam 14
Frames
• Frames: a frame is analogous to a record structure in programming
languages, corresponding to fields and values of a record are the slots
and filters of a frame.

Slots Filters
Manufacturer Giad
Model Accent
Year 2006 a car frame
Color White
Tires 4
Transmission Manual

UTZ.Hadil Emam 15
• Frames Limitations
Frames were designed to represent
stereotyped knowledge. Stereotyped
knowledge have well defined
features so that many of its slots have
default values. For non-stereotyped
data in which default values cannot
be defined some problems may
occur.
Major problems have occurred in
frame systems that allow
unrestrained alteration or
cancellation slots.

UTZ.Hadil Emam 16
Predicate Calculus Predicate Calculus
• In propositional calculus, each • A propositional calculus (first order
propositional atom (variable) represents logic) have three parts Predicate
an indivisible proposition. calculus = (PC, ∆, R)
• For example, A variable P means: “The
• PC is a formal language :
car is white”. The variable cannot
separate terms like “car” and “white”. • P = {wff: wff subscribes to a
This is ineffective when we want to grammar}
express knowledge, such as • ∆is the knowledge base:
• ∆= {wff: wffs are true for a certain
“All cars are white”
domain }
• This will have to be represented by a • R is a set of inference rules
number of propositions, one for each car. • R = { rule 1, rule 2, ...rule n}
• The predicate calculus extends the
• This is the same as propositional
propositional calculus by providing a
richer language. calculus, just the former language
• PC is more expressive than P.
UTZ.Hadil Emam 17
Syntax
• In propositional calculus, all variables are Boolean. In the predicate
calculus, variables can be Boolean, integers, floats, others
Limitations of predicate logic
Although it is very useful in many cases, there are some statements
that can not be even expressed in predicate logic using universal and
existential quantifiers. For example:
Most of the class received their books.
Expressing thing that are sometimes but not always true is also a
limitation.

UTZ.Hadil Emam 18

You might also like