Cognitive prerequisites for the development of grammar