Bug was introduced in commit
5958a2366cdb1361b5158076924014a36ff19dcc
"Bind contexts (a.k.a. tags) to DFA transitions, not states.":
instead of comparing tags of single transition on one particular
symbol, we compared tags for all outgoing transitions at once
(probably copy-paste from Moore minimization).
The bug was revealed by multiple tests (including '--skeleton' ones)
as soon as I ran testsute with '--dfa-determinization table'.
{
std::swap(oi, oj);
}
- if (oi != oj &&
- (oi == dfa_t::NIL
- || oj == dfa_t::NIL
- || tbl[oi][oj]
- || memcmp(states[i]->tags, states[j]->tags, nchars * sizeof(size_t)) != 0))
+ if (states[i]->tags[k] != states[j]->tags[k]
+ || (oi != oj
+ && (oi == dfa_t::NIL
+ || oj == dfa_t::NIL
+ || tbl[oi][oj])))
{
tbl[i][j] = true;
loop = true;
if (memcmp(&out[j * nchars],
&out[k * nchars],
nchars * sizeof(size_t)) == 0
- && memcmp(states[j]->tags, states[k]->tags, nchars * sizeof(size_t)) == 0)
- {
+ && memcmp(states[j]->tags,
+ states[k]->tags,
+ nchars * sizeof(size_t)) == 0
+ ) {
part[j] = k;
next[j] = next[k];
next[k] = j;