0% found this document useful (0 votes)
5 views38 pages

unit4_knowledge_rep

Chapter 4 of the document discusses Knowledge Representation and Reasoning in Artificial Intelligence, covering topics such as ontologies, logical representation, and semantic networks. It explains various representation techniques including propositional and predicate logic, as well as frames and production rules, highlighting their advantages and disadvantages. The chapter emphasizes the importance of knowledge representation for enabling machines to understand and utilize information to solve complex problems.

Uploaded by

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

unit4_knowledge_rep

Chapter 4 of the document discusses Knowledge Representation and Reasoning in Artificial Intelligence, covering topics such as ontologies, logical representation, and semantic networks. It explains various representation techniques including propositional and predicate logic, as well as frames and production rules, highlighting their advantages and disadvantages. The chapter emphasizes the importance of knowledge representation for enabling machines to understand and utilize information to solve complex problems.

Uploaded by

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

Knowledge Representation and Reasoning

Chapter 4:
Artificial Intelligence (UCS411)

Thapar Institute of Engineering and Technology, Patiala


mukesh.singh@thapar.edu

Prof. Mukesh Singh (EIED) Artificial Intelligence 1 / 38


Chapter 4: Knowledge Representation and
Reasoning

Chapter Content
• Ontologies, foundations of knowledge representation and
reasoning
• Representing and reasoning about objects, relations, events,
actions, time, and space;
• Predicate logic, situation calculus, description logics
• Reasoning with defaults, reasoning about knowledge,
• Sample applications.

Prof. Mukesh Singh (EIED) Artificial Intelligence 2 / 38


Knowledge Reasoning and Intelligence
• Knowledge is the collection of facts, information, and skills
acquired through experience or training or education.
• It is the theoretical or practical understanding of a
subject/topic.
• Reasoning means processing of knowledge.
• Intelligence is the ability to use the knowledge.

Prof. Mukesh Singh (EIED) Artificial Intelligence 3 / 38


Relationship between Knowledge and Intelligence

• In this example, there is one decision-maker whose actions are justified by sensing
the environment and using knowledge.
• But, if we remove the knowledge part here, it will not be able to display any
intelligent behavior.

Prof. Mukesh Singh (EIED) Artificial Intelligence 4 / 38


Knoweldge Representation Techniques
• Knowledge Representation and Reasoning represents information from the real
world for a computer to understand and then utilize this knowledge to solve complex
real-life problems like communicating with human beings in natural language.
• Knowledge representation in AI is not just about storing data in a database, it allows a
machine to learn from that knowledge and behave intelligently like a human
being.

Prof. Mukesh Singh (EIED) Artificial Intelligence 5 / 38


Logical representation
• Logical represetation mean drawaing conclusion based on several conditions.
• Logical representation is a language with some definite rules which deal with
propositions and has no ambiguity in representation.
• It represents a conclusion based on various conditions and lays down some
important communication rules.
• Also, it consists of precisely defined syntax and semantics which supports the sound
inference.
• Each sentence can be translated into logics using syntax and semantics.

Syntax
It decides how we can construct legal sentences in logic.
It determines which symbol we can use in knowledge representation.
Also, how to write those symbols.

Semantics
Semantics are the rules by which we can interpret the sentence in the logic.
It assigns a meaning to each sentence.

Prof. Mukesh Singh (EIED) Artificial Intelligence 6 / 38


Logical Representation

It is of two types
• Propositional Logic
• Predicate Logic

Propositional Logic
• It is the simplest form
• We write in terms of statements (Proposition)
• The outcome of these proposition is either True or False (1 or 0)
• Example: 2 is a prime number(T)
27 is a prime number (F)
• Also it is called Boolean logic
• Represented by Cap letter.
• For example: K= 2 is a prime number(T)
L= 27 is a prime number (F)

Prof. Mukesh Singh (EIED) Artificial Intelligence 7 / 38


Propositional Logic

Types of Propositional Logic


1. Atomic (Simple) - Mohan is a singer
2. Molecular (Compound) - Mohan is a singer and Shaurya is a guitarist

Logical Connectives

Prof. Mukesh Singh (EIED) Artificial Intelligence 8 / 38


Propositional Logic- Example

Prof. Mukesh Singh (EIED) Artificial Intelligence 9 / 38


Propositional logic....

Example
It is hot
It is humid
It is raining
Write down the proposition logic for
1. If it is humid then it is hot
2. If it is hot and humid then it is not raining

Solution
Take A= It is hot
B = It is humid.
C= It is raining.
1. B → A
2. (A ∧ B) → ¬ C

Prof. Mukesh Singh (EIED) Artificial Intelligence 10 / 38


Limitations of Proposition Logic

Limitations of Proposition Logic


We cannot represent following sentences using Propositional Logic.

”Some employees are hard workers“


