Lectures KRR
Lectures KRR
Knowledge
Representation
and Reasoning
What is Knowledge Representation?
• Think of an AI system as a student learning about the world. But how does it
store and use knowledge like humans? 🤔
• A student remembers facts 📚 (Islamabad is the capital of Pakistan).
• A chef knows recipes (Step-by-step cooking).
• A detective connects clues 🔍 (If it’s raining, the ground is wet).
• AI also needs a way to store, organize, and use knowledge—this is called Knowledge
Representation (KR).
What is Knowledge Representation?
🌟 Why is it Important?
Without KR, AI would be like a parrot—just repeating data without understanding!
With KR, AI can:
🎯 Answer complex questions.
🔎 Solve problems logically.
🤖 Learn from experience.
What is Knowledge Representation?
• The Gettier Problem comes from a famous paper by Edmund Gettier (1963),
which challenges the Justified True Belief (JTB) definition of knowledge.
1️⃣JTB Definition (Plato’s View)
• The traditional definition states that a person knows something if:
✅ Belief – The person believes the statement.
✅ Truth – The statement is actually true.
✅ Justification – The person has good reasons (justification) to believe it.
Gettier Problem
"The person who will get the job has 10 coins in their pocket."
What happens actually!
This shows that JTB alone is not enough—we need something more than
justification to eliminate luck.
2️⃣Knowledge as Information Processing (AI
& Cognitive Science)
📖 Definition:
• "Knowledge is information that is organized and actionable."
• 📌 Reference: Newell & Simon, Human Problem Solving (1972)
• 🔹 This view is widely used in Artificial Intelligence (AI), suggesting that
knowledge is not just raw data but structured information that can drive
decisions.
3️⃣Knowledge in Epistemology
(Contemporary View)
📖 Definition:
"Knowledge is a warranted, true belief acquired through reliable processes."
📌 Reference: Alvin Goldman, Epistemology and Cognition (1986)
🔹 Goldman introduced Reliabilism, arguing that knowledge is obtained through
cognitive processes that reliably lead to truth.
4️⃣Knowledge in Neuroscience & Cognitive
Science
📖 Definition:
• "Knowledge is the neural encoding of experience that enables prediction and
action."
• 📌 Reference: Eric Kandel, Principles of Neural Science (2000)
• 🔹 This definition connects knowledge to neural representations in the brain,
forming the basis for learning and intelligence.
5️⃣Knowledge in Artificial Intelligence
(Symbolic & Connectionist AI)
📖 Definition:
• "Knowledge is the explicit and implicit representations of the world that allow
reasoning and adaptation."
• 📌 Reference: Brachman & Levesque, Knowledge Representation and Reasoning
(2004)
• 🔹 This AI-based definition includes symbolic knowledge (rules, logic) and
connectionist knowledge (neural networks, deep learning).
6️⃣Pragmatic View of Knowledge (Practical
Perspective)
📖 Definition:
"Knowledge is the ability to predict, explain, and manipulate aspects of reality."
📌 Reference: Karl Popper, Objective Knowledge (1972)
🔹 This definition focuses on practical application—if a person or system can
make predictions or take effective actions, they possess knowledge.
7️⃣Knowledge in Data Science & AI (Modern
Computational Perspective)
📖 Definition:
• "Knowledge is an evolving model of reality, continuously updated with new
evidence."
• 📌 Reference: Judea Pearl, The Book of Why (2018)
• 🔹 This definition aligns with machine learning and causal inference, where
knowledge is always being refined based on new data.
Other formal definitions
• The sum of what is known : the body of truth, information, and principles
acquired by mankind
• Knowledge applies to facts or ideas acquired by study, investigation, observation,
or experience
Types of Knowledge
1. Priori knowledge
2. Posterior knowledge
3. Explicit knowledge
4. Implicit Knowledge
1. Declarative Knowledge (Facts &
Information)
What it is: Explicit or Implicit knowledge that can be stated as facts.
Examples:
Riding a bicycle.
Solving a Rubik’s cube.
Heuristic Knowledge (Rules of
Thumb)
What it is: Experience-based strategies for problem-solving.
Examples:
• Examples:
• "Water is wet."
• "People cannot walk through walls."
7. Ontological Knowledge (Conceptual
Frameworks)
What it is: Organized knowledge about categories and their properties.
• Examples:
Knowledge
Information
Data
Noise 28
Intelligence Human, judgemental
Contextual, tacit
Knowledge Transfer needs learning
Information
Codifiable, explicit
Easily transferable
Data
Symbolic AI (Good Old-Fashioned AI -
GOFAI)
• Symbolic AI is an approach where human knowledge is represented using
symbols and rules, allowing AI systems to reason logically.
Key Features:
• Better KR
What is Reasoning?
4️⃣Types of Reasoning
• Deductive Reasoning: From general rules to specific conclusions.
• Example:
• You wake up and see the road is wet.
• Likely Reason: It rained last night.
🔴 Observation → 🔵 Possible Explanation → 🟢 Best Guess
📌 Examples in AI:
• Chatbots use logical rules to generate responses.
• Automated Theorem Proving verifies mathematical proofs.
• Self-driving cars use logic to make decisions (e.g., stop at red lights).
Logic Types in AI
✅ Example:
• If it is raining (P), then the ground is wet (Q).
• P → Q (Implication rule)
47
Example of Truth Table
Let:
P = "You study"
Q = "You pass the exam"
P → Q (If you study, then you will pass the exam)
Truth Table
Explanation:
I Study (P) I Pass the Exam (Q) P ↔ Q (I Study If and Only If I Pass)
T T T
T F F
F T F
F F T
Equivalence Explaination
• Fuzzy Logic – Deals with degrees of truth (e.g., "The weather is somewhat
cold").
• The tea is somewhat hot (70% hot, 30% warm). (Fuzzy logic allows partial
truth!)
Relation Between Logic and
Reasoning
• Logic provides the rules, while reasoning applies them to derive conclusions.
• Without logic, reasoning can be flawed (e.g., assuming "All birds fly" when
penguins don’t).
• AI and computers use logic to make automated decisions and prove theorems.
Deductive Reasoning:
• This is the most common type of reasoning in FOL.
• Deductive reasoning allows you to start from general rules (axioms or theorems) and apply
them to specific cases.
• Example:
Inference: Derive new facts from existing facts using logical rules.
Consistency Checking: Determine if a set of facts is logically consistent (no
contradictions).
Query Answering: Given a set of facts, you can ask whether a particular
statement is true or false.
Problem Solving: Use logical reasoning to solve problems, such as finding a
sequence of actions to reach a goal (as in planning or AI).
.Universal and Existential Reasoning:
• Universal quantifier (∀) means something is true for all elements in a set.
• Existential quantifier (∃) means something is true for at least one element in a
set.
• Universal statement: "All students pass the test." (∀x (Student(x) → Passes(x,
Test)))
• From this, you can infer that if "Jamil" is a student, then Jamil passes the test.
• Existential statement: "There exists a student who failed the test." (∃x
(Student(x) ∧ ¬Passes(x, Test)))
• You can infer there is at least one student who failed.
What Does FOL Reasoning Allow Us
to Do?
• Inference: Derive new facts from existing facts using logical rules.
• Deductive Reasoning: