Typology and logical structure of natural languages