The pragmatic bases of children's reasoning