Date: 2025-11-13 Status: Resolved historical investigation
After fixing the main transposition offset defect (H5), 10 out of 12 tests passed. The 2 remaining failures were later resolved as incorrect test assertions; see transposition_phase2_summary.md.
test_transposition_empty_and_single_charassert!(!automaton.accepts("a", "b")); // Would need substitution
The implementation ACCEPTS "a" → "b" via substitution (distance 1), but the test expects REJECT.
From src/transducer/transition.rs (lazy automaton, lines 284-301):
next.push(Position::new(i + 1, 1)); // substitutionThe comment "Would need substitution" suggests the test author believed transposition mode should NOT allow substitution. However, both the lazy implementation and Mitankin's thesis indicate that transposition is an ADDITIONAL operation, not a REPLACEMENT for standard operations.
The test assertion is incorrect. The Transposition variant correctly accepts standard operations, so "a" → "b" with n=1 SHOULD accept via substitution.
Mitankin's thesis and the lazy automaton transition logic confirm that the transposition variant includes standard operations.
test_transposition_with_repeated_chars###Assertion
assert!(automaton.accepts("aabb", "baab")); // swap first two
The implementation REJECTS "aabb" → "baab", but test expects ACCEPT.
Word: "aabb" = positions [1='a', 2='a', 3='b', 4='b'] Input: "baab" = reading ['b', 'a', 'a', 'b']
Input[0]='b' at k=1:
- Position I+0#0 at word_pos=1 (word[1]='a')
- Bit vector for 'b': word[1]='a'(no), word[2]='a'(no)
- No transposition entry (would need match at j=1, but word[2]='a' != 'b')
Input[1]='a' at k=2:
- Positions from standard operations (deletion/substitution)
- No transposition completion
Final: Ends at word_pos=3, needs word_pos=4
The issue is that at input k=1, reading 'b':
Question: How does "aabb" → "baab" work with only adjacent transpositions?
Transforming "aabb" → "baab":
The test may also be incorrect. Converting "aabb" to "baab" requires NON-adjacent transposition, which is not supported by the ⟨2,2,1⟩ operation.
However, there's a possibility I'm misunderstanding how transposition works in the automaton. The trace for "aabb" vs "abab" showed transposition DOES work, so maybe there's a subtlety I'm missing.
Maybe the automaton can perform transposition "lazily" across multiple input characters? Let me re-examine "abab" case:
This spans 3 input characters, but what's the actual word transformation?
At Input[0], we're at word position 1 (word[1]='a', matches 'a') Entering transposing: we increment errors and stay at same word position At Input[2], we complete and jump to word position 1+2=3?
Wait - I need to trace this more carefully to understand the transposition semantics.
For Test 1: Check Mitankin's thesis definition of Transposition variant - does it include standard operations?
For Test 2:
Decision Matrix Resolution:
The lazy automaton comparison was completed, findings were documented, and the two incorrect assertions were corrected.
Can 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 |