Unit 3 :
Que 1 : Explain forward and backward chaining with example.
Forward Chaining
Definition: Forward chaining is a reasoning strategy that starts with the known facts and applies rules
to generate new conclusions until the goal is reached. It's a "data-driven" approach - moving from
what we know toward what we want to prove.
Example:
Imagine a simple medical diagnosis system with these rules:
1. If (fever AND cough), then flu
2. If (sneezing AND runny nose), then cold
3. If (flu AND headache), then severe flu
With forward chaining:
Start with known facts: Patient has fever, cough, and headache
Apply Rule 1: fever AND cough → flu (new fact)
Apply Rule 3: flu AND headache → severe flu (conclusion reached)
The system started with basic symptoms and worked forward to reach a diagnosis.
Backward Chaining
Definition: Backward chaining is a reasoning strategy that starts with the goal and works backward to
find the facts needed to support that goal. It's a "goal-driven" approach - starting with what we want
to prove and figuring out what evidence we need.
Example:
Using the same medical diagnosis system:
Goal: Determine if patient has severe flu
To have severe flu (Rule 3), patient needs flu AND headache
To have flu (Rule 1), patient needs fever AND cough
Check if patient has: fever? Yes. Cough? Yes. Headache? Yes.
Therefore, severe flu is confirmed
The system started with the hypothesis (severe flu) and worked backward to check if the necessary
conditions were met.
Differences:
1. Direction:
Forward chaining: Start with facts → Apply rules → Reach conclusion
Backward chaining: Start with goal → Find supporting rules → Verify facts
2. Efficiency:
Forward chaining works best when there are few initial facts but many possible conclusions
Backward chaining works best when there are many facts but a specific goal to prove
3. Real-world usage:
Forward chaining: Production systems, data analysis, monitoring systems
Backward chaining: Expert systems, diagnostic tools, verification systems
Both strategies are important in artificial intelligence and are often used in rule-based expert systems.
Que 2 : Explain inferential knowledge and procedural knowledge with example
Inferential Knowledge vs Procedural Knowledge
Inferential Knowledge
Definition: Inferential knowledge (also called declarative knowledge) is knowledge about facts,
concepts, and relationships between them. It's "knowing that" something is true and being able to
derive new facts through reasoning.
Examples:
1. School Learning: Knowing that Paris is the capital of France or that water boils at 100°C
2. Medical Diagnosis: A doctor knows that fever plus rash could indicate measles
3. Math Rules: Knowing that 2 + 2 = 4 or that all squares are rectangles
4. Logical Deduction: If all humans are mortal, and Socrates is human, then Socrates is mortal
Real-life Example:
When a detective solves a crime, they use inferential knowledge:
They know the victim was home at 8 PM (fact)
They know the suspect has no alibi (fact)
They know the murder happened at 9 PM (fact)
From these facts, they can infer who might be the murderer
Procedural Knowledge
Definition: Procedural knowledge is knowledge about how to perform specific tasks or actions. It's
"knowing how" to do something rather than just knowing facts about it.
Examples:
1. Physical Skills: Knowing how to ride a bike or swim
2. Technical Skills: Knowing how to code a website or repair a car
3. Artistic Skills: Knowing how to paint or play a musical instrument
4. Daily Tasks: Knowing how to cook pasta or tie shoelaces
Real-life Example:
A chef preparing a meal uses procedural knowledge:
They don't just know ingredients and temperatures (inferential)
They know the sequence of steps to follow
They know techniques like how to julienne vegetables or fold in egg whites
This knowledge is demonstrated through action rather than just stated as facts
Key Differences:
1. Nature:
Inferential: Facts and relationships ("knowing that")
Procedural: Skills and methods ("knowing how")
2. How it's used:
Inferential: Used for reasoning, problem-solving, and making inferences
Procedural: Used for performing tasks and taking actions
3. How it's acquired:
Inferential: Often learned through reading, listening, observing
Procedural: Often learned through practice, experience, repetition
Both types of knowledge are important in artificial intelligence systems. Expert systems often combine
inferential knowledge (rules and facts) with procedural knowledge (how to apply those rules in specific
situations).
Que 3 . How predicate logic is helpful in knowledge representation.
Claude crow
Que 4 : Define Skolemization. Explain Horn Clause with example
Skolemization and Horn Clauses Explained Simply
Skolemization
Definition:
Skolemization is a process in formal logic that eliminates existential quantifiers (∃) by replacing
variables bound by them with functions (called Skolem functions) of the universally quantified
variables.
Simple Definition:
Skolemization is a way to simplify logical statements by replacing "there exists" phrases with specific
named functions that do the same job.
In Child's Terms:
It's like replacing "everyone has someone who is their mother" with "everyone has a mother-finder
function that tells us exactly who their mother is."
Purpose:
Skolemization helps convert logical formulas into a standard form that's easier for computers to
process, especially for automated reasoning and theorem proving.
Horn Clause
Definition:
A Horn clause is a logical formula containing at most one positive literal (conclusion). It can be written
as an implication where the antecedent is a conjunction of literals and the consequent is either a single
literal or empty.
Simple Definition:
A Horn clause is a logical rule that says "if all these conditions are true, then this one conclusion is
true" or sometimes just states a fact directly.
In Child's Terms:
It's like an "if-then" rule where you might have several "if" parts but only one "then" part. For example:
"If it's cold AND it's raining, THEN wear a coat."
Types of Horn Clauses:
1. Fact: Just a single positive statement (Dog(Spot))
2. Rule: If-then statement with conditions and one conclusion (Cold ∧ Raining → WearCoat)
3. Goal: A question to be proven (like ?- WearCoat)
Importance:
Horn clauses form the foundation of logic programming languages like Prolog and are used in
knowledge representation, database systems, and artificial intelligence because they have efficient
resolution procedures.
Que 5 : Give semantic network representation for the following facts: (6 marks)
(i) Raja is a bank manager.
(ii) Raja works in SBI located in Medicaps university campus
(iii) Raja is 26 years old
(iv) Raja has blue eyes
(v) Raja is younger than Piyush.
┌───────────────┐
│ Bank Manager │
└───────────────┘
▲
│
│ is-a
│
│
┌───────────┐ younger-than┌───────────┐ ┌──────────────────┐
│ Piyush │◄────────────│ Raja │ │Medicaps University│
└───────────┘ └───────────┘ │ Campus │
│ │ │ └──────────────────┘
│ │ │ ▲
│ │ │ │
│ │ └──────────────────────────┘
│ │ │
│ │ │
has-age has located-in
│ │ │
▼ ▼ │
┌───────┐ ┌───────┐ ┌───────┐
│ 26 │ │ eyes │ │ SBI │
└───────┘ └───────┘ └───────┘
│
│
has-color
│
▼
┌───────┐
│ blue │
└───────┘
6 . Define the theory of first-order logic and discuss its advantages over propositional
logic
Theory of First-Order Logic and Its Advantages (6 marks)
Definition of First-Order Logic
First-order logic (FOL) is a formal system for representing and reasoning about knowledge that
extends propositional logic by adding the ability to talk about objects, their properties, and
relationships between objects. It introduces variables, quantifiers, predicates, and functions to express
more complex statements.
Basic Components of First-Order Logic:
1. Constants: Specific objects (e.g., john, paris)
2. Variables: Placeholders for objects (e.g., x, y)
3. Predicates: Properties or relationships (e.g., Tall(x), Father(x,y))
4. Functions: Mappings between objects (e.g., mother_of(x))
5. Quantifiers: "For all" (∀) and "There exists" (∃)
6. Logical connectives: AND (∧), OR (∨), NOT (¬), IMPLIES (→)
Advantages Over Propositional Logic:
1. Greater Expressiveness
First-order logic can express much more complex statements than propositional logic. While
propositional logic is limited to true/false statements like "It is raining" (P), first-order logic can express
"All students are happy" as ∀x(Student(x) → Happy(x)).
2. Ability to Represent Quantification
FOL can make statements about "all" objects or "some" objects in a domain:
"All birds can fly": ∀x(Bird(x) → CanFly(x))
"Some students are smart": ∃x(Student(x) ∧ Smart(x)) Propositional logic cannot express these
quantified statements.
3. Representation of Relationships
FOL can express relationships between objects, which propositional logic cannot do:
"John is taller than Mary": TallerThan(john, mary)
"X is the mother of Y": Mother(x, y)
4. More Natural Representation
FOL provides a more natural way to represent real-world knowledge and everyday reasoning patterns,
making it better suited for knowledge representation in AI systems.
5. Reusability through Variables
With variables, we can define general rules once and apply them to many specific instances, making
knowledge representation more compact and efficient.
These advantages make first-order logic a much more powerful tool for knowledge representation in
artificial intelligence, despite being more complex than propositional logic.