The pragmatics of discourse planning