Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
124 views

Unit 4 Knowledge Representation

The document discusses knowledge representation and logic. It covers: 1) The objective of knowledge representation is to express knowledge in a computer-tractable form so it can be used by algorithms to perform tasks. 2) Key aspects of knowledge representation languages include syntax, semantics, and computational manipulation of sentences and objects. 3) Logic uses a formal language to represent knowledge and reasoning processes to deduce new facts from existing facts. Propositional and first-order predicate logic are discussed as methods for knowledge representation.

Uploaded by

jskri3399
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

Unit 4 Knowledge Representation

The document discusses knowledge representation and logic. It covers: 1) The objective of knowledge representation is to express knowledge in a computer-tractable form so it can be used by algorithms to perform tasks. 2) Key aspects of knowledge representation languages include syntax, semantics, and computational manipulation of sentences and objects. 3) Logic uses a formal language to represent knowledge and reasoning processes to deduce new facts from existing facts. Propositional and first-order predicate logic are discussed as methods for knowledge representation.

Uploaded by

jskri3399
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Unit 4: Knowledge Representation

The objective of knowledge representation is to express knowledge in a computer tractable


form such that it can be used by any algorithm to perform any task.

Key aspects of knowledge representation languages are:


i. Syntax: describes how sentences are formed in the language.
ii. Semantics: describes the meaning of sentences, what is it the sentence refers to in the
real world.
iii. Computational aspect: describes how sentences and objects are manipulated.
- A formal language is required to represent knowledge in a computer tractable form and
reasoning processes are required to manipulate this knowledge to deduce non-obvious
(unseen) facts.
General features of a representation
Representational adequacy
The ability to represent all kinds of knowledge that are needed in a certain domain.
Inferential adequacy
The ability to represent all of the kinds of inferential procedures (procedures that
manipulate the representational structures in such a way as to derive new structures
corresponding to new knowledge inferred from old).
Inferential efficiency
The ability to represent efficient inference procedures (for instance, by incorporating into
the knowledge structure additional information that can be used to focus the attention of
the inference mechanisms in the most promising directions).
Acquisitional efficiency
The ability to acquire new information easily.
Knowledge Representation using Logic
Logics are formal languages for representing information such that conclusions can be
drawn. Logic makes statements about the world which are true (or false).
Logic is:
concise
unambiguous
context insensitive
expressive
effective for inferences
Logic is defined by the following:
1. Syntax - describes the possible configurations that constitute sentences.
2. Semantics - determines what facts in the world the sentences refer to i.e. the
interpretation. Each sentence makes a claim about the world.
3. Proof theory - set of rules for generating new sentences that are necessarily true given
that the old sentences are true. The relationship between sentences is called entailment. The
proof can be used to determine new facts which follow from the old.

1
Types of logic: Different types of logics are: Propositional logic and Predicate logic (First
–order Predicate Logic).
Propositional logic
- A propositional logic is a declarative sentence which can be either true or false but not
both or either.
- Propositional logic is a mathematical model that allows us to reason about the truth or
falsehood of logical expression.
- In propositional logic, there are atomic sentences and compound sentences built up from
atomic sentences using logical connectives.
Formal Logical Connectives
In logic, a logical connective (also called a logical operator) is a symbol or word used to
connect two or more sentences (of either a formal or a natural language) in a grammatically
valid way, such that the sense of the compound sentence produced depends only on the
original sentences. The most common logical connectives are binary connectives (also
called dyadic connectives) which join two sentences which can be thought of as the
function's operands. Also commonly, negation is considered to be a unary connective.
Logical connectives along with quantifiers are the two main types of logical constants used
in formal systems such as propositional logic and predicate logic.
List of Logical connectives

Sentences in the propositional logic:

2
i. Atomic sentences: – Constructed from constants and propositional symbols – True, False
are atomic sentences. Light in the room is on. It rains outside are (atomic) sentences.
ii. Composite sentences: – Constructed from valid sentences via connectives eg: ( A ∧
B) ( A ∨ B ) ( A ⇒ B ) ( A ⇔ B) ( A ∨ B ) ∧ ( A ∨ ¬ B )
Propositional logic is the simplest logic. We use the symbols like P1, P2 to represent
sentences. A sentence (well-formed formula) is defined as follows

Truth Table showing the evaluation of semantics of complex sentences

3
Limitations of Propositional logic:

o We cannot represent relations like ALL, some, or none with propositional logic.
Example:
1. All the girls are intelligent.
2. Some apples are sweet.
o Propositional logic has limited expressive power.
o In propositional logic, we cannot describe statements in terms of their properties
or logical relationships.

Tautology/Validity

Satisfiability
A sentence is satisfiable if it is true in some model

(OR)
Contradiction/Unsatisfiable
A sentence is unsatisfiable whose truth values are always false.

Logically Contigent: A formula or statement that is neither a tautology nor a contradiction


is said to be logically contigent.

4
Equivalence rule:

First-Order Logic in Artificial intelligence


In the topic of Propositional logic, we have seen that how to represent statements using
propositional logic. But unfortunately, in propositional logic, we can only represent the
facts, which are either true or false. PL is not sufficient to represent the complex sentences

5
or natural language statements. The propositional logic has very limited expressive power.
Consider the following sentence, which we cannot represent using PL logic.

o "Some humans are intelligent", or


o "Sachin likes cricket."

To represent the above statements, PL logic is not sufficient, so we required some more
powerful logic, such as first-order logic.

