formal languages amp algorithms 9472