Some logical aspects of grammatical structure