This solves the problem by searching the graph of reachable states (and presumably doing cycle detection, at least in depth-first mode), which avoids the problem of picking an unsuitable sub-goal by considering all possible ones. While this is a perfectly good solution, it doesn't seem to throw much light on how human intelligence works. A person is likely to notice, for example, that extending any stack that does not have C on the bottom is not helpful, without mentally running through all possibilities, but just on the basis that it will have to be torn down at some point, to move the bottom block to where it belongs.