diff --git a/tm/lin_rec.py b/tm/lin_rec.py index 91428502..391d7a5c 100644 --- a/tm/lin_rec.py +++ b/tm/lin_rec.py @@ -56,6 +56,7 @@ def copy(self) -> HeadTape: def to_ptr(self) -> PtrTape: return PtrTape( sum(int(q.count) for q in self.lspan) - self.head, + self.scan, self.unroll(), ) @@ -81,6 +82,7 @@ def step(self, shift: Shift, color: Color, skip: bool) -> int: @dataclass class PtrTape: init: int + scan: Color tape: list[Color] def get_ltr(self, start: int) -> TapeSlice: @@ -354,6 +356,9 @@ def run(self, sim_lim: int) -> Self: # no-cover if state != init_state: continue + if tape.scan != init_tape.scan: + continue + ptr = tape.to_ptr() if 0 < (diff := tape.head - init_pos):