Closed sebfisch closed 14 years ago
This may prevent the later use of parallelism because one probably needs to do a left-to-right walkthrough.
Implemented in simple version: 6c889ab753643d9813454dc490ea6c33eab18b82.
The implementation does not thread things through the tree and, hence, does not prevent later parallelisation. The evilRegExp
example runs an order of magnitude faster (half a second for n=1000). Correctness not yet tested for other examples.
implemented together with the generalisation to semirings.
Currently, the combination of the functions
next
andacivateFirst
leads to quadratic run-time for certain regular expressions. For example, ina******
activateFirst
is called on every sub-expression and traverses each anew. Also, if all symbols ina?a?a?a?a?
are activated, thenstep
is called recursively on every sub-expression and callsactivateFirst
each time on the right child.Write a single function that traverses an expression only once.