VeriFIT / mata

A fast and simple automata library
MIT License
14 stars 11 forks source link

Method get_symbols() does not return all symbols #377

Closed adastepkova closed 4 months ago

adastepkova commented 4 months ago

I'm using the python binding of this library. The method get_symbols() in libmata.nfa.nfa returns (as it seems) only up to 64 symbols. If the alphabet contains more symbols, they are omitted. However, the method get_alphabet_symbols() in libmata.alphabets.OnTheFlyAlphabet seems to work fine.

Example of an offending automaton: https://github.com/VeriFIT/nfa-bench/blob/master/benchmarks/z3-noodler/automatark/intersection/instance06314-5.mata

Code generating this issue:

from libmata import parser, alphabets

alpha = alphabets.OnTheFlyAlphabet()
aut = parser.from_mata("/path/to/automaton.mata", alpha)

print(alpha.get_alphabet_symbols()) # returns symbols 0-77 for the automaton above
print(aut.get_symbols()) # returns symbols 0-63

I'm using version 1.2.0 of the python binding, installed through pip install. My OS is Ubuntu 22.04.3 LTS.

Adda0 commented 4 months ago

Hello. Thank you for reporting both issues #377 and #378 and providing the information to debug the issues. I will try to review the issues this week and come up with a fix.

Adda0 commented 4 months ago

The issue should be now fixed. Let me know if there are more problems for you. Thank you for reporting the issues.