0% found this document useful (0 votes)
2 views

Lecture 6(Knowldege Representation)

The document discusses various knowledge representation methods, including propositional logic, predicate logic, semantic networks, and frames. It outlines the syntax and semantics of propositional and predicate logic, the structure and limitations of semantic networks, and the organization of frames as a way to represent knowledge. Each method has its advantages and disadvantages in terms of expressiveness, inference capabilities, and ease of programming.

Uploaded by

ML Hridoy
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)
2 views

Lecture 6(Knowldege Representation)

The document discusses various knowledge representation methods, including propositional logic, predicate logic, semantic networks, and frames. It outlines the syntax and semantics of propositional and predicate logic, the structure and limitations of semantic networks, and the organization of frames as a way to represent knowledge. Each method has its advantages and disadvantages in terms of expressiveness, inference capabilities, and ease of programming.

Uploaded by

ML Hridoy
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/ 36

Knowledge Representation

•Propositional Logic
• Predicate Logic
• Semantic Networks
• Frames
• Fuzzy Logic
Propositional Logic
• A formal method of reasoning, which represents
knowledge, allowing automated inference and
problem solving.
• Concepts are translated into symbolic
representations which closely approximate the
meaning. These symbolic structures can then be
manipulated in programs to deduce various
facts, to carry out a form of automated
reasoning.
• Propositional logic is the simplest.
• Symbols represent whole propositions (facts):
P, Q, R, S, etc..
• These are joined by logical connectives (and,
or, implication) e.g., P  Q; Q  R
• Given some statements in the logic we can
Propositional Logic:
Semantics
• Propositions
– Sentences and truth values
– Propositional connectives and their truth tables
• Negation: ~P
• Conjunction: P ۸ Q
• Disjunction: P ۷ Q (inclusive or)
• Implication: P → Q
• Equivalence: P ↔ Q
– Other propositional connectives
• P⊕Q (exclusive or), P↓Q (nor), P↑Q (nand),..
Propositional Logic
● Propositions are some elementary atomic
sentences. Propositions may be either true or false.
In propositional logic, a world is represented as
knowledge using a list of facts.
● Syntax of PL :
● symbol -> P | Q | R | S | ...
● atomic sentence -> TRUE | FALSE
● sentence -> atomic sentence | complex sentence
● complex sentences -> ~ sentence | (sentence ^ sentence) |
(sentence v sentence) | (sentence → sentence) |
● (sentence ↔ sentence)

● Precedence relation operators: ~,^,v,→, ↔.


Propositional Logic:
Examples
● My car is painted red.
● Snow is white.
● People live on the moon.
● Logical connectives:
● It is raining and the wind is blowing.
● I shall go there or ask kamal to visit him.
● If you study hard you will be successful.
● The sum of 20 and 30 is not 100.
● The car belongs to the VC is painted silver.
Semantic Rules for Statements
Rule True False
No.
1 Statements
T Statements
F
2 ~f ~t
3 t or t’ f&a
4 t or a a&f
5 a or t F or f’
6 a🡪t t🡪f
7 f🡪a t 🡨🡪 f
8 t 🡨🡪 t’ f 🡨🡪 t
9 f 🡨🡪 f ’
Properties of Statements
Satisfiable: A statement is satisfiable if
there is some interpretation for which it is
true.
Contradiction: A statement is said to be
contradictory (unsatisfiable) if there is no
interpretation for which it is true.
Valid: A statement is valid if it is true for
every interpretations. Valid statements
are also called tautologies.
Equivalence: Two sentences are
equivalent if they have the same truth
value under every interpretation.
Semantics &
Interpretations
P Q P∧Q P∨Q ~P P→Q P↔Q

f f f f t t t

f t f t t t f

t f f t f f f

t t t t f t t
Meaning of Statements
What would be the meaning of the following statement,
if some interpretation imply true to P, false to Q and
false to R ?:
((P & ~ Q) → R) ∨ Q
Assignments:
1. Find the meaning of the statement:
(~ P V Q) & R → S V (~ R & Q)
for each of the interpretations given below:
I1: P is true, Q is true, R is false, S is true.
I2: P is true, Q is false, R is true, S is true.
2. Determine whether each of the following
sentence is
(a) satisfiable (b) contradictory, or (c) valid
S1: (P & Q) V ~ (P & Q) S2: (P V Q) → (P & Q)
S3: (P & Q)→ R V~Q S4: (P V Q) & (P V ~Q) V P
S5: P →Q →~P S6: P V Q & ~P V ~Q & P
Meaning of Statements …
If the earth moves...
round the sun or the
sun moves round the earth, then
Copernicus might be a mathematician
but wasn’t an astronomer.

Inspite of having French nationality, B.


Russel was a critic of imperilism, then
either he was not a bachelor or he was a
universal lover.
Rules of Inference
● Modus Ponens

