On modelling the emergence of logical thinking