Mathematical linguistics