AI Unit 3 Notes
AI Unit 3 Notes
1. Universal generalization:
o Universal generalization is a valid inference rule which states that if
premise P(c) is true for any
o arbitrary element c in the universe of discourse, then we can have a
conclusion as ∀ x P(x).
o It can be represented as:
= P(c) / ∀ x P(x)
o This rule can be used if we want to show that every element has a similar
property.
2. Universal instantiation:
o The UI rule state that we can infer any sentence P(c) by substituting a
ground term c (a constant within domain x) from ∀ x p(x) for any object in
the universe of discourse.
o Universal instantiation is also called as universal elimination or UI is a
valid inference rule. It can be applied multiple times to add new
sentences.
o It can be represented as:
= ∀ x P(x) / P(c)
3. Existential instantiation:
o Existential instantiation is also called as Existential
o elimination, which is a valid inference rule in first order logic.
o This rule states that one can infer P(c) from the formula given in the form of ∃xP(x)
for a new constant symbol c.
o It can be represented as: =∃ x P(x) / P(c)
4. Existential instantiation:
o Existential instantiation is also called as Existential
o elimination, which is a valid inference rule in first order logic.
o This rule states that one can infer P(c) from the formula given in the form
of ∃xP(x) for a new constant symbol c.
o It can be represented as:
= ∃ x P(x) / P(c)
5. Existential introduction:
o This rule states that if there is some element c in the universe of
discourse which has a property P, then we can infer that there exists
something in the universe which has the property P.
o It can be represented as:
= P(c) / ∃ x P(x)
# Unification
o Unification is the process of finding substitutions for lifted inference rules,
which can make different logical expression to look similar (identical).
o Unification is a procedure for determining substitutions needed to make
two first order logic expressions match.
o Unification is important component of all first order logic inference
algorithms. The unification algorithm takes two sentences and returns a
unifier for them, if one exists.
# Forward Chaining and Backward Chaining
Forward Chaining
o Forward chaining is a method of reasoning when using inference
rules in AI.
o Forward chaining starts with the available data and uses inference
rules to extract more data (from an end user) until an optimal goal is
reached.
o An inference engine using forward chaining searches the inference
rules until it finds one where the If clause is known to be true.
o When found it can conclude, or infer, the Then clause, resulting in the
addition of new information to its dataset.
o For example, suppose that the goal is to conclude the colour of my pet
Bruno given that he croaks and eats flies, and that the rule base
contains the following two rules:
If X croaks and eats flies - Then X is a frog.
If X is a frog - Then X is red.
4. Resolve the clauses: Combine the two clauses and eliminate the
complementary literals. The result is a new clause that contains all the
literals of the original clauses.
5. Repeat: Continue applying resolution until a contradiction is found
(an empty clause), which indicates that the original set of clauses is
unsatisfiable.
Example:
Let's consider a simple example:
Given Clauses:
1. P(x) ∨ Q(x) (If P(x) is true, then Q(x) can also be true)
2. ¬P(a) (P(a) is false)
3. Q(a) (Q(a) is true)
Goal:
Prove that Q(a) holds true using resolution. Steps:
1. Convert the clauses into CNF:
o Clause 1: P(x) ∨ Q(x)
o Clause 2: ¬P(a)
o Clause 3: Q(a)