0% found this document useful (0 votes)
12 views19 pages

Knowledge-Based Agents Explained

The document provides a comprehensive overview of Knowledge-Based Agents (KBAs), detailing their architecture, components, and the roles of the Knowledge Base and Inference Engine. It explains various types of Knowledge Representation (KR), the significance of logic in AI reasoning, and methods for converting English to First-Order Logic (FOL). Additionally, it contrasts forward and backward chaining as reasoning techniques used in AI.

Uploaded by

shreya12k19
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)
12 views19 pages

Knowledge-Based Agents Explained

The document provides a comprehensive overview of Knowledge-Based Agents (KBAs), detailing their architecture, components, and the roles of the Knowledge Base and Inference Engine. It explains various types of Knowledge Representation (KR), the significance of logic in AI reasoning, and methods for converting English to First-Order Logic (FOL). Additionally, it contrasts forward and backward chaining as reasoning techniques used in AI.

Uploaded by

shreya12k19
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

1.

Architecture of Knowledge-Based Agent


Introduction:
A Knowledge-Based Agent stores knowledge about the world and
uses it to take rational actions.
Definition:
A Knowledge-Based Agent (KBA) is an AI agent that uses a
knowledge base + inference to make decisions.
Key Components:
1. Knowledge Base (KB) – facts stored in logic
2. Inference Engine – derives new conclusions
3. Percept Sequence – input history
4. Action Selection – rational action output
How it Works:
 Perceive environment
 Add percept into KB
 Infer new knowledge using rules
 Choose the best action
Diagram:

Example:
Medical diagnosis agent uses symptoms → diagnoses disease.
Conclusion:
A knowledge-based agent is intelligent because it reasons
logically, learns new facts, and makes rational decisions.
2. Discuss the Role of Knowledge Base and Inference Engine
in Knowledge-Based Agent (with Example)
Introduction:
Knowledge-based agents use stored knowledge and logical
reasoning to act intelligently.
Definition:
 A Knowledge Base (KB) stores facts and rules in logical
form.
 An Inference Engine applies reasoning rules to derive new
knowledge.

Role of Knowledge Base (KB)


1. Stores facts, rules, and domain knowledge
2. Works like memory of the agent
3. Uses logic for accurate representation
4. Helps the agent understand the world
5. Allows updating knowledge (add/remove facts)
Example: Fact: Human(Socrates)
Rule: ∀x (Human(x) → Mortal(x))
Role of Inference Engine
1. Applies logic and reasoning rules
2. Derives new conclusions from KB
3. Uses forward & backward chaining
4. Works like the brain of the agent
5. Supports decision making based on beliefs
Example of Inference Engine Working:
Using rules:
Human(Socrates) → Mortal(Socrates)
Derived:
Mortal(Socrates)

Diagram:

 KB stores: Diseases, symptoms, treatments


 Inference engine: Matches symptoms → identifies disease
 Real-Life Example (Medical Expert System)

Conclusion:
The Knowledge Base provides what is known,
while the Inference Engine provides what can be concluded,
together making an AI agent intelligent and rational.

3. Knowledge Base vs Inference Engine


Knowledge Base (KB) Inference Engine
Stores facts & rules Applies logic to facts & rules
Works like agent’s memory Works like agent’s brain
Static until updated Dynamic – does reasoning
Contains knowledge about the Uses rules to derive new
world knowledge
Knowledge Base (KB) Inference Engine
Uses logical inference (AND, OR,
Written in logical form
→)
Supports learning & updates Supports decision making
Houses data, facts, Applies forward/backward
relationships chaining
Example: “All humans are Example: “Socrates is mortal”
mortal” (derived)

Short conclusion:
KB = What the agent knows
Inference Engine = What the agent thinks

4. Properties of Good Knowledge Representation


Introduction:
Good KR helps AI think correctly.
Definition:
KR is a formal way to store knowledge for reasoning.
Properties (from FOI):
1. Representational Adequacy – can store all useful facts
2. Inferential Adequacy – can derive new facts
3. Inferential Efficiency – reasoning is fast
4. Acquisitional Efficiency – easy to update KB
5. Consistency – no contradictions
6. Clarity – understandable structure
Example:
Propositional & First-Order Logic have these properties.
Diagram:

