Mathematical Aspects of Natural and Formal Languages