2082 2

BIT252 · 2082 · 10 marks

How unification and lifting is done in predicate logic?Construct a knowledge base in first order predicate logic for following statements and convert them to CNF form: All students are smart people. All smart people are not intelligent. Someone is intelligent. Either all students are intelligent or

How unification and lifting is done in predicate logic?Construct a knowledge base in first order predicate logic for following statements and convert them to CNF form: All students are smart people. All smart people are not intelligent. Someone is intelligent. Either all students are intelligent or all students are hardworking.[4+6]

Artificial IntelligenceChapter 4: Knowledge RepresentationUnification and lifting in predicate logic

Quick answer

Unification is the process of finding a substitution (called a unifier) that makes two or more logical expressions identical.

Unification, Lifting in Predicate Logic & Knowledge Base Construction


Part 1: Unification and Lifting [4 Marks]

Unification

  • A substitution θ is a set of bindings of the form {x/term, y/term, ...}
  • The Most General Unifier (MGU) is the most general substitution that unifies two expressions

Unification Algorithm Steps:

  1. If both expressions are constants or the same variable, they unify (empty substitution)
  2. If one is a variable, substitute it with the other term (occurs check: variable must not appear in the term)
  3. If both are compound expressions, unify functor/predicate names and then unify arguments recursively
  4. If none of the above, unification fails

Example:

Expression 1Expression 2MGU
P(x, y)P(John, Mary){x/John, y/Mary}
Knows(John, x)Knows(John, Jane){x/Jane}
P(x, f(x))P(a, f(a)){x/a}
P(x, x)P(a, b)Fails (a ≠ b)

Lifting

Lifting refers to the process of generalizing inference rules from propositional logic to first-order predicate logic by incorporating unification.

The key idea: instead of applying rules to ground (fully instantiated) sentences only, we lift them to work with variables using unification.

Example - Lifted Modus Ponens (Generalized Modus Ponens):

If we have:

  • P(x) → Q(x) (for all x)
  • P(John)

Then by unification {x/John}, we derive: Q(John)

Lifted Resolution:

Standard resolution in propositional logic:

From (A ∨ B) and (¬B ∨ C), derive (A ∨ C)

Lifted resolution in FOL:

From (P(x) ∨ Q(x)) and (¬P(John) ∨ R(y)), unify P(x) with P(John) using {x/John}, derive (Q(John) ∨ R(y))

Benefits of Lifting:

  • Avoids instantiating all possible ground instances
  • Makes inference efficient and general
  • Enables working directly with universally quantified statements

Part 2: Knowledge Base in FOL and CNF Conversion [6 Marks]

Step 1: Represent Statements in FOL

Let:

  • S(x) = x is a student
  • Smart(x) = x is a smart person
  • I(x) = x is intelligent
  • H(x) = x is hardworking
StatementFOL Representation
1. All students are smart people∀x [S(x) → Smart(x)]
2. All smart people are not intelligent∀x [Smart(x) → ¬I(x)]
3. Someone is intelligent∃x [I(x)]
4. Either all students are intelligent or all students are hardworking[∀x (S(x) → I(x))] ∨ [∀x (S(x) → H(x))]

Step 2: Convert Each Statement to CNF

CNF Conversion Steps:

  1. Eliminate implications (A → B becomes ¬A ∨ B)
  2. Move negations inward (De Morgan's laws)
  3. Standardize variables apart
  4. Skolemize (eliminate existential quantifiers)
  5. Drop universal quantifiers
  6. Distribute ∨ over ∧

Statement 1: ∀x [S(x) → Smart(x)]

  • Eliminate implication: ∀x [¬S(x) ∨ Smart(x)]
  • Drop universal quantifier:

CNF: ¬S(x) ∨ Smart(x)


Statement 2: ∀x [Smart(x) → ¬I(x)]

  • Eliminate implication: ∀x [¬Smart(x) ∨ ¬I(x)]
  • Drop universal quantifier:

CNF: ¬Smart(x) ∨ ¬I(x)


Statement 3: ∃x [I(x)]

  • Skolemize: Replace ∃x with a Skolem constant c (since no universal quantifier wraps it)
  • Result: I(c)

CNF: I(c)


Statement 4: [∀x (S(x) → I(x))] ∨ [∀x (S(x) → H(x))]

This is the most complex. First, standardize variables apart:

[∀x (S(x) → I(x))] ∨ [∀y (S(y) → H(y))]

  • Eliminate implications:

[∀x (¬S(x) ∨ I(x))] ∨ [∀y (¬S(y) ∨ H(y))]

  • Move quantifiers outward (prenex normal form):

∀x ∀y [(¬S(x) ∨ I(x)) ∨ (¬S(y) ∨ H(y))]

  • Drop universal quantifiers:

(¬S(x) ∨ I(x) ∨ ¬S(y) ∨ H(y))

CNF: ¬S(x) ∨ I(x) ∨ ¬S(y) ∨ H(y)


Summary of CNF Clauses

#StatementCNF Clause
1All students are smart people¬S(x) ∨ Smart(x)
2All smart people are not intelligent¬Smart(x) ∨ ¬I(x)
3Somebody is intelligentI(c)
4Either all students are intelligent or all students are hardworking¬S(x) ∨ I(x) ∨ ¬S(y) ∨ H(y)

Conclusion

Unification finds the substitution that makes two literals identical, and lifting is what allows the propositional inference rules to be applied directly to quantified first order sentences by using that substitution. Once every sentence of the knowledge base has been reduced to the four clauses above, resolution can be applied mechanically to them, since every clause is now a disjunction of literals with all quantifiers removed.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.