Conclusion:
A good KR system makes AI correct, efficient & intelligent.

Describe the relationship between Knowledge Representation,


Reasoning, and Logic. Why logic is considered fundamental tool
for AI reasoning?
Introduction:
In AI, knowledge must be stored and used in a way that the
machine can reason and make decisions.
This is done through Knowledge Representation, Logic, and
Reasoning.

Definition of Concepts
Knowledge Representation (KR):
A formal method to store knowledge about the world in a
machine-readable form.
Logic:
A mathematical language used to represent knowledge clearly
and unambiguously.
Reasoning:
The process of drawing conclusions from known facts using
logical rules.

Relationship Between KR, Reasoning & Logic


KR Logic Reasoning
Tells how to store Gives structure & Uses logic rules to
knowledge symbols think
Represents objects, Defines syntax &
Deduces new facts
facts semantics
Example: Bird(x) → Example: Tweety
Example: Bird(Tweety)
Fly(x) can fly
How They Work Together:
1. KR uses logic to represent facts
2. Reasoning uses logic rules on these facts
3. AI then draws new conclusions
4. No guessing — only valid logical steps
5. This makes AI rational and intelligent

Why Logic is Fundamental in AI Reasoning? (8 Points)


1. Precision: No confusion, clear meaning
2. Truth Preservation: Ensures correct results
3. Soundness: Only true facts are derived
4. Completeness: All logical conclusions covered
5. Structured Language: Easy to read and update
6. Supports Different Inference Methods
o Forward chaining
o Backward chaining
7. Universal Framework: Works in any domain (medical, legal,
etc.)
8. Basis for Knowledge Systems: Expert systems & intelligent
agents use logic

Example:
Facts:
1. All humans are mortal
2. Ram is a human
Logic Representation:
∀x (Human(x) → Mortal(x))
Human(Ram)
Reasoning:
Ram is Mortal

Conclusion:
Logic is the backbone of AI because it connects knowledge
storage with intelligent reasoning, helping machines think in a
consistent, correct, and rational manner.
6. Explain Types of Knowledge Representation (with
Examples)
Introduction:
Knowledge Representation (KR) is the way AI stores information
to reason intelligently.
Definition:
KR is a formal structure to represent facts, objects, relations, and
rules.

Types of KR (with examples)


1. Logical Representation
 Uses propositional & first-order logic
 Based on facts & inference
Example:
∀x (Bird(x) → Fly(x))

2. Semantic Networks
 Graph of nodes (objects) & edges (relations)
Example:
Parrot ---ISA---> Bird
Bird ----ISA----> Animal

3. Frames
 Data structure with slots & values (Like object-oriented)
Example Frame:
Frame: CAR
Slots:
Color: Red
Wheels: 4
Fuel: Petrol

4. Production Rules
 IF-THEN rules for inference
Example:
IF fever AND cough
THEN Possible Infection

5. Scripts
 Represent sequence of events (used in NLP)
Example (Restaurant Script):
1. Enter restaurant
2. Sit at table
3. Order food
4. Eat
5. Pay bill
6. Leave
Conclusion:
Different KR methods are used for different AI tasks like
reasoning, language understanding, and decision-making

Q7. Propositional Logic – Syntax & Semantics


Introduction
Propositional logic is the simplest form of logic.

Definition
It works with statements that are either TRUE or FALSE.
Syntax (building blocks)
 P, Q, R → letters
 ¬ not
 ∧ and
 ∨ or
 → implies

Semantics
Meaning is based on truth values.
Example
P: "It is raining" = True
Q: "Ground is wet" =
True P → Q is True
Conclusion
Propositional logic is simple but cannot describe people or
objects.

8. Truth Tables & Logical Equivalence (Explained Simply)


Introduction:
In logic, we want to check if statements are always true or false.
Truth Tables help us do that.

Truth Table — Meaning


A Truth Table shows all possible truth values (True or False) of
logical statements.
It is used to check:
 Validity
 Logical equivalence
 Tautology
 Contradiction
Example: Logical Connective → (Implication)
Statement: P → Q
PQP→ Q
TT T
TF F
FT T
FF T
Meaning:
 Only false when P is true and Q is false
 In all other cases → True

Logical Equivalence — Meaning


Two statements are logically equivalent if:
 They ALWAYS have the same truth value
 In every row of their truth tables
We write:
A≡B

Popular Equivalence Example — De Morgan’s Law


¬(P ∧ Q) ≡ ¬P ∨ ¬Q
P Q P ∧ Q ¬(P ∧ Q) ¬P ¬Q ¬P ∨ ¬Q
TT T F F F F
TF F T F T T
FT F T T F T
FF F T T T T
Both columns match → Equivalent

Diagram:

Conclusion:
Truth tables help us verify logic, avoid errors, and prove two
formulas mean the same thing.

9. First-Order Logic (FOL) — Syntax & Semantics


Introduction:
First-Order Logic is stronger than propositional logic.
It talks about objects, people, animals, places, and relationships.

Definition:
First-Order Logic =
Logic that allows us to represent individual things + their
properties + relations

Syntax (How to Write FOL)


1. Constants:
o Represent specific objects
o Example: Ram, India
2. Variables:
o General placeholders
o Example: x, y
3. Predicates:
o Properties / Relationships
o Example: Loves(x, y) → x loves y
4. Functions:
o Map objects to objects
o Example: FatherOf(Ram)
5. Quantifiers:
o Universal: ∀ (for all)
o Existential: ∃ (there exists)
6. Connectives:
o AND (∧), OR (∨), NOT (¬), IMPLIES (→), IFF (↔)
Semantics (Meaning of FOL)
Semantics tells us HOW FOL statements become TRUE or FALSE.
 Depends on a domain (all objects we talk about)
 Depends on interpretation (meaning given to symbols)

Example with Meaning:


Statement:
∀x (Bird(x) → Fly(x))
Meaning:
“For every x, if x is a Bird, then x can Fly”
Domain: All animals
Interpretation:
Bird(Parrot) → Fly(Parrot)
Diagram:

FOL is more expressive, structured, and meaningful than


propositional logic, making it essential for representing real-
world intelligence.

10. English to FOL Conversion


Introduction:
AI needs a way to convert English sentences into logic form.
This allows machines to understand and reason with language.

Step-by-step Method:
1. Identify objects / nouns
2. Convert them into constants or variables
3. Identify properties / relations
4. Use predicates
5. Identify quantifiers (all / some)
6. Write the logic

Example 1:
English:
"Every student loves some subject."
Breakdown:
 Group word: Every → ∀
 Student → Student(x)
 Loves → Loves(x, y)
 Subject → Subject(y)
FOL:
∀x (Student(x) → ∃y (Subject(y) ∧ Loves(x, y)))

Example 2:
English:
"All humans are mortal."
FOL:
∀x (Human(x) → Mortal(x))

Example 3:
English:
"There exists a teacher who teaches every student."
Breakdown:
 Exist → ∃
 For all → ∀
FOL:
∃x (Teacher(x) ∧ ∀y (Student(y) → Teaches(x, y)))

Example 4:
English:
"Some cats are black."
FOL:
∃x (Cat(x) ∧ Black(x))

Example 5:
English:
"Every mother loves her child."
FOL:
∀x (Mother(x) → Loves(x, ChildOf(x)))
Conclusion:
FOL helps English sentences become precise, logical, and
machine-processable so AI can think and reason like a human

11. Forward Chaining vs Backward Chaining


Forward Chaining (easy language)
 Start from known facts
 Apply rules
 Find new facts
Example:
If “A is true”
And “A → B”
Then B is true

Backward Chaining
 Start from goal
 Check if facts support it
Example:
Goal: B
Check rule: A → B
Now prove A
Forward Chaining Backward Chaining
Data-driven reasoning Goal-driven reasoning
Starts from known facts Starts from a goal or query
Moves forward to find Moves backward to prove the
conclusion goal
Applies rules on facts to infer Searches for rules that support
new facts the goal
Useful when lots of data is Useful when specific goal is
available known
Works like Breadth-First Search Works like Depth-First Search
(BFS) (DFS)
Used in Expert Systems (e.g. Used in PROLOG & theorem
medical diagnosis) proving
Example: Facts → fever + cough Example: To prove flu → check
= flu fever & cough

Diagram:

You might also like