I was reading Artificial Intelligence: Structures and Strategies for Complex Problem Solving by Luger, and composing substitution sets came up. It said this on page 67: "If S and S′ are two substitution sets, then the composition of S and S′ (written SS′) is obtained by applying S′ to the elements of S and adding the result to S"
So, I tried this out on an sample question: Compose the substitution sets {a/X, Y/Z} and {X/W, b/Y}
My attempt went something like this:
S = {a/X, Y/Z}
S' = {X/W, b/Y}
Applying S' to S gives me: {a/W, Y/Z} and then, adding this result to S gives: SS': {a/X, a/W, Y/Z}
However, the solution to this question is supposed to be: {b/Z , a/W , b/Y}
I don't know how this answer is obtained, so I'm unsure if the solution is incorrect or if there's something more complex I'm missing. The other substitution set, S'S, using the method from the book, gave me the result: {X/W, b/Z, b/Y}. However, the solution for this is meant to be {a/W , b/Y, a/X , Y/Z}. I'm not sure why there are four terms here. What's going on?