margual56/TuringMachine

[Bug] - Final states

margual56 opened this issue · 2 comments

Problem

I prepared the template for a composition example.
However, while doing that, I realized that the simulator
needs the final state transitions. That is, we need to specify transitions such as:

(pf, 0, 0, H, pf)
(pf, 1, 1, H, pf)

Expected behavior

  • Actually when a TM stops (via action N or H), if that state is one of the listed final states,
    then you don't need to specify these transitions. That's why we define the final states.

  • On the other hand, if it halts at a non-final state, then we have the situation "undefined".

Correct example

You can check the transitions in slide 84-85, which should have the same transitions as Example1 of your package.

With: #define F={f}

Page 85 Example 1
(q0, 1, 0, R, q1) (q0, 1, 0, R, q1)
(q1, 1, 1, R, q1) (q1, 1, 1, R, q1)
(q1, 0, 0, R, q2) (q1, 0, 0, R, q2)
(q2, 1, 0, N/H, f) (q2, 1, 0, H, q2)
(q2, 0, 0, H, f)

The Turing Machine throws an error when it reaches the f state because it is "undefined".

Not fixed