Changes to Turing Machines in 7.1


Contents

How Turing Machines are Read and Opened
Building Block Changes


How Turing Machines are Read and Opened

When a JFLAP Turing machine file is read in, if any “block” tags are found in the XML, the file is automatically transduced as a TuringMachineBuildingBlocks object. If any “tapes” tags are found, this means the file is a multi-tape Turing machine, and it is opened in a standard Turing machine window. If a file is a single-tape Turing machine but does not have any “block” tags, a prompt box pops up asking the user if they would like to open this Turing machine as a “Standard Turing Machine” or as a “Turing Machine With Building Blocks.” Selecting “Standard Turing Machine” will open the file in a “Turing Machine” window, which means it will have support for nondeterminism and conversion to an unrestricted grammar. Selecting “Turing Machine With Building Blocks” will open the file in a “Turing Machine With Building Blocks” window, which means it will have full building blocks support, but will not support nondeterminism nor conversion to an unrestricted grammar. Additionally, when the user uses the add building blocks button in the “Turing Machine With Building Blocks” window, if the file is a single-tape Turing machine, regardless of whether it has any “block” tags, the user is allowed to use it as a building block. If the file is not a single-tape Turing machine, an error box appears stating, “Only single-tape Turing machines can be used as building blocks!”

Put concisely: all old Turing machines that users created or that are on the JFLAP website can still be used as building blocks, and if they do not have any blocks in them already, they can also be used as standard Turing machines with support for nondeterminism and conversion to unrestricted grammar.



Building Block Changes

In a Turing machine with building blocks, when “Edit Block” is clicked on a state to turn it into a building block, a prompt box appears asking the user to give the new building block a name. The user is not allowed to make a nested building block that has the same name as a parent building block; previously, this was allowed and JFLAP would crash when trying to reopen a file that did this. Also, we strongly advise that users do not create building blocks with the same name. While this is allowed for building blocks on the same level and can be useful, we found that “Edit Block” becomes very inconsistent when they are multiple building blocks with the same name. Sometimes, a change to one block is reflected by all of the blocks with the same name; other times, none of the blocks reflect the change that was made, including the block the change was directly made to. Best practice is to create a building block in its own file and test it well before using it. If you need to edit that building block, make changes to the original file and re-import into the Turing machine that you want to use the building block in. Building “bottom up,” creating building blocks in their own files and then piecing them together, is usually the best way to build Turing machines with building blocks.