FAIML: Unit 3: Knowledge and
Reasoning
Syllabus:
Knowledge-Based Agent in Artificial intelligence: Architecture, Approaches to
designing a
knowledge-based agent,
knowledge representation: Techniques of knowledge representation,
Propositional logic, Rules of Inference, First-Order Logic, Forward Chaining and
backward chaining
in AI,
Reasoning in Artificial intelligence: Types of Reasoning and Probabilistic
reasoning, Uncertainty.
Q.1) What are the elements of propositional logic.
Ans:
✅ Elements of Propositional Logic
Propositional logic is a way to represent facts and rules using simple statements. It
works with true or false values.
Here are the main elements:
1. Propositions (Statements)
These are simple sentences that are either true or false (not both).
Examples:
P : It is raining.
Q : The light is on.
FAIML: Unit 3: Knowledge and Reasoning 1
2. Logical Connectives (Operators)
Used to combine or modify statements.
Symbol Name Meaning Example
¬ NOT Opposite of a statement ¬P = It is not raining
∧ AND
Both statements must be P ∧ Q = It’s raining and
true the light is on
∨ OR
At least one statement is P ∨ Q = It’s raining or the
true light is on
IMPLIES If first is true, then P → Q = If it rains, the light
→
(If...then) second must be true is on
Both are true or both are P ↔ Q = It rains if and
↔ BICONDITIONAL
false only if the light is on
3. Truth Values
Each proposition is either True (T) or False (F).
Example:
If P = It is sunny , and it’s not sunny → P = False
4. Parentheses
Used to group parts of logical expressions and control the order.
Example:
(P ∨ Q) ∧ R
5. Compound Statements
Made by combining simple statements using logical connectives.
Example:
P ∧ (Q → R)
FAIML: Unit 3: Knowledge and Reasoning 2
Q.2) Define an inference procedure.
Ans:
✅ Inference Procedure in AI
🔹 What is it?
An inference procedure is a method used by an AI system to logically derive new
information from what it already knows.
It uses facts (statements) and rules from the Knowledge Base (KB).
It applies rules of logic to reach valid conclusions.
🔹 Why is it important?
In AI, just storing knowledge is not enough. The system must also be able to think
and reason based on that knowledge.
An inference procedure is like the AI’s brain that helps it:
Answer questions
Make decisions
Solve problems
🔹 How does it work?
Example:
Let’s say the Knowledge Base (KB) contains:
1. All birds can fly. → Bird(x) → CanFly(x)
2. Tweety is a bird. → Bird(Tweety)
Using an inference procedure, the system can infer:
→ CanFly(Tweety) (Tweety can fly)
This is done using logic rules like Modus Ponens (if A → B and A is true, then B is
true).
FAIML: Unit 3: Knowledge and Reasoning 3
🔹 Types of Inference Procedures:
1. Forward Chaining
Starts from known facts and applies rules to find conclusions.
Data-driven.
Example: You know symptoms → you find disease.
2. Backward Chaining
Starts from a goal (what you want to prove) and works backward to check
if known facts support it.
Goal-driven.
Example: You want to check if a person has flu → you look for matching
symptoms.
Q.3) Compare Forward Chaining and Backward
Chaining.
Ans:
🔁Intelligence
Forward Chaining vs 🔄 Backward Chaining in Artificial
Feature Forward Chaining Backward Chaining
Starts with known facts and Starts with a goal (query) and
Definition
applies rules to reach a goal. works backward to prove it.
Direction of Data-driven (bottom-up
Goal-driven (top-down approach)
Reasoning approach)
Begins from available facts in the Begins from desired conclusion
Starting Point
knowledge base or goal
Working Applies rules to known facts to Checks if goal can be proven from
Mechanism infer new facts known facts and rules
Used when all or many facts are Used when a specific goal is
When Used given, and conclusions are known, and we want to check if it
needed is true
FAIML: Unit 3: Knowledge and Reasoning 4
Explores all possible conclusions Explores all possible reasons that
Search Strategy
from given facts could lead to the goal
Can be inefficient if there are More efficient for specific goals
Performance
many irrelevant facts but can fail if goal is unreachable
Application Expert systems, diagnosis Query systems, theorem proving,
Example systems goal checking
Facts: Fever, Cough. Rule: If Fever Goal: Does the patient have Flu?
Example
and Cough → Flu. Result: Flu Look for rules/facts to prove it.
Like moving forward through a Like tracing backward from the
Real-life Analogy
flowchart result to find the cause
✅ Example for Better Understanding
Forward Chaining:
Given Facts:
John has fever
John has cough
Rule:
If someone has fever and cough → they might have flu
Inference:
Since John has both, we conclude: John might have flu
Backward Chaining:
Goal:
Does John have flu?
Check rule:
To have flu, John must have fever and cough
Ask:
Does John have fever? (Yes)
Does John have cough? (Yes)
FAIML: Unit 3: Knowledge and Reasoning 5
Conclusion:
Yes, John might have flu
Summary
Use Forward Chaining when you know the facts and want to discover what
can be concluded.
Use Backward Chaining when you have a goal and want to verify if it can be
reached using the facts and rules.
Q.4) What is propositional logic? Explain with example
What is Propositional Logic?
Propositional Logic is a branch of logic that deals with propositions — statements
that are either true or false — and uses logical connectives to form new
statements.
It helps us represent facts and reason about them in a clear, structured way.
Key Points:
A proposition is a simple statement with a definite truth value (true or false).
Propositional logic combines propositions using connectives like AND ( ∧), OR
∨
( ), NOT (¬), IMPLIES (→), etc.
It allows us to build complex statements and determine their truth based on
the truth of simple propositions.
Example:
Let’s consider two propositions:
P: "It is raining."
Q: "I have an umbrella."
FAIML: Unit 3: Knowledge and Reasoning 6
Using propositional logic, we can form statements like:
P ∧ Q: "It is raining and I have an umbrella."
P → Q: "If it is raining, then I have an umbrella."
¬P: "It is not raining."
Q.5) Define Declarative and procedural knowledge
Ans:
✅ Declarative Knowledge
What is it?
Declarative knowledge is the knowledge of facts and information — basically,
knowing what something is. It involves understanding facts, concepts, and
relationships that can be stated clearly.
Characteristics:
Expressed in statements or propositions.
Can be easily written down, described, or communicated.
Static in nature — it represents knowledge about the world or a subject.
Example: "The Earth orbits the Sun," "Water freezes at 0°C."
In AI:
Stored in knowledge bases as facts or data.
Used for reasoning about the world.
Example: In a medical expert system, "Fever is a symptom of flu."
✅ Procedural Knowledge
What is it?
FAIML: Unit 3: Knowledge and Reasoning 7
Procedural knowledge is the knowledge of how to perform tasks or how to do
something. It involves the steps, methods, or procedures required to achieve a
goal or solve a problem.
Characteristics:
Expressed as instructions, rules, or algorithms.
Often harder to communicate explicitly because it may involve skills or
processes.
Dynamic in nature — it guides actions and operations.
Example: How to ride a bike, how to solve a quadratic equation step-by-step.
In AI:
Encoded as rules or procedures in rule-based systems.
Used to control behavior or decision-making.
Example: In a chess program, the procedure to decide the next best move.
Q.6) What is Proposition in AI? Explain types of
Propositions with example
Ans:
What is a Proposition in AI?
A proposition is a statement that can be clearly identified as either true or false.
In Artificial Intelligence, propositions are used to represent knowledge as facts or
assertions about the world.
Types of Propositions
1. Atomic Proposition
The simplest type of proposition.
FAIML: Unit 3: Knowledge and Reasoning 8
It expresses a single fact or statement without any logical connectors.
Example:
"It is raining." (denoted as P )
"The light is on." (denoted as Q )
2. Compound Proposition
Formed by combining two or more atomic propositions using logical
connectives such as:
AND ( ∧)
OR ( ∨ )
NOT ( ¬ )
IMPLIES ( → )
Example:
P∧Q means "It is raining AND the light is on."
¬P means "It is NOT raining."
P→Q means "If it is raining, then the light is on."
Summary Table
Type Definition Example
Atomic Proposition Single simple statement "It is raining." ( P )
Compound Combination of propositions with P ∧ Q ("It is raining AND the
Proposition connectives light is on.")
Q.7) State and explain rules of inference
Ans:
What are Rules of Inference?
FAIML: Unit 3: Knowledge and Reasoning 9
Rules of Inference are logical tools or patterns that allow us to derive new true
statements (conclusions) from known true statements (premises). They form the
backbone of logical reasoning and help AI systems to infer new facts from existing
knowledge.
Common Rules of Inference with Explanation and
Examples:
Rule Name Explanation Example
If "P implies Q" (P → Q) is true and P is Premises: P → Q,
Modus Ponens
true, then Q must be true. PConclusion: Q
If "P implies Q" (P → Q) is true and Q is Premises: P → Q,
Modus Tollens
false, then P must be false. ¬QConclusion: ¬P
Hypothetical If P → Q and Q → R are true, then P → Premises: P → Q, Q →
Syllogism R is true. RConclusion: P → R
Disjunctive If P∨ Q (P or Q) is true and ¬P is true, Premises: P∨ Q,
Syllogism then Q must be true. ¬PConclusion: Q
If P is true and Q is true, then P ∧ Q is Premises: P, QConclusion:
Conjunction
true. P∧ Q
Simplification
If P∧ Q is true, then P is true (or Q is Premises: P∧
true). QConclusion: P
Explanation with a simple example — Modus Ponens:
Premise 1: If it rains, the ground will be wet. (P → Q)
Premise 2: It is raining. (P)
Conclusion: Therefore, the ground is wet. (Q)
Why are Rules of Inference important in AI?
They help AI systems derive new knowledge from known facts.
They are used in automated theorem proving, expert systems, and logical
reasoning.
FAIML: Unit 3: Knowledge and Reasoning 10
They ensure that conclusions drawn are logically valid.
Q.8) Explain Frame Representation with its merits and
demerits.
Ans:
What is Frame Representation?
Frame Representation is a way of organizing knowledge in Artificial Intelligence
that structures information about objects, events, or situations in a data structure
called a frame.
A frame is like a container or template representing a concept or object.
It consists of slots (attributes or properties) and values that describe the
features of that concept.
Frames often include default values, procedures, or constraints associated
with slots.
Frames are useful to represent stereotypical knowledge — e.g., what is usually
true about a “car,” “person,” or “restaurant.”
Structure of a Frame
Frame Name: The concept or object being described (e.g., “Car”).
Slots: Attributes or properties related to the frame (e.g., color, model, engine
type).
Slot Values: The values assigned to the slots (e.g., color = red, model =
sedan).
Procedures/Methods: Actions or rules related to the frame (optional).
Example of a Frame for a “Car”
Slot Value
FAIML: Unit 3: Knowledge and Reasoning 11
Model Sedan
Color Red
Engine Type Petrol
Number of Doors 4
Start Engine Procedure to start engine
Merits (Advantages) of Frame Representation
1. Organized Structure: Frames organize knowledge in a structured way, making
it easier to understand and manage.
2. Inheritance: Frames can inherit slots and values from parent frames (like
subclasses), promoting knowledge reuse.
3. Default Values: Slots can have default values, which saves time and simplifies
knowledge representation.
4. Modularity: Complex knowledge can be broken down into smaller,
manageable frames.
5. Supports Procedural Attachments: Frames can include procedures (methods)
for dynamic behavior.
Demerits (Disadvantages) of Frame Representation
1. Rigid Structure: Frames may be too rigid to represent very complex or highly
dynamic knowledge.
2. Limited Expressiveness: They are less suitable for representing uncertain or
probabilistic knowledge.
3. Inheritance Conflicts: Multiple inheritance can cause conflicts or ambiguity
about slot values.
4. Maintenance Complexity: Large frame systems can become hard to maintain
and update.
5. Lack of Formal Semantics: Frame systems sometimes lack precise logical
semantics, which can make automated reasoning difficult.
FAIML: Unit 3: Knowledge and Reasoning 12
Q.9) What is the relationship between knowledge and
intelligence? Explain AI knowledge cycle.
Ans:
Relationship Between Knowledge and Intelligence
Knowledge is the collection of facts, information, and skills acquired through
experience or education. It is the raw data or understanding about the world.
Intelligence is the ability to apply knowledge effectively to solve problems,
learn, adapt, and make decisions.
In short:
Knowledge is what you know.
Intelligence is how you use that knowledge to think, reason, and act.
Example:
A person may have a lot of knowledge about cars (parts, how they work).
Intelligence is the ability to use that knowledge to diagnose a car problem or
invent a new engine design.
In AI, intelligent systems use knowledge to perform tasks like reasoning,
learning, and problem-solving.
AI Knowledge Cycle
The AI Knowledge Cycle describes the process of how knowledge is handled in
AI systems — from acquisition to use and update.
The main stages are:
1. Knowledge Acquisition
Collecting facts, rules, and data from experts, databases, or observations.
Example: Gathering medical knowledge from doctors.
FAIML: Unit 3: Knowledge and Reasoning 13
2. Knowledge Representation
Organizing the acquired knowledge in a format that AI systems can
process.
Example: Using rules, frames, or logic to represent facts.
3. Knowledge Reasoning (Inference)
Using the represented knowledge to draw conclusions or make decisions.
Example: An expert system diagnosing diseases based on symptoms.
4. Knowledge Learning (Updating)
Improving or updating the knowledge base with new information or
corrections.
Example: The system learns from new patient data to improve diagnosis.
5. Knowledge Use
Applying the knowledge to solve real problems or assist users.
Example: Recommending treatments to doctors.
Visual Summary of AI Knowledge Cycle
Knowledge Acquisition → Knowledge Representation → Knowledge Reasonin
g → Knowledge Use → Knowledge Learning → (back to Acquisition)
Why is the Knowledge Cycle Important?
It ensures that AI systems can acquire, store, reason, use, and improve
knowledge continuously.
Makes AI systems more flexible, adaptive, and intelligent over time.
FAIML: Unit 3: Knowledge and Reasoning 14
Q.10) Explain Semantic Network Representation with
example? State the drawbacks of Semantic Network
Representation.
Ans:
🔹 What is Semantic Network Representation?
A Semantic Network is a way to represent knowledge using a graph.
It consists of nodes (circles) and edges (arrows or lines).
Nodes represent concepts or objects (like "Bird", "Animal", "Canary").
Edges represent relationships (like "is-a", "has", "can").
It is used in Artificial Intelligence (AI) to model how knowledge is connected,
similar to how humans relate concepts in their mind.
🔹 Example of Semantic Network
Let’s take an example related to animals:
Animal
|
is-a
|
Bird
/ | \
is-a has can
/ | \
Canary Wings Fly
Explanation:
"Canary" is-a "Bird"
"Bird" is-a "Animal"
"Bird" has "Wings"
FAIML: Unit 3: Knowledge and Reasoning 15
"Bird" can "Fly"
This network helps the system understand that:
Canary is a Bird → therefore, Canary is also an Animal.
Since Birds can fly → Canary can fly.
This inheritance of properties helps in reasoning.
🔹 Drawbacks of Semantic Network Representation
1. Inexact Representation:
Not suitable for representing complex or uncertain knowledge.
Relationships are sometimes vague (e.g., “related to” doesn’t tell how
exactly).
2. Inheritance Conflicts:
If two parent nodes give different properties, the system might get
confused.
(e.g., Penguins are birds but can’t fly, which breaks the rule "birds can
fly").
3. No Standard Rules:
There’s no strict structure or rules, which may lead to inconsistent
networks.
4. Scalability Issues:
As the network grows, it becomes large and hard to manage.
features, reducing dimensions may not
help much.
FAIML: Unit 3: Knowledge and Reasoning 16