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

Lecture-05 (New)

Uploaded by

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

Lecture-05 (New)

Uploaded by

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

ARTIFICIAL INTELLIGENCE

BS MULTIMEDIA GAMING- FALL-2024


Lecture – 05
Course Instructor: Aurangzeb
Magsi
 How to reach me?
[email protected]
KNOWLEDGE REPRESENTATION AND
REASONING

 Contents:
 Introduction to Knowledge Representation
 Propositional Logic
 First Order Logic
 Propositional Logic V/S First Order Logic
 Applications of Knowledge Representation and Reasoning
INTRODUCTION TO KNOWLEDGE
REPRESENTATION & REASONING
 Knowledge:
 Facts and skills accumulated through experience.
 Reasoning:
 Processing of stored knowledge, use of knowledge at right time.
 Definition:
 A formal system used to structure and organize knowledge in
artificial intelligence (AI) systems.
 It allows AI to represent facts, objects, and relations in a way
that a computer can process.
 Objective of Knowledge Representation:
 Capture Knowledge: Store useful information about the world.
 Reasoning: Use stored information to draw inferences, solve
problems, and make decisions.
WHY IS KNOWLEDGE
REPRESENTATION IMPORTANT IN AI?
 Facilitates Reasoning:
 Helps AI systems simulate human-like reasoning
processes.
 Makes it easier to infer new knowledge from existing
data.
 Foundation for Machine Learning & Natural Language
Processing:
 Enhances the ability of machines to understand, learn,
and interpret complex human concepts.
 Supports Decision-Making in AI:
 Used in expert systems and robotics for planning and
decision-making based on structured knowledge.
FORMS OF KNOWLEDGE
REPRESENTATION
 Logical Representation:
 Uses formal logic (e.g., Propositional Logic, First Order
Logic/Predicate Logic) to represent facts and rules.
 Semantic Networks (Meaningful Graph):
 Represents knowledge as a graph of nodes (concepts) and
links (relationships).
 Frames :
 Slots: object
 Fillers: Attributes
 Group related data together in structures representing
stereotypes or objects (e.g., a "car" has wheels, engine, etc.).
 Production Rules:
 Uses "IF-THEN" rules to model behavior or infer decisions
KEY COMPONENTS OF
KNOWLEDGE REPRESENTATION
 Objects:
 Entities that exist in the world (e.g., a person, car, or
animal).
 Relations:
 How objects are connected (e.g., "Alice loves Bob").
 Facts:
 Statements that describe the state of the world (e.g.,
"The sky is blue").
 Rules:
 Conditional statements that define how knowledge is
derived or used (e.g., "If it rains, then bring an umbrella").
ROLE OF KNOWLEDGE
REPRESENTATION IN AI SYSTEMS
 Expert Systems:
 Models domain-specific knowledge (e.g., medical diagnosis)
for decision-making.
 Robotics:
 Allows robots to map and navigate environments, and make
informed decisions about tasks.
 Natural Language Processing:
 Helps machines interpret and respond to human language
by structuring linguistic knowledge.
 AI Planning:
 Represents possible actions and outcomes to create
effective action plans in dynamic environments.
WHAT IS PROPOSITIONAL LOGIC
(TRUE/FALSE)?
 Definition:
 Propositional Logic (PL) is a symbolic logic that deals with
propositions that can be either true or false.
 Basic Components:
 Propositions: Statements like "P" or "Q" which can be true or
false.
 Logical Operators:
 NOT - Negation ( ¬ ): Negates the truth value.
 OR – Disjunction ( ∨ ): At least one proposition must be true.
 AND - Conjunction ( ∧ ): Both propositions must be true.
 IF-Then – Implies ( → ): If the first proposition is true, then the
second must be true.
 IFF – If and Only If
PROPOSITIONAL LOGIC -
EXAMPLES
NOT - Negation ( ¬ ): P = “It is raining”
 ¬P (It’s not raining)

 OR – Disjunction ( ∨ ): P= “You should talk”, Q = “Listen at a time”


 P ∨ Q (You should talk or listen at a time)

 AND - Conjunction ( ∧ ): P = “We will go to University”, Q = “We will


attend lectures”
 P ∧ Q (We will go to University and We will attend lectures)

 IF -Then – Implies ( → ): P = “There is a rain”, Q = “The roads will be wet”


 P → Q (If There is a rain then The roads will be wet)

 IFF – If and Only If ( ): P = “I will cook”, Q = “I feel hungry”


WHAT IS FIRST ORDER LOGIC /
PREDICATE LOGIC?
 Definition:
 First Order Logic (FOL) extends propositional logic by
including objects, relations, and quantifiers.
 Basic Components:
 Constants: Specific objects in the domain (e.g., "Alice," "Bob").
 Variables: Represent general objects (e.g., x, y).
 Predicates: Describe properties or relations (e.g., Loves(Alice,
Bob)).
 Quantifiers:
 Universal Quantifier ( ∀ ): Applies to all instances (e.g., "For all x").
 Existential Quantifier ( ∃ ): Applies to at least one instance (e.g.,
"There exists an x").
FIRST ORDER LOGIC - EXAMPLES

 Example-1:
 Universal Statement: ∀x (Student(x) → Studies(x))
"All students study.
 Example-2:
 Existential Statement: ∃x (Student(x) ∧ Studies(x))
"There exists a student who studies."
 Example-3:
 Predicate Logic: Loves(Alice, Bob) ∧ Friends(Bob,
Charlie)
"Alice loves Bob, and Bob is friends with Charlie."
FIRST ORDER LOGIC - EXAMPLES

 All Boys like Cricket:


 ∀x: Boys(x) → Like (x, Cricket)
 Some Boys like football
 ∃x: Boys(x) ∧ Like (x, Cricket)
FIRST ORDER LOGIC - EXAMPLES

 Ahmed is a Student: ∀x: Boys(x) → Like (x, Cricket) ∃x: Boys(x) ∧


Like (x, Cricket)
 Student (Ahmed)
 Ahmed takes either AI or Geometry:
 Takes (Ahmed, AI) ∨ Takes (Ahmed, Geometry)
 Ahmed takes AI and Geometry:
 Takes (Ahmed, AI) ∧ Takes (Ahmed, Geometry)
 Ahmed takes AI and Geometry but not both on the same
time:
 Takes(Ahmed, AI) ¬ Takes (Ahmed, Geometry)
FIRST ORDER LOGIC - EXAMPLES

 Some students likes Ahmed


 No student likes Ahmed
 All students are intelligent
 All job holding persons are happy
 All happy peoples smile
 Someone is educated
 Someone is smiling
FIRST ORDER LOGIC - EXAMPLES
 1. Some students likes Ahmed  3. All students are intelligent
 ∃x (Student(x) ∧ Likes(x, Ahmed))  ∀x: (Student(x) → Intelligen(x))
  ∀x: For all individuals x.
∃x: There exists an individual x.
  Student(x): x is a student
Student(x): x is a student
  Intelligent(x): x is intelligent.
Likes(x, Ahmed): x likes Ahmed

 4. All job-holding persons are happy


 2. No student likes Ahmed
  ∀x: (Job Holding Person(x)→Happy(x))
∀x (Student(x) → ¬ Likes (x, Ahmed))
  ∀x: For all individuals x.
∀x: For all individuals x.
 Job Holding Person(x): x is a job-holding
 Student(x): x is a student.
person
 ¬ Likes(x, Ahmed): x does not like  Happy(x): x is happy.
Ahmed.
FIRST ORDER LOGIC - EXAMPLES

 5. All happy people smile


 ∀x(Happy(x)→Smiles(x))
 ∀x: For all individuals x.  7. Someone is smiling
 Happy(x): x is happy.  ∃x: Smiles(x)
 Smiles(x): x smiles.
 ∃x: There exists an individual x.
 Smiles(x): x is smiling.
 6. Someone is educated
 Intelligent(x): x is intelligent.
 ∃x: Educated(x)
 ∃x: There exists an individual x.
 Educated(x): x is educated.
PROPOSITIONAL LOGIC V/S FIRST ORDER
LOGIC
END OF LECTURE

You might also like