First-Order logic:
o First-order logic is another way of knowledge representation in artificial intelligence. It is
an extension to propositional logic.
o FOL is sufficiently expressive to represent the natural language statements in a concise
way.
o First-order logic is also known as Predicate logic or First-order predicate logic. First-
order logic is a powerful language that develops information about the objects in a more
easy way and can also express the relationship between those objects.
o First-order logic (like natural language) does not only assume that the world contains facts
like propositional logic but also assumes the following things in the world:
o Objects: A, B, people, numbers, colors, wars, theories,......
o Relations: It can be unary relation such as: red, round, is adjacent, or n-any
relation such as: the sister of, brother of, has color, comes between
o Function: Father of, best friend, third inning of, end of, ......
o As a natural language, first-order logic also has two main parts:
o Syntax
o Semantics

Syntax of First-Order logic:


The syntax of FOL determines which collection of symbols is a logical expression in first-
order logic. The basic syntactic elements of first-order logic are symbols. We write
statements in short-hand notation in FOL.

6
Basic Elements of First-order logic:
Following are the basic elements of FOL syntax:

Constant 1, 2, A, John, Mumbai, cat,....

Variables x, y, z, a, b,....

Predicates Brother, Father, >,....

Function sqrt, Left Leg Of, ....

Connectives ∧, ∨, ¬, ⇒, ⇔

Equality ==

Quantifier ∀, ∃

Atomic sentences:

o Atomic sentences are the most basic sentences of first-order logic. These sentences are
formed from a predicate symbol followed by a parenthesis with a sequence of terms.
o We can represent atomic sentences as Predicate (term1, term2, ......, term n).

Example: Ravi and Ajay are brothers: => Brothers (Ravi, Ajay).
Chinky is a cat: => cat (Chinky).

Complex Sentences:

o Complex sentences are made by combining atomic sentences using connectives.

First-order logic statements can be divided into two parts:

o Subject: Subject is the main part of the statement.

7
o Predicate: A predicate can be defined as a relation, which binds two atoms together in a
statement.

Consider the statement: "x is an integer.", it consists of two parts, the first part x is the
subject of the statement and second part "is an integer," is known as a predicate.

Quantifiers in First-order logic:


o A quantifier is a language element which generates quantification, and quantification
specifies the quantity of specimen in the universe of discourse.
o These are the symbols that permit to determine or identify the range and scope of the
variable in the logical expression. There are two types of quantifier:
1. Universal Quantifier, (for all, everyone, everything)
2. Existential quantifier, (for some, at least one).

Universal Quantifier:

Universal quantifier is a symbol of logical representation, which specifies that the


statement within its range is true for everything or every instance of a particular thing.

The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.

If x is a variable, then ∀x is read as:

o For all x
o For each x
o For every x.

Example:
All man drink coffee.

Let a variable x which refers to a cat so all x can be represented in UOD as below

8
∀x man(x) → drink (x, coffee).

It will be read as: There are all x where x is a man who drink coffee.

Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the statement within
its scope is true for at least one instance of something.

It is denoted by the logical operator ∃, which resembles as inverted E. When it is used with
a predicate variable then it is called as an existential quantifier.

If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:

o There exists a 'x.'


o For some 'x.'
o For at least one 'x.'

Example:
Some boys are intelligent

9
Some Examples of FOL using quantifier:

1.All birds fly

In this question the predicate is "fly(bird)."


And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).

2. Every man respect his parents

In this question, the predicate is "respect (x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).

3.Some boys play cricket.

In this question, the predicate is "play (x, y)," where x= boys, and y= game. Since there
are some boys so we will use ∃, and it will be represented as:
∃x boys(x) → play (x, cricket).

4. Not all students like both Mathematics and Science.


In this question, the predicate is "like (x, y)," where x= student, and y= subject.

10
Since there are not all students, so we will use ∀ with negation, so following
representation

forthis:
¬∀ (x) [ student(x) → like (x, Mathematics) ∧ like(x, Science)]

More Examples on Predicate Logic:


Universal quantification: – Often associated with English words ―all, ―everyone, ―always, etc. –
Syntax:  – E.g., Everyone at university is smart: x At(x, university)  Smart(x) (we can also read this
as ―if X is at university, then X is smart)

Typically,  is the main connective with 

Existential quantification: • Often associated with English words ―someone, ―sometimes, etc. –
Syntax:  – Example: Someone at university is smart: x At(x, university)  Smart(x)

Typically,  is the main connective with 

Nesting and mixing quantifiers

Switching the order of multiple universal quantifiers does not change the meaning;

For example, ―Brothers are siblings‖ can be written as ∀ x ∀ y Brother (x, y) ⇒ Sibling(x, y)

Switching the order of multiple existential quantifiers does not change the meaning.

Switching the order of a universal quantifier and an existential quantifier does change meaning.

The order of quantification is therefore very important.

11
# Convert the following to the language of predicate logic.

1. Every apple is either green or yellow


X(apple(X)  green(X) yellow(X))
2. No apple is blue
X(apple(x) blue(X))
3. If an apple is green then its tasty
X((apple(X) green(X)) tasty(X))
4. Every man likes a tasty apple
XY(man(X)tasty Apple(Y) likes (X , Y))
Or
XY((man(X)Apple(Y)  tasty(Y))likes (X ,Y))
5. Some people like garlic
X(person(X)  likes (X, garlic))
6. All basketball players are tall
X (basketball Player(X) tall(X))
7. Every gardener likes the sun.
(x) gardener(x) => likes (x, Sun)
8. Not Every gardener likes the sun.
~((x) gardener(x) => likes (x, Sun))
9. John loves Mary
Loves (john, mary)

Semantics Network

Semantics network is a graphical representation of the knowledge. It is constructed using


nodes linked by a directional lines called arcs.
A node can represent a fact description
-physical object
- event
-concept

12
An arcs (link) represent relationship between nodes. There are some standard relationship
types
“Is a”(instance relationship): represent class/instance relationship
“has a”(parts- subparts relationship):identify property relationship

13

You might also like