0% found this document useful (0 votes)
4 views15 pages

Lec 3,4

The document discusses knowledge representation in artificial intelligence, focusing on Propositional Logic and Predicate Logic (First-Order Logic). Propositional Logic uses simple true/false propositions and logical connectives, while Predicate Logic allows for more complex relationships and quantification. The document also highlights the differences between the two logics and provides examples to illustrate their applications.

Uploaded by

sadia butt
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)
4 views15 pages

Lec 3,4

The document discusses knowledge representation in artificial intelligence, focusing on Propositional Logic and Predicate Logic (First-Order Logic). Propositional Logic uses simple true/false propositions and logical connectives, while Predicate Logic allows for more complex relationships and quantification. The document also highlights the differences between the two logics and provides examples to illustrate their applications.

Uploaded by

sadia butt
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/ 15

KNOWLEDGE

REPRESENTATION WITH AI Propositional Logic,


Predicate Calculus
APPLICATIONS:
INTRODUCTION:
Knowledge representation (KR) is a critical area in artificial
intelligence that deals with how to represent information about the
world that an AI system can understand and reason about. In this
lecture, we focus on two fundamental ways to represent
knowledge: Propositional Logic and Predicate Logic (also
called First-Order Logic). These are the building blocks for more
complex AI systems that involve reasoning, decision-making, and
problem-solving.
PROPOSITIONAL LOGIC
Propositional logic (also known as propositional calculus or Boolean
logic) is a simple but powerful way to represent knowledge using
propositions, which are statements that are either true or false.
Syntax
Syntax of Propositional
1. Logic Atomic Propositions: These are the simplest
statements, like P, Q, or R. Each atomic proposition represents a
fact about the world.
Example:
P: "It is raining.“ Q: "The ground is wet."
PROPOSITIONAL LOGIC
2. Complex Propositional Logic:
Each proposition can be assigned a truth value: True (T) or False (F).
The truth value of more complex statements can be computed using
truth tables.
Example: Let's define P = "It is raining" and Q = "The ground is
wet."
P ∧ Q is true only if both P and Q are true.
P ∨ Q is true if at least one of P or Q is true.
¬P is true if P is false.
PROPOSITIONAL LOGIC
Logical Connectives: These connect atomic propositions to form
more complex sentences.
¬ (NOT): Negates a statement (e.g., ¬P means "It is not raining").
∧ (AND): Conjunction of two propositions (e.g., P ∧ Q means "It is
raining, and the ground is wet").
∨ (OR): Disjunction of two propositions (e.g., P ∨ Q means "It is either
raining or the ground is wet").
→ (IMPLIES): Conditional statement (e.g., P → Q means "If it is
raining, then the ground is wet").
↔ (IFF): Biconditional (e.g., P ↔ Q means "It is raining if and only if
the ground is wet").
EXAMPLES
SOLVE
1. If it rains then I will stay at home.
2. If I will go to Austria then I will earn more money.
3. He is poor but honest
4. If: a=b and b=c then a=c5.
5. Neither it is hot nor it is cold, today.
6. He goes to play a match if and only if does not rain.
7. Birds fly if and only if sky is clear.
8. It is false that he is poor but not honest.
EXAMPLE FROM THE BOOK
Consider the famous Wumpus World. In the Wumpus World, the
agent has to avoid a Wumpus (a dangerous creature) and navigate
safely.
Let P1,1 mean "There is a pit in [1,1]" and W1,2 mean "There is a
Wumpus in [1,2]."
The sentence ¬W1,2 means "There is no Wumpus in [1,2]."
The agent can use logical reasoning to avoid dangers based on the
knowledge of pits, the Wumpus, and other clues.
PREDICATE LOGIC (FIRST-
ORDER LOGIC OR FOL)
While propositional logic is useful for some types of reasoning, it
lacks the expressive power needed for more complex situations,
like representing relationships between objects. Predicate logic (or
First-Order Logic, FOL) addresses this limitation by introducing
variables, predicates, and quantifiers.
Syntax of Predicate Logic
Constants: Represent specific objects (e.g., John, Apple, 3).
Variables: Represent arbitrary objects (e.g., x, y).
Predicates: Represent properties of objects or relationships
between objects (e.g., Likes(John, Pizza), which means "John likes
pizza").
PREDICATE LOGIC (FIRST-
ORDER LOGIC OR FOL)
Quantifiers: Universal quantifier (∀): Means "for all" (e.g., ∀x
Likes(x, Pizza), which means "Everyone likes pizza").
Existential quantifier (∃): Means "there exists" (e.g., ∃x
Likes(John, x), which means "There is something that John likes").
EXAMPLES
•Question: "Is every human mortal?"
•Predicate Logic: ∀x (Human(x) → Mortal(x))
•Explanation: For all x, if x is a human, then x is mortal.
•Question: "Is there a city where it always rains?"
•Predicate Logic: ∃x (City(x) ∧ AlwaysRains(x))
•Explanation: There exists an x such that x is a city and it always rains in x.
•Question: "Does everyone love pizza?"
•Predicate Logic: ∀x (Person(x) → Loves(x, Pizza))
•Explanation: For all x, if x is a person, then x loves pizza.
•Question: "Is there someone who can solve every problem?"
•Predicate Logic: ∃x ∀y (Problem(y) → Can Solve(x, y))
•Explanation: There exists an x such that for every y, if y is a problem, x can solve it.
EXERCISE
•Question: "Do all dogs have tails?"
•Predicate Logic: ∀x (Dog(x) → HasTail(x))
•Explanation: For all x, if x is a dog, then x has a tail.
•Question: "Is it true that if a person is a student, then they study?"
•Predicate Logic: ∀x (Student(x) → Studies(x))
•Explanation: For all x, if x is a student, then x studies.
Question: "Is there a country where everyone speaks two languages?"
Predicate Logic: ∃x (Country(x) ∧ ∀y (InCountry(y, x) →
SpeaksTwoLanguages(y)))
•Explanation: There exists a country x such that for all y in that country, y
speaks two languages.
Question: "Do all birds fly?"
Predicate Logic: ∀x (Bird(x) → Flies(x))
•Explanation: For all x, if x is a bird, then x flies.
SEMANTICS OF
PREDICATE LOGIC
In predicate logic, each variable can take values from a domain of
objects, and predicates represent the properties of or relations
between these objects.
For example, let Likes(x, y) be a predicate meaning "x likes y". If
the domain of x and y includes people and foods, we can have
sentences like:
 Likes(John, Pizza): "John likes pizza."
 ∀x Likes(x, Pizza): "Everyone likes pizza."
 ∃x Likes(x, Pizza): "Someone likes pizza."
EXAMPLE FROM THE BOOK
Let's revisit the Wumpus World in the context of predicate logic.
Suppose we want to express more complex information about the
locations and dangers:
Pit(x, y): "There is a pit in location (x, y)."
Breeze(x, y): "There is a breeze in location (x, y).“
We can write rules like:
∀x ∀y (Pit(x, y) → Breeze(x+1, y) ∧ Breeze(x-1, y) ∧ Breeze(x, y+1)
∧ Breeze(x, y-1)).
This rule says that if there's a pit at (x, y), then there will be a
breeze in the neighboring squares.
DIFFERENCES BETWEEN
PROPOSITIONAL AND PREDICATE
LOGIC
Feature Propositional Logic Predicate Logic
Objects,
Facts as true or false
Representation relationships, and
propositions
properties
More expressive,
Complexity Less expressive allows for complex
reasoning
Allows quantifiers (∀,
Quantification Not possible
∃)
Likes(John, Pizza):
Example P: "It is raining"
"John likes pizza."

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