SLIDE 19 Unifjcation algorithm
Input: 𝑉 = {𝑢 ?
= = 𝑢
, … , 𝑢 ?
= = 𝑢
} a non-ground unifjcation problem
Initialise: 𝑆 = 𝑉 Execute non-deterministically the steps: Delete: 𝑆 ∪ {𝑢 ?
= = 𝑢} ⇒ 𝑆 if 𝑢 is ground
Switch: 𝑆 ∪ {𝑢 ?
= = 𝑦} ⇒ 𝑆 ∪ {𝑦 ? = = 𝑢} if 𝑦 is a variable, and 𝑢 is not
Decomposition:
𝑆 ∪ {𝑔(𝑢, … , 𝑢) ?
= = 𝑔(𝑢
, … , 𝑢 )} ⇒ 𝑆 ∪ {𝑢 ?
= = 𝑢
, … , 𝑢 ?
= = 𝑢
}
Confmict: 𝑆 ∪ {𝑔(𝑢, … , 𝑢) ?
= = (𝑢
, … , 𝑢 )} ⇒ ∅ if 𝑔 ≠
Eliminate: 𝑆 ∪ {𝑦 ?
= = 𝑢} ⇒ {𝑦 ? = = 𝑢} ∪ 𝑆{𝑦/𝑢} if 𝑦 is a variable that
- ccurs in 𝑆 but not in 𝑢, and 𝑢 is not a variable
Occurs check: 𝑆 ∪ {𝑦 ?
= = 𝑢} ⇒ ∅ if 𝑦 is a variable that occurs in 𝑢
and 𝑢 ≠ 𝑦 Coalesce: 𝑆 ∪ {𝑦 ?
= = 𝑧} ⇒ {𝑦 ? = = 𝑧} ∪ 𝑆{𝑦/𝑧} if 𝑦 and 𝑧 are variables
Output: if 𝑆 = ∅, then there are no solutions for problem 𝑉 if 𝑆 ≠ ∅, then 𝑆 is an mgu for 𝑉
19 / 26