Ai Unit 3 Part 2
Ai Unit 3 Part 2
Ai Unit 3 Part 2
Learning: First order logic. Inference in first order logic, propositional vs. first
order inference, unification & lifts forward chaining, Backward chaining,
Resolution,
Learning from observation Inductive learning, Decision trees, Explanation based
learning, Statistical Learning methods, Reinforcement Learning.
2. Forming Statements
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
The semantics of FOL define the meaning of statements in terms of models and
interpretations:
Inference is the process of deriving new statements from existing ones using rules
of logic. Common methods include:
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Example
Inference in first-order logic (FOL) refers to the process of deriving new logical
statements from existing ones using formal rules. It is a crucial component in
artificial intelligence for enabling automated reasoning systems to draw
conclusions from a given set of facts and rules. Here's a detailed explanation of
inference in FOL:
1. Basic Concepts
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
3. Unification
4. Resolution
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
1. Given Statements:
o ∀x (Human(x)→Mortal(x))\forall x \, (\text{Human}(x) \rightarrow
\text{Mortal}(x))∀x(Human(x)→Mortal(x))
o Human(Socrates)\text{Human}(\text{Socrates})Human(Socrates)
2. Convert to CNF:
o ¬Human(x)∨Mortal(x)\neg \text{Human}(x) \vee
\text{Mortal}(x)¬Human(x)∨Mortal(x)
o Human(Socrates)\text{Human}(\text{Socrates})Human(Socrates)
3. Negate the Goal:
o ¬Mortal(Socrates)\neg
\text{Mortal}(\text{Socrates})¬Mortal(Socrates)
4. Resolve:
o Resolving ¬Human(Socrates)∨Mortal(Socrates)\neg
\text{Human}(\text{Socrates}) \vee
\text{Mortal}(\text{Socrates})¬Human(Socrates)∨Mortal(Socrates
) with
Human(Socrates)\text{Human}(\text{Socrates})Human(Socrates)
yields
Mortal(Socrates)\text{Mortal}(\text{Socrates})Mortal(Socrates).
o Resolving
Mortal(Socrates)\text{Mortal}(\text{Socrates})Mortal(Socrates)
with ¬Mortal(Socrates)\neg
\text{Mortal}(\text{Socrates})¬Mortal(Socrates) yields a
contradiction.
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
6. Applications of Inference in AI
Propositional logic and first-order logic (FOL) are two fundamental systems in
artificial intelligence for representing and reasoning about knowledge. Both have
their own inference mechanisms. Here, we'll explore the differences between
propositional and first-order inference in AI:
Propositional Logic
Characteristics
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Inference
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Key Differences
1. Expressiveness:
o Propositional Logic: Limited to specific facts and cannot represent
relationships between objects or general statements about all or
some objects.
o First-Order Logic: More expressive, capable of representing
complex relationships, properties of objects, and general statements
using quantifiers and variables.
2. Inference Mechanisms:
o Propositional Logic: Inference is relatively straightforward with
fewer rules, mainly focusing on the manipulation of true/false
values.
o First-Order Logic: Inference is more complex due to the need to
handle variables, quantifiers, and the process of unification.
3. Use Cases:
o Propositional Logic: Suitable for simple domains with a finite
number of facts and rules. Often used in scenarios where the
complexity of the relationships between objects is low.
o First-Order Logic: Used in more complex domains where it is
necessary to express and reason about general properties and
relationships among objects. Commonly used in knowledge
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Summary
1. Unification
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Given:
Steps:
3. Backward Chaining
Backward chaining is a goal-driven inference method. It starts with the goal and
works backwards by finding rules that could satisfy the goal, and then proving
the premises of those rules.
Process:
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Given:
Steps:
4. Resolution
Given:
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Steps:
1. Convert to CNF:
o ¬Human(x)∨Mortal(x)\neg Human(x) \lor
Mortal(x)¬Human(x)∨Mortal(x)
o Human(Socrates)Human(Socrates)Human(Socrates)
o ¬Mortal(Socrates)\neg Mortal(Socrates)¬Mortal(Socrates)
2. Apply resolution:
o Resolve Human(Socrates)Human(Socrates)Human(Socrates) and
¬Human(x)∨Mortal(x)\neg Human(x) \lor
Mortal(x)¬Human(x)∨Mortal(x) by unifying xxx with
SocratesSocratesSocrates to get
Mortal(Socrates)Mortal(Socrates)Mortal(Socrates).
o Resolve Mortal(Socrates)Mortal(Socrates)Mortal(Socrates) and
¬Mortal(Socrates)\neg Mortal(Socrates)¬Mortal(Socrates) to get an
empty clause (contradiction).
Summary
Each of these methods plays a crucial role in AI for enabling automated reasoning
and knowledge representation.
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Key Concepts:
2. Inductive Learning
Inductive learning is a method of learning where general rules are inferred from
specific instances. The goal is to create a general model that can apply to new,
unseen instances.
Key Concepts:
• Training Data: A set of specific examples from which the model learns.
• Generalization: The ability of the model to apply learned rules to new
data.
• Hypothesis Space: The set of all possible models or rules that could
explain the data.
Example:
• Given data on the weather and whether or not people play tennis, the model
learns a rule like "If it's sunny, then people play tennis."
3. Decision Trees
Decision trees are a type of model used for both classification and regression
tasks. They represent decisions and their possible consequences in a tree-like
structure.
Key Concepts:
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
www.ourcreativeinfo.in
ARTIFICIAL INTELLIGENCE
Summary
Each of these methods has its unique strengths and applications, making them
suitable for different types of problems and data in artificial intelligence.
www.ourcreativeinfo.in