Check substitutions before applying a rule

A rule engine compares pairs of predicate expressions. A unifier is a substitution for variables that makes both expressions identical. For each independent case, enter yes if a unifier exists and no otherwise.


Uppercase XX and YY are variables; lowercase aa and bb are distinct constants. The symbols ff and gg are distinct unary function symbols, and PP is a binary predicate. Within a row, repeated occurrences of a variable refer to the same variable. Substitutions do not carry between rows.


Use ordinary syntactic unification over finite terms, including the occurs check. No additional equations identify different constants or function symbols.

CaseFirst expressionSecond expressionUnifiable
1P(X, f(a))P(g(b), Y)
2P(X, X)P(a, b)
3P(X, f(Y))P(f(Y), X)
4P(X, f(X))P(f(Y), Y)
5P(f(X), g(Y))P(g(a), g(b))

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Logical Reasoning Questions: