d-Separation: From Theorems to Algorithms