compose_epsilon does a check for matching alphabets