cs-au-dk/dk.brics.automaton

string generation loops for patterns like "(.){0,2}"

miniHive opened this issue · 2 comments

Hi,

we love working with Brics, but we came across this issue:

Given the pattern (.){0,2}, Brics correctly produces the automaton a:

initial state: 2
state 0 [accept]:
  \u0000-\uffff -> 1
state 1 [accept]:
state 2 [accept]:
  \u0000-\uffff -> 0

However, calling SpecialOperations.getFiniteStrings(a) enters an infitite loop.

Thanks,
Stefanie

Are you sure? The language of the automaton in your example contains 4295032833 strings, so if you let the program run, it will probably result in an OutOfMemoryError at some point.

Thank you for clarifying. I had not realized that the solution space is so large.