简体   繁体   English

构建图灵机图

[英]Building Turing machine graph

I have been trying making a Turing machine graph recognizing the language:我一直在尝试制作识别语言的图灵机图:

{(ab)^n(ba)^n | n >0}

How to build the Turing machine graph for the above-mentioned language?如何为上述语言构建图灵机图?

  1. find the substring bb by identifying two consecutive instances of b通过识别 b 的两个连续实例找到 substring bb
  2. cross these off by replacing with a tape symbol X通过用磁带符号 X 替换这些来划掉这些
  3. bounce across the section of instances of X, crossing off matching symbols in alternating fashion (first cross off matching instances of a, then b, then a, etc.)在 X 的实例部分反弹,以交替的方式划掉匹配的符号(首先划掉 a 的匹配实例,然后是 b,然后是 a 等)
  4. halt-accept if the tape is empty after crossing off matching instances of a如果在划掉 a 的匹配实例后磁带为空,则停止接受
  5. halt-reject if you run out of symbols early or if the tape is empty after crossing out instances of b如果您提前用完符号或在删除 b 的实例后磁带为空,则停止拒绝

I'll leave defining states as an exercise but if you need help with that I can revisit this answer later.我将定义状态作为练习,但如果您需要帮助,我可以稍后重新访问此答案。 As a hint - you will need either one or a couple of states to handle each of the above steps.作为提示 - 您将需要一个或几个状态来处理上述每个步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM