liveBook · Manning

Robinson's algorithm

As explained in Fabulous Adventures in Data Structures and Algorithms

Robinson's algorithm is a unification algorithm that solves equations between first-order terms by constructing substitutions or detecting failure.

Robinson’s algorithm unifies first-order terms by solving their equations. It gradually constructs a substitution that fills holes, or detects a contradiction proving that no solution exists. section 10.7

Its central checks are:

  • Build substitutions incrementally as equations between binary terms are resolved. section 10.7
  • Allow holes to alias other holes, preserving shared unknowns in the solution. section 10.7
  • Run an occurs check before substituting, rejecting a hole mapped to a term containing itself and preventing infinite recursion. section 10.7

Where it is used

Unification supports compiler type inference and related logical deductions. Combined with backtracking search, it can solve general first-order logic problems, as in Prolog. section 10.7

How Fabulous Adventures in Data Structures and Algorithms covers it

How deep it goes
Explains substitutions, aliasing, contradictions, and occurs checks, while noting poor worst-case performance without detailing implementation.
Examples
Illustrates applications through compiler type inference, logical deduction, and Prolog.
What you can do after
Apply unification to construct substitutions or recognize unsolvable term equations.
How it connects
Connects unification with type inference, backtracking search, first-order logic, Prolog, and anti-unification.

This explainer was generated by Manning's knowledge graph from the text of Fabulous Adventures in Data Structures and Algorithms. The section links point to the parts of the book it draws on.