or
“All boys like cricket.”

Statements which are questions, commands, or opinions are not propositions such as
• Where is Ram?
• How do you do?
• What is your name?
• x is greater than 10.

Prof. Mukesh Singh (EIED) Artificial Intelligence 11 / 38


Predicate Logic

• It is an extension of Propositional Logic


• Also know as FOPL (First Order Predicate Logic) or FOL
• Types of Predicate logic
1 Predicates
2 Quantifiers

Predicates
• Predicates is nothing but relations between 2 objects
• Example: Simba likes orange
• LIKES (Simba, Orange);
• In more general forms LIKES(X,Y);

Prof. Mukesh Singh (EIED) Artificial Intelligence 12 / 38


Quantifiers
Quantifiers
There are two types of Quantifiers (They define scope of Objects)
1 Universal Quantifier, (for all, everyone, everything)
2 Existential quantifier, (for some, at least one)

• Universal (∀) ; ∀x likes(x, Oranges)


• Existential (∃); ∃ likes(x, Oranges);
• ∀x likes(x, orange) ; ∃x likes(x, Orange)

Example
Example 1: All man play cricket.
It can be converted into FOL as ∀x : man(x) → play (x, cricket).
Example 2: Some boys are intelligent. ∃x: boys(x) ∧ intelligent(x)

Connectives

1 Universal quantifier ∀ is implication →.


2 Existential quantifier ∃ is and ∧.

Prof. Mukesh Singh (EIED) Artificial Intelligence 13 / 38


Basic Elements of First-order logic

Prof. Mukesh Singh (EIED) Artificial Intelligence 14 / 38


Example
Example 1: Every house is a physical object
∀x: house(x) → physical-object(x); where, house and physical-object are unary predicate
symbols.

Example 2: Some physical objects are houses


∃x: physical-object(x) ∧ house(x)

Example 3: Every house has an owner


∀x: house(x) → ∃; y.owns(y, x); here, owns is a binary predicate symbol.

Example 4: “Everybody owns a house” is translated as


∀ x.∃; y.(owns(x, y) ∧ house(y))

Example 5: “Ram owns a house” is translated as


∃x.(owns(Ram, x) ∧ house(x))
where Ram is an individual constant symbol.

Prof. Mukesh Singh (EIED) Artificial Intelligence 15 / 38


Logic Representation Merits and Demerits

Advanatages
• Logical representation help to perform logical reasoning
• This representation is the basis for the programming languages

Disadvantage
• Logical representations have some restrictions and are challenging to work with.
• This technique may not be very natural and inference may not be very efficient.

Prof. Mukesh Singh (EIED) Artificial Intelligence 16 / 38


Semantic Networks

In Semantic networks, you can represent your knowledge in the


form of graphical networks.
• This network consists of nodes representing objects and arcs
which describe the relationship between those objects.
• Also, it categorizes the object in different forms and links those
objects.
• This representation consists of two types of relations:
1 IS-A relation (Inheritance): Child is a subclass of parent class
2 Has–A relation(Composition)

Prof. Mukesh Singh (EIED) Artificial Intelligence 17 / 38


Semantic Network

Statements:
Jerry is a cat.
Jerry is a mammal.
Jerry is owned by Priya.
Jerry is white colored.
All Mammals are animal.

Prof. Mukesh Singh (EIED) Artificial Intelligence 18 / 38


Semantic Network

Prof. Mukesh Singh (EIED) Artificial Intelligence 19 / 38


Example

Prof. Mukesh Singh (EIED) Artificial Intelligence 20 / 38


Example
Consider the following sentences:
1 Clyde and Nellie are elephants.
2 Nellie likes apples.
3 All elephants are mammals.
4 All elephants are large in size and grey colored.
5 All mammals and reptiles are animals.
6 Mammals have head.
Represent the knowledge in the form of semantic networks.

Solutions

Prof. Mukesh Singh (EIED) Artificial Intelligence 21 / 38


Assignment

Assignment on Semantic network


Represent following KB as semantic networks.

1 Tom is a cat.
2 Tom caught a bird.
3 Tom is owned by John.
4 Tom is ginger in colour.
5 Cats like cream.
6 The cat sat on the mat.
7 A cat is a mammal.
8 A bird is an animal.
9 All mammals are animals.
10 Mammals have fur.

Prof. Mukesh Singh (EIED) Artificial Intelligence 22 / 38


Frames representation
• A frame is a record like structure that consists of a collection of attributes and
values to describe an entity in the world.
• These are the AI data structures that divides knowledge into substructures by
representing stereotypes situations.
• Basically, it consists of a collection of slots and slot values of any type and size. Slots
have names and values which are called facets.
• Frames are a variant of semantic networks
• All the information relevant to a concept is stored in a single complex entity called a
frame.
• Superficially, frames look like record data structures or class.
• A single frame is rarely useful.
• We build a collection of frames called frame systems that are connected by virtue of
the fact that the value of an attribute of one frame is another frame.

Example
class Book {
Person author;
String title;
int price;
}

Prof. Mukesh Singh (EIED) Artificial Intelligence 23 / 38


Frame Example

In frame-based systems we refer to


objects – Mammal, Elephant, and Nellie;
slots – properties such as color and size;
slot-values – values stored in the slots, e.g. grey and large.

Slots and the corresponding slot-values are inherited through the class hierarchy

Prof. Mukesh Singh (EIED) Artificial Intelligence 24 / 38


Frame Example

Prof. Mukesh Singh (EIED) Artificial Intelligence 25 / 38


Frame Example

Prof. Mukesh Singh (EIED) Artificial Intelligence 26 / 38


Frames...

Example of a frame for a Student

Prof. Mukesh Singh (EIED) Artificial Intelligence 27 / 38


Declarative Frames
Pointers to other frames/ Inheritence

Prof. Mukesh Singh (EIED) Artificial Intelligence 28 / 38


Procedural Frames
Pointers to other frames/ Inheritence

Prof. Mukesh Singh (EIED) Artificial Intelligence 29 / 38


Frames advanteges and disadvanteges

Advantages
1 It makes the programming easier by grouping the related data.
2 Frame representation is easy to understand and visualize.
3 It is very easy to add slots for new attributes and relations.
4 Also, it is easy to include default data and search for missing
values.

Disadvantages
1 In frame system, inference mechanism cannot be easily
processed.
2 It has a very generalized approach.

Prof. Mukesh Singh (EIED) Artificial Intelligence 30 / 38


Production Rules

• Two components make up a production: sensory


precondition (or ”IF”) and action (or ”THEN”).
• A production is triggered when its precondition matches the
current world.
• When the production is carried out, it is said to have fired.
• A production system also includes a database known as
working memory, which stores information regarding the
present state of knowledge and a rule interpreter.
• When many productions are triggered, the rule interpreter
must provide a mechanism for ranking the productions in
order of importance.

Prof. Mukesh Singh (EIED) Artificial Intelligence 31 / 38


Production Rules

• In production rules, agent checks for the condition and if the


condition exists then production rule fires and corresponding
action is carried out.
• The condition part of the rule determines which rule may be
applied to a problem.
• Whereas, the action part carries out the associated
problem-solving steps. This complete process is called a
recognize-act cycle.
• The production rules system consists of three main parts:
1 The set of production rules
2 Working Memory
3 The recognize-act-cycle

Prof. Mukesh Singh (EIED) Artificial Intelligence 32 / 38


Production Rules....

• The working memory contains the description of the current


state of problems-solving and rule can write knowledge to the
working memory. This knowledge match and may fire other
rules.
• If there is a new situation (state) generation, then multiple
production rules may be fired together, this is called conflict
set. In this situation, the agent needs to select a rule from
these sets, and it is called a conflict resolution.

Example
IF (at station AND train arrives) THEN action (get into the train)
IF (on the train AND empty seat) THEN action (sit down).
IF (on train AND unpaid) THEN action (pay charges).
IF (train arrives at destination) THEN action (get down from the train).

Prof. Mukesh Singh (EIED) Artificial Intelligence 33 / 38


Production Rule....

Advantages
1 The production rules are expressed in natural language.
2 The production rules are highly modular, so we can easily
remove, add or modify an individual rule.

Disadvantages
1 Production rule system does not exhibit any learning
capabilities, as it does not store the result of the problem for
the future uses.
2 During the execution of the program, many rules may be active
hence rule-based production systems are inefficient.

Prof. Mukesh Singh (EIED) Artificial Intelligence 34 / 38


Ontology
Ontology in AI
• Ontology refers to the architecture that binds different sources of information and
involves interconnecting data from multiple domains by tagging and categorising.
• Ontology facilitates sharing a common understanding of information structure
among software agents, reusing domain knowledge, analysing domain knowledge,
and separating domain knowledge from operational knowledge.

Prof. Mukesh Singh (EIED) Artificial Intelligence 35 / 38


title

Definition of Ontology
A defined model that organizes structured and unstructured
information through entities, their properties, and the way they
relate to one another.

Benefits of Ontologies
Ontologies can allow your organization to:
• Manage content more effectively;
• Maximize findability and discoverability of information;
• Increase the reuse of “hidden” and unknown information;

Prof. Mukesh Singh (EIED) Artificial Intelligence 36 / 38


Example 1: Ontology of a Model

Prof. Mukesh Singh (EIED) Artificial Intelligence 37 / 38


Example 2: Ontology of an Organisation

Prof. Mukesh Singh (EIED) Artificial Intelligence 38 / 38

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