Each state of a sequence detector stands for a prefix of the pattern: how much has been matched so far. Progress arrows are easy. The hard part is where to go when a bit breaks the pattern.
The suffix rule answers it:
- Take the prefix for the present state and append the new bit.
- Look at the endings (suffixes) of that string, longest first.
- The first one that is also a beginning of the pattern is the next state. If none is, go to "nothing".
Why it works: the only part of the history that can still become a match is an ending that already looks like the start of the pattern. Keeping the longest such ending makes sure you never throw away progress you still have.
The same rule decides the arrow after a complete match in overlapping detection. Most design mistakes in detectors are arrows that reset too far, and checking each arrow with this rule catches them.