From the Smart Factory to the thinking factory