Introduction to mathematical linguistics