VeriFIT / mata

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

Fix low level functions #380

Closed Adda0 closed 4 months ago

Adda0 commented 4 months ago

This PR fixes some low-level functions which produced bugs, discovered in Python binding in #377 and #378.

I had to revert to get_used_states() using the slightly slower implementation with normal vector, as using bit vector will fail when using epsilons: it will try to allocate space for epsilon number of symbols. Optimizing the get_used_states() will need to be resolved again later.

This PR therefore fixes #377, and fixes #378.

codecov[bot] commented 4 months ago

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (3707ce7) 72.20% compared to head (ec7f8d5) 72.14%. Report is 10 commits behind head on devel.

Files Patch % Lines
src/nfa/delta.cc 33.33% 6 Missing :warning:
include/mata/utils/ord-vector.hh 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## devel #380 +/- ## ========================================== - Coverage 72.20% 72.14% -0.06% ========================================== Files 30 30 Lines 3709 3712 +3 Branches 846 847 +1 ========================================== Hits 2678 2678 - Misses 735 738 +3 Partials 296 296 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Adda0 commented 4 months ago

It should probably be easy to add some check that if there is no large symbol, we can use bool vectors.

I made a note which I will convert into an issue later.