Probabilistic representation of formal languages