Date: 2025-11-13 Status: Resolved historical investigation
For "ab" → "ba" with n=1:
Observed Behavior:
When completing transposition, I was using:
offset_new = offset_transposing + 3
This came from the calculation:
But wait! The transposing state has offset = i - (e+1), so:
This seemed correct, but it's producing word_pos = 4 instead of 2!
The issue is that offsets are relative to the input position when they're evaluated.
In the lazy automaton:
In the Universal automaton:
i = offset + kSo when we create a successor position I+offset'#e', we need to think about:
Entering transposition (at input k):
Completing transposition (at input k):
But I was using offset + 3! That's the defect.
Change transposition completion from:
offset + 3
To:
offset + 1
Input[0] (k=1): I+0#0 enters transposition
Input[1] (k=2): I+-1#1_t completes transposition
Final check (after k=2):
This should work!
Apply the fix to both I-type and M-type transposition completion:
offset + 3 to offset + 1offset + 3 to offset + 1Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |