BioJulia / Automa.jl

A julia code generator for regular expressions
Other
188 stars 15 forks source link

Remove StableSet and StableDict #107

Closed jakobnissen closed 2 years ago

jakobnissen commented 2 years ago

These two data types were originally added to prevent nondeterminism when compiling regex. Instead, prevent nondetminism by relabeling the minimized machines.

Cherry-picked from the v1 PR

See issues #19, #106

codecov[bot] commented 2 years ago

Codecov Report

Merging #107 (ff0f66b) into master (69d16f5) will decrease coverage by 10.27%. The diff coverage is 73.77%.

@@             Coverage Diff             @@
##           master     #107       +/-   ##
===========================================
- Coverage   90.76%   80.49%   -10.28%     
===========================================
  Files          16       16               
  Lines        1808     1866       +58     
===========================================
- Hits         1641     1502      -139     
- Misses        167      364      +197     
Flag Coverage Δ
unittests 80.49% <73.77%> (-10.28%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Automa.jl 100.00% <ø> (ø)
src/edge.jl 58.97% <52.94%> (-41.03%) :arrow_down:
src/machine.jl 79.04% <100.00%> (+6.20%) :arrow_up:
src/traverser.jl 100.00% <100.00%> (ø)
src/sset.jl 0.00% <0.00%> (-100.00%) :arrow_down:
src/sdict.jl 0.00% <0.00%> (-95.53%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us.

CiaranOMara commented 2 years ago

Can we expect the dot files to be consistent, or do they need some form of mapping/ordering too?

jakobnissen commented 2 years ago

@CiaranOMara they are consistent for Machine's, but not for NFA's or DFA's. Is that a problem? Then I can consider making the latter deterministic, also.

CiaranOMara commented 2 years ago

Not sure if it's a problem. The nfa2dot and dfa2dot functions were using StableDict. So, those functions may be producing inconsistent dotfiles. Could it be as trivial as changing for s in keys(serials) in /src/dot.jl to for s in traverse(nfa.start) or traverse(dfa.start) to get the StableDict behaviour?