Decomposition patterns in problem solving