Text this: The logic of categorial grammars