The evolution of mental models