∴Q
P → Q, P {((P → Q) ∧ P) → Q}

● Modus Tollens

∴~ P
P → Q, ~ Q {((P → Q) ∧ ~ Q) → ~ P}

● Hypothetical Syllogism (H. S.)

∴P → R
(P → Q) & (Q → R)

● Disjunctive Syllogism (D. S.)

∴Q
(P V Q) ~ P
Drawbacks of PL
● Propositional logic isn’t powerful enough as a general
knowledge representation language.
● Impossible to make general statements. E.g., “all students
sit exams” or “if any student sits an exam they either pass
or fail”.
● So we need predicate logic..
Predicate Logic
• In predicate logic the basic unit is a predicate/
argument structure called an atomic sentence:
• LIKES (azad, chocolate)
• TALL (habib)
• Arguments can be any of:
• constant symbol, such as ‘azad’
• variable symbol, such as x
• function expression, e.g., FATHER_OF (hasan)
• So we can have:
• LIKES (X, chocolate)
• FRIENDS (FATHER_OF (rita), FATHER_OF (choiti))
Syntax of Predicate Logic
• These atomic sentences can be combined
using logic connectives
• LIKES (rita, hasan)  TALL (hasan)
• BASKET_BALL_PLAYER (hasan)  TALL (hasan)
• Sentences can also be formed using
quantifiers
• x LOVELY (x) Everything is lovely.
• x LOVELY (x) Something is lovely.
• x IN (x, garden)  LOVELY (x) Everything in
the garden is lovely.
Predicate Logic: Examples ...
● All employees earning TK. 30,000 or more per year
pay taxes.
∀x ((E(x) & GE (i (x), 30000)) → T(x)
● Some employees are sick today
y ((E(y) → S(y))
● No employee earns more than the president
∀x ∀y ((E(x) & P(y)) → ~GE((i (x), i (y)))
Logic
• Can have several quantifiers, e.g.,
• x y LOVES (x, y)
• x HANDSOME (x)  y LOVES (y, x)
• So we can represent things like:
• All men are mortal.
• No one likes hartal.
• Everyone taking AI will pass their exams.
• Every race has a winner.
• Sajjad likes everyone who is tall.
• Rita doesn’t like anyone who prefers arguments.
• There is something small and slimy on the table.
Logic
• There is a precise meaning to expressions in
predicate logic.
• Like in propositional logic, it is all about
determining whether something is true or false.
• x P(x) means that P(x) must be true for every
object x in the domain of interest.
• x P(x) means that P(x) must be true for at least
one object x in the domain of interest.
• So if we have a domain of interest consisting of
just two people, Hasan and Belal, and we know
that TALL(hasan) and TALL(belal) are true, we
can say that x TALL(x) is true.
Semantic Net
● An long existing notion: there are different pieces of knowledge of
world, and they are all linked together through certain semantics.
• knowledge is expressed as a collection of concepts,
represented by nodes (shown as boxes in the diagram),
connected together by relationships, represented by arcs
(shown as arrows in the diagram).
• certain arcs - particularly isa arcs - allow inheritance of
properties.
Basic Components
• Nodes studen
• Represent concepts t
IS-A
• Arcs
• Represent relations FRIEND-
hasan OF
AGE
• Labels for nodes and
arcs 21 rita
Semantic Net
● Common arcs used for representing hierarchies include isa and
has-part.
Example:
The Queen Mary is an ocean liner.
Every ocean liner is a ship

ship

IS-A

Ocean_liner

IS-A

Queen_mary
Semantic Net …..
Common arcs used for representing hierarchies include isa and
has-part.
HAS-PART
IS-A SHIP

Ocean Engine Hull


Oil Tanker
Liner
IS-A

Swimming Queen Liver Pool Boiler


Pool Mary
Semantic Networks
Knowledge is represented as a network or graph
anim
al HAS_PART
subclas subclas head
s s mam
mal
reptil
e subclas
s
LIVES_IN eleph
africa large
ant SIZE
instanc
Nellie apple
e LIKES s
Knowledge Representation:
Semantic Net

An long
existing
notion:
there are
different
pieces of
knowledge
of world, and
they are all
linked together
through certain
semantics.
Knowledge Representation:
Semantic Net

▪ Developments of the semantic nets idea:


▪ psychological research into whether human
memory really was organised in this way.
▪ used in the knowledge bases in certain expert
systems: e.g. PROSPECTOR.
▪ special-purpose languages have been written to
express knowledge in semantic nets.
Organization of Knowledge
▪ By traversing network we can find:
▪ That Nellie has a head (by inheritance)
▪ That certain concepts related in certain ways (e.g., apples
and elephants).
▪ BUT: Meaning of semantic networks was not always well
defined.
▪ Are all Elephants big, or just typical elephants?
▪ Do all Elephants live in the “same” Africa?
▪ Do all animals have the same head?
▪ For machine processing these things must be defined.
Major Limitations
• Lack of Semantics
• No formal semantic of the relations
• E.g. Does “ISA” mean subclass, member, etc?
• Possible multiple interpretations
• Restricted expressiveness
• E.g. can not distinguish between instance and class

• Advantages:
• Easy to follow hierarchy, easy to trace association, flexible

• Disadvantages:
• Meaning attached to nodes might be ambiguous
• exception handling is difficult
• difficult to program
Semantic Nets …
▪ Problems with semantic nets
▪ logical inadequacy - vagueness about what types
and tokens really mean.
▪ heuristic inadequacy – finding a specific piece of
information could be chronically inefficient.
▪ trying to establish negation is likely to lead to a
combinatorial explosion.
▪ "spreading activation" search is very inefficient,
because it is not knowledge-guided.
Frames
• Devised by Marvin Minsky, 1975.
• Incorporates certain valuable human thinking
characteristics:
• Expectations, assumptions, stereotypes. Exceptions. Fuzzy
boundaries between classes.
• The essence of this form of knowledge representation is
typicality, with exceptions, rather than definition.
• a data structure for representing a stereotyped situation
• a network of nodes and relations organized in a hierarchy
• the topmost nodes - general concepts
• the lower nodes - more specific instances

● The idea of frame hierarchies is very similar to the idea of class


hierarchies found in object-orientated programming.
How Frames are Organized
▪ A frame system is a hierarchy of frames
▪ Each frame has:
▪ a name.
▪ slots: these are the properties of the entity
that has the name, and they have values. A
particular value may be:
▪ a default value
▪ an inherited value from a higher frame
▪ a procedure, called a demon, to find a
value
▪ In the higher levels of the frame hierarchy, typical knowledge
about the class is stored.
▪ The value in a slot may be a range or a condition.
▪ In the lower levels, the value in a slot may be a specific value, to
overwrite the value which would otherwise be inherited from a
higher frame.
Frames … …
▪ An instance of an object is joined to its class by an
'instance_of' relationship.
▪ A class is joined to its superclass by a 'subclass_of'
relationship.
▪ Frames may contain both procedural and
declarative knowledge.
▪ Slot values normally amount to declarative knowledge, but
a daemon is in effect a small program. So a slot with a
daemon in it amounts to procedural knowledge.

▪ Note that a frames system may allow multiple inheritance but,

if it does so, it must make provision for cases when inherited


values conflict.
Frames …
• Advantages:
• Expressive power, easy to set up
slots for new properties and relations
• easy to create specialized procedures
• easy to include default information
and detect missing values
• Disadvantages:
• Difficult to program
• difficult for inference
A car has 4 wheels, is moved by an engine, and runs on petrol
or diesel.

We can now add three slots to the frame.


The last of these has a restriction rather than a specific value.

Name: car Subclass of: thing car subclass_of


thing
with
Slots: wheels: 4,
Name: Value: Restrictions: moved_by:
engine,
fuel:
wheels 4
[value:
moved by engine unknown,
type:
fuel ? petrol or diesel [petrol,diesel]].
“There is a particular type of car called Toyota, manufactured in
Japan.”

● We can add a second frame to our system, with one


slot. We don’t need to repeat the slots and values in
the previous frame: they will be inherited.

‘Toyota’
Name: Toyota Subclass of: car subclass_of
car
Slots: with
Name: Value: Restrictions: made_in:
‘Japan’.
made in Japan
“There is a particular type of Golf called a TDi, which runs on diesel,
has 4 cylinders, and has a 1.8 litre engine.”

Name: TDi Subclass of: Golf


‘TDi’ subclass_of
Slots: ‘Golf’
with
Name: Value: Restrictions:
fuel: diesel,
fuel diesel engine_capacity:
1.8,
engine
capacity 1.8 litres cylinders: 4.

cylinders 4
Logic

▪ How do we precisely define the semantics


of a frame system or semantic network?
▪ Modern trend is to have special knowledge
representation languages which look a bit
like frames to users, but which:
▪ use logic to define what relations mean
▪ don’t provide the full power of predicate
logic, but a subset that allows efficient
inference. (May not want more than
inheritance).
Summary
● Predicate logic provides well defined language for
knowledge representation supporting inference.
● Semantic nets, frames and objects all allow you to
define relations between objects, including class
relations (X isa Y).
● Only restricted inference supported by the methods -
that based on inheritance.
● So.. Jimy is a dog, dogs have 4 legs, so Jimy has 4
legs.
● Frames/Networks/Objects more natural, but only
explicitly support inheritance, and may not have well
defined semantics.
● Current trend is either to just use OO, or to use logic,
but specialises non-logic-based languages still exist.
Thank you for enjoying the
class.

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