I'm working on regular languages and automata with arbitrary numbers of symbols for their alphabet (maybe more than 26.) So I'm showing the alphabet symbols by $a1, a2, ..., an$. For example a regular expression is generated in GAP like this: $"@Ua3Ua3a1Ua1Ua3a2Ua2"$ where $@$ means epsilon and $U$ means union. When I write the code depicted below, the generated automaton assumes the alphabet includes $a$ and numbers $1$ to $n$. (In this case $n=3$).
After loading the Automata package with LoadPackage("automata");, we have:
gap> w := "@Ua3Ua3a1Ua1Ua3a2Ua2";;
gap> r := RationalExpression(w);;
gap> Display(RatExpToAut(r));
| 1 2 3 4 5 6
-----------------------
1 | 2 3 3 2 3 3
2 | 2 3 3 2 3 3
3 | 5 3 3 3 3 3
a | 3 3 3 3 4 1
Initial state: [ 6 ]
Accepting states: [ 2, 5, 6 ]
How can I specify the alphabet in order to make it understand that for example $a1$ is a single symbol? If it's not possible in GAP, I appreciate alternative solutions using other softwares or programming languages.
There is some issue either in the 'automata' package since RationalExpression does not behave as expected when considering large alphabets... Please consider putting an issue in https://github.com/gap-packages/automata
Independently of the way the issue will be fixed, it may be advisable to construct your regular expressions at a lower level, as in the following example