├── .gitignore ├── README.md ├── myTurningMachine ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── myTurningMachine.pro ├── pending.cpp ├── pending.h └── pending.ui └── rules ├── 0^n1^n.txt ├── aMODe.txt ├── binary.txt ├── log2.txt ├── m-n.txt └── wcw.txt /.gitignore: -------------------------------------------------------------------------------- 1 | build-myTurningMachine-Desktop_Qt_5_13_0_MinGW_64_bit-Release 2 | build-myTurningMachine-Desktop_Qt_5_13_0_MinGW_64_bit-Debug 3 | myTurningMachine/myTurningMachine.pro.user -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 计算理论图灵机 2 | 3 | # 如需要自取即可,记得点个star :D 4 | 5 | ![image](https://user-images.githubusercontent.com/38092591/147580218-276af2b4-9d7b-45f9-8b7d-513d8438885f.png) 6 | -------------------------------------------------------------------------------- /myTurningMachine/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /myTurningMachine/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "ui_pending.h" 4 | 5 | MainWindow::MainWindow(QWidget *parent) : 6 | QMainWindow(parent), pending(new Pending), 7 | ui(new Ui::MainWindow) 8 | { 9 | ui->setupUi(this); 10 | 11 | nowPoint = 1; 12 | 13 | ui->Table->horizontalHeader()->hide(); 14 | ui->Table->verticalHeader()->hide(); 15 | ui->Table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 16 | 17 | ui->Text_StartStatus->setReadOnly(true); 18 | ui->Text_EndStatus->setReadOnly(true); 19 | ui->Text_InputChars->setReadOnly(true); 20 | ui->Text_StatusSet->setReadOnly(true); 21 | ui->textEdit_3->setReadOnly(true); 22 | ui->textEdit_5->setReadOnly(true); 23 | ui->textEdit_7->setReadOnly(true); 24 | ui->textEdit_9->setReadOnly(true); 25 | ui->textEdit_10->setReadOnly(true); 26 | 27 | connect(ui->PB_InputRule, SIGNAL(clicked()), this, SLOT(Press_InputRules())); 28 | connect(ui->PB_Start, SIGNAL(clicked()), this, SLOT(Press_Start())); 29 | connect(ui->PB_OneStep, SIGNAL(clicked()), this, SLOT(Press_OneStep())); 30 | connect(ui->PB_AllStep, SIGNAL(clicked()), this, SLOT(Press_AllStep())); 31 | 32 | connect(ui->List_InputRules, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(Press_RulesList(QListWidgetItem*))); 33 | } 34 | 35 | void MainWindow::Press_InputRules() 36 | { 37 | QDir dir("../rules"); 38 | dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); 39 | QFileInfoList list = dir.entryInfoList(); 40 | 41 | qDebug() << list << endl; 42 | 43 | for (int i=0; iList_InputRules->addItem(filename); 47 | } 48 | } 49 | 50 | void MainWindow::Press_Start() 51 | { 52 | ui->Table->clear(); 53 | nowPoint = 1; 54 | nowStatus = startS; 55 | 56 | if (ui->Input_Chars->text().isEmpty()) return; 57 | qDebug() << ui->Input_Chars->text() << endl; 58 | 59 | ui->Table->setRowCount(2); 60 | ui->Table->setColumnCount(300); 61 | order = "B" + ui->Input_Chars->text() + "B"; 62 | for (int i=0; iText_thisRule->clear(); 93 | QString str='q'+QString::number(thisrules[i].SS)+','+thisrules[i].read+','+'q'+QString::number(thisrules[i].ES)+','+thisrules[i].Tread+','+thisrules[i].Go; 94 | ui->Text_thisRule->append(str); 95 | if (thisrules[i].Go == "R"){ 96 | if (nowPoint+1 == order.size()) order.append('B'); 97 | nowPoint++; 98 | } 99 | else if (thisrules[i].Go == "L"){ 100 | if (nowPoint+1 == order.size()) order.append('B'); 101 | nowPoint--; 102 | } 103 | if (nowPoint - 12 > 0) ui->Table->horizontalScrollBar()->setSliderPosition(nowPoint-12); 104 | flag = true; 105 | break; 106 | } 107 | } 108 | if (!flag){ 109 | QMessageBox::information(nullptr,"ERROR","输入纸带有误",QMessageBox::Ok); 110 | return -1; 111 | } 112 | } 113 | else{ 114 | QMessageBox::information(nullptr,"YES!!!!","成功转换!!!!",QMessageBox::Ok); 115 | return 1; 116 | } 117 | setTable(); 118 | return 0; 119 | } 120 | 121 | void MainWindow::Press_AllStep() 122 | { 123 | if (order.size() < 1) return; 124 | int flag; 125 | pending->show(); 126 | while (1){ 127 | flag = Press_OneStep(); 128 | if (flag == -1 || flag == 1){ 129 | break; 130 | } 131 | } 132 | pending->hide(); 133 | } 134 | 135 | void MainWindow::Press_RulesList(QListWidgetItem* item) 136 | { 137 | qDebug() << item->text() << endl; 138 | 139 | readlist.clear(); 140 | 141 | QFile file("../rules/" + item->text() + ".txt"); 142 | if (file.exists()) qDebug() << "file exists" << endl; 143 | else qDebug() << "file not exists" << endl; 144 | 145 | if (file.open(QIODevice::ReadOnly)) qDebug() << "file open" << endl; 146 | else{ 147 | qDebug() << "file open fail" << endl; 148 | return; 149 | } 150 | 151 | QTextStream txt(&file); 152 | QString line=txt.readLine(); 153 | QStringList strlist=line.split(","); 154 | ruleName = strlist[0]; 155 | rulesNum = strlist[1].toInt(); 156 | qDebug() << ruleName << rulesNum << endl; 157 | 158 | ui->Text_EndStatus->clear(); 159 | ui->Text_StatusSet->clear(); 160 | ui->Text_InputChars->clear(); 161 | ui->Text_StartStatus->clear(); 162 | 163 | line=txt.readLine(); 164 | ui->Text_StatusSet->append(line); 165 | 166 | line=txt.readLine(); 167 | strlist=line.split(","); 168 | for (int i=0; iText_InputChars->append(line); 173 | 174 | line=txt.readLine(); 175 | ui->Text_StartStatus->append("q" + line); 176 | startS = line.toInt(); 177 | nowStatus = line.toInt(); 178 | 179 | line=txt.readLine(); 180 | ui->Text_EndStatus->append("q" + line); 181 | endS = line.toInt(); 182 | 183 | thisrules = new Node[rulesNum]; 184 | 185 | ui->List_NowRules->clear(); 186 | for (int i=0; iList_NowRules->addItem(str); 196 | } 197 | 198 | file.close(); 199 | 200 | QFile ruleinfo("../rules/rulesInfo.txt"); 201 | if (ruleinfo.exists()) qDebug() << "file exists" << endl; 202 | else qDebug() << "file not exists" << endl; 203 | 204 | if (ruleinfo.open(QIODevice::ReadOnly)) qDebug() << "file open" << endl; 205 | else{ 206 | qDebug() << "file open fail" << endl; 207 | return; 208 | } 209 | } 210 | 211 | void MainWindow::setTable() 212 | { 213 | ui->Table->clear(); 214 | for (int i=0; iTable->setItem(0, i, new QTableWidgetItem(QString(order[i]))); 216 | ui->Table->setItem(1, i, new QTableWidgetItem(QString(" "))); 217 | ui->Table->item(0, i)->setBackgroundColor(Qt::green); 218 | } 219 | ui->Table->setItem(1, nowPoint, new QTableWidgetItem("q" + QString::number(nowStatus))); 220 | ui->Table->item(1, nowPoint)->setBackgroundColor(Qt::green); 221 | } 222 | 223 | MainWindow::~MainWindow() 224 | { 225 | delete ui; 226 | } 227 | -------------------------------------------------------------------------------- /myTurningMachine/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace Ui { 18 | class MainWindow; 19 | } 20 | 21 | typedef struct Node{ 22 | int SS; //开始状态 23 | QString read; //读取字符 24 | int ES; //状态转移 25 | QString Tread; //读头符号变化 26 | QString Go; //读头变化(方向) 27 | }* Rule, Node; 28 | 29 | class MainWindow : public QMainWindow 30 | { 31 | Q_OBJECT 32 | 33 | public slots: 34 | void Press_InputRules(); 35 | void Press_Start(); 36 | int Press_OneStep(); 37 | void Press_AllStep(); 38 | 39 | void Press_RulesList(QListWidgetItem*); 40 | 41 | public: 42 | explicit MainWindow(QWidget *parent = nullptr); 43 | 44 | void setTable(); 45 | ~MainWindow(); 46 | 47 | private: 48 | Ui::MainWindow *ui; 49 | 50 | Pending *pending; 51 | 52 | Rule thisrules; 53 | QString ruleName; 54 | QStringList readlist; 55 | QString order; 56 | int startS; 57 | int endS; 58 | int rulesNum; 59 | int nowPoint; 60 | int nowStatus; 61 | }; 62 | 63 | #endif // MAINWINDOW_H 64 | -------------------------------------------------------------------------------- /myTurningMachine/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1440 10 | 900 11 | 12 | 13 | 14 | 15 | 微软雅黑 16 | 12 17 | 18 | 19 | 20 | MainWindow 21 | 22 | 23 | 24 | 25 | 26 | 50 27 | 40 28 | 200 29 | 80 30 | 31 | 32 | 33 | 录入规则 34 | 35 | 36 | 37 | 38 | 39 | 50 40 | 150 41 | 201 42 | 511 43 | 44 | 45 | 46 | 47 | 48 | 49 | 300 50 | 150 51 | 241 52 | 51 53 | 54 | 55 | 56 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 57 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 58 | p, li { white-space: pre-wrap; } 59 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 60 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">状态集合:</p></body></html> 61 | 62 | 63 | 64 | 65 | 66 | 570 67 | 150 68 | 571 69 | 51 70 | 71 | 72 | 73 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 74 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 75 | p, li { white-space: pre-wrap; } 76 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 77 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 78 | 79 | 80 | 81 | 82 | 83 | 300 84 | 230 85 | 241 86 | 51 87 | 88 | 89 | 90 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 91 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 92 | p, li { white-space: pre-wrap; } 93 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 94 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">输入字符集合:</p></body></html> 95 | 96 | 97 | 98 | 99 | 100 | 570 101 | 230 102 | 571 103 | 51 104 | 105 | 106 | 107 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 108 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 109 | p, li { white-space: pre-wrap; } 110 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 111 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 112 | 113 | 114 | 115 | 116 | 117 | 300 118 | 310 119 | 241 120 | 51 121 | 122 | 123 | 124 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 125 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 126 | p, li { white-space: pre-wrap; } 127 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 128 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">初始状态:</p></body></html> 129 | 130 | 131 | 132 | 133 | 134 | 570 135 | 310 136 | 571 137 | 51 138 | 139 | 140 | 141 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 142 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 143 | p, li { white-space: pre-wrap; } 144 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 145 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 146 | 147 | 148 | 149 | 150 | 151 | 300 152 | 390 153 | 241 154 | 51 155 | 156 | 157 | 158 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 159 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 160 | p, li { white-space: pre-wrap; } 161 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 162 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">终止状态:</p></body></html> 163 | 164 | 165 | 166 | 167 | 168 | 570 169 | 390 170 | 571 171 | 51 172 | 173 | 174 | 175 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 176 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 177 | p, li { white-space: pre-wrap; } 178 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 179 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 180 | 181 | 182 | 183 | 184 | 185 | 1190 186 | 190 187 | 201 188 | 331 189 | 190 | 191 | 192 | 193 | 194 | 195 | 1190 196 | 140 197 | 201 198 | 51 199 | 200 | 201 | 202 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 203 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 204 | p, li { white-space: pre-wrap; } 205 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 206 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">规则列表</p></body></html> 207 | 208 | 209 | 210 | 211 | 212 | 570 213 | 470 214 | 571 215 | 51 216 | 217 | 218 | 219 | 220 | 221 | 222 | 300 223 | 470 224 | 241 225 | 51 226 | 227 | 228 | 229 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 230 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 231 | p, li { white-space: pre-wrap; } 232 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 233 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">输入纸带:</p></body></html> 234 | 235 | 236 | 237 | 238 | 239 | 300 240 | 540 241 | 200 242 | 80 243 | 244 | 245 | 246 | 开始运行 247 | 248 | 249 | 250 | 251 | 252 | 530 253 | 540 254 | 200 255 | 80 256 | 257 | 258 | 259 | 单步运行 260 | 261 | 262 | 263 | 264 | 265 | 760 266 | 540 267 | 200 268 | 80 269 | 270 | 271 | 272 | 一键运行 273 | 274 | 275 | 276 | 277 | 278 | 50 279 | 700 280 | 1341 281 | 150 282 | 283 | 284 | 285 | 286 | 287 | 288 | 970 289 | 560 290 | 191 291 | 51 292 | 293 | 294 | 295 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 296 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 297 | p, li { white-space: pre-wrap; } 298 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 299 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">当前规则:</p></body></html> 300 | 301 | 302 | 303 | 304 | 305 | 1180 306 | 560 307 | 241 308 | 51 309 | 310 | 311 | 312 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 313 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 314 | p, li { white-space: pre-wrap; } 315 | </style></head><body style=" font-family:'微软雅黑'; font-size:12pt; font-weight:400; font-style:normal;"> 316 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 317 | 318 | 319 | PB_InputRule 320 | List_InputRules 321 | textEdit 322 | Text_StatusSet 323 | textEdit_3 324 | Text_InputChars 325 | textEdit_5 326 | Text_StartStatus 327 | textEdit_7 328 | Text_EndStatus 329 | List_NowRules 330 | textEdit_9 331 | Input_Chars 332 | textEdit_10 333 | PB_Start 334 | PB_OneStep 335 | Table 336 | textEdit_11 337 | PB_AllStep 338 | Text_thisRule 339 | 340 | 341 | 342 | 343 | 344 | 345 | -------------------------------------------------------------------------------- /myTurningMachine/myTurningMachine.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2021-12-14T12:55:09 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = myTurningMachine 12 | TEMPLATE = app 13 | 14 | # The following define makes your compiler emit warnings if you use 15 | # any feature of Qt which has been marked as deprecated (the exact warnings 16 | # depend on your compiler). Please consult the documentation of the 17 | # deprecated API in order to know how to port your code away from it. 18 | DEFINES += QT_DEPRECATED_WARNINGS 19 | 20 | # You can also make your code fail to compile if you use deprecated APIs. 21 | # In order to do so, uncomment the following line. 22 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 23 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 24 | 25 | CONFIG += c++11 26 | 27 | SOURCES += \ 28 | main.cpp \ 29 | mainwindow.cpp \ 30 | pending.cpp 31 | 32 | HEADERS += \ 33 | mainwindow.h \ 34 | pending.h 35 | 36 | FORMS += \ 37 | mainwindow.ui \ 38 | pending.ui 39 | 40 | # Default rules for deployment. 41 | qnx: target.path = /tmp/$${TARGET}/bin 42 | else: unix:!android: target.path = /opt/$${TARGET}/bin 43 | !isEmpty(target.path): INSTALLS += target 44 | -------------------------------------------------------------------------------- /myTurningMachine/pending.cpp: -------------------------------------------------------------------------------- 1 | #include "pending.h" 2 | #include "ui_pending.h" 3 | 4 | Pending::Pending(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::Pending) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | Pending::~Pending() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /myTurningMachine/pending.h: -------------------------------------------------------------------------------- 1 | #ifndef PENDING_H 2 | #define PENDING_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Pending; 8 | } 9 | 10 | class Pending : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Pending(QWidget *parent = nullptr); 16 | ~Pending(); 17 | 18 | private: 19 | Ui::Pending *ui; 20 | }; 21 | 22 | #endif // PENDING_H 23 | -------------------------------------------------------------------------------- /myTurningMachine/pending.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pending 4 | 5 | 6 | 7 | 0 8 | 0 9 | 450 10 | 46 11 | 12 | 13 | 14 | 正在运行... 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /rules/0^n1^n.txt: -------------------------------------------------------------------------------- 1 | 0^n1^n, 13 2 | q0,q1,q2,q3,q4,q5 3 | 0,1 4 | 0 5 | 5 6 | 0 ,0 ,1 ,X ,R 7 | 0 ,Y ,3 ,Y ,R 8 | 1 ,0 ,1 ,0 ,R 9 | 1 ,1 ,2 ,Y ,L 10 | 1 ,Y ,1 ,Y ,R 11 | 2 ,0 ,2 ,0 ,L 12 | 2 ,X ,0 ,X ,R 13 | 2 ,Y ,2 ,Y ,L 14 | 3 ,Y ,3 ,Y ,R 15 | 3 ,B ,4 ,B ,L 16 | 4 ,X ,4 ,0 ,L 17 | 4 ,Y ,4 ,1 ,L 18 | 4 ,B ,5 ,B ,R -------------------------------------------------------------------------------- /rules/aMODe.txt: -------------------------------------------------------------------------------- 1 | aMODe, 17 2 | q0,q1,q2,q3,q4,q5,q6 3 | a,0,e 4 | 0 5 | 6 6 | 0,a,1,A,R 7 | 0,0,6,0,S 8 | 1,a,1,a,R 9 | 1,0,2,0,R 10 | 2,e,3,E,R 11 | 2,E,2,E,R 12 | 3,e,4,e,L 13 | 3,B,5,B,L 14 | 4,0,4,0,L 15 | 4,a,4,a,L 16 | 4,e,4,e,L 17 | 4,E,4,E,L 18 | 4,A,0,A,R 19 | 5,E,5,e,L 20 | 5,0,5,0,L 21 | 5,a,5,a,L 22 | 5,A,0,A,R 23 | -------------------------------------------------------------------------------- /rules/binary.txt: -------------------------------------------------------------------------------- 1 | binary,30 2 | q0,q1,q2,q3,q4,q5,q6,q7,q8 3 | a 4 | 0 5 | 8 6 | 0,c,0,c,R 7 | 0,a,1,c,R 8 | 0,0,6,0,L 9 | 0,1,6,1,L 10 | 1,c,1,c,R 11 | 1,a,2,a,R 12 | 1,0,3,0,S 13 | 1,1,3,1,S 14 | 1,B,3,B,S 15 | 2,c,2,c,R 16 | 2,a,1,c,R 17 | 2,0,4,0,S 18 | 2,1,4,1,S 19 | 2,B,4,B,S 20 | 3,1,3,1,R 21 | 3,0,4,1,R 22 | 3,B,5,1,L 23 | 4,0,4,0,R 24 | 4,1,3,0,R 25 | 4,B,5,0,L 26 | 5,a,5,a,L 27 | 5,c,5,c,L 28 | 5,0,5,0,L 29 | 5,1,5,1,L 30 | 5,B,0,B,R 31 | 6,c,6,c,L 32 | 6,B,7,B,R 33 | 7,c,7,B,R 34 | 7,0,8,0,S 35 | 7,1,8,1,S -------------------------------------------------------------------------------- /rules/log2.txt: -------------------------------------------------------------------------------- 1 | log2,17 2 | q0,q1,q2,q3,q4,q5 3 | a 4 | 0 5 | 5 6 | 0,c,0,c,R 7 | 0,a,1,c,R 8 | 0,b,4,B,L 9 | 1,b,1,b,R 10 | 1,c,1,c,R 11 | 1,a,2,a,R 12 | 1,B,3,b,L 13 | 2,b,2,b,R 14 | 2,c,2,c,R 15 | 2,a,1,c,R 16 | 2,B,3,b,L 17 | 3,a,3,a,L 18 | 3,b,3,b,L 19 | 3,c,3,c,L 20 | 3,B,0,B,R 21 | 4,c,4,B,L 22 | 4,B,5,B,R -------------------------------------------------------------------------------- /rules/m-n.txt: -------------------------------------------------------------------------------- 1 | m-n,16 2 | q0,q1,q2,q3,q4,q5,q6 3 | 0,1 4 | 0 5 | 6 6 | 0,0,1,B,R 7 | 0,1,5,B,R 8 | 1,0,1,0,R 9 | 1,1,2,1,R 10 | 2,1,2,1,R 11 | 2,0,4,1,L 12 | 2,B,3,B,L 13 | 3,0,3,0,L 14 | 3,1,3,B,L 15 | 3,B,6,0,S 16 | 4,0,4,0,L 17 | 4,1,4,1,L 18 | 4,B,0,B,R 19 | 5,0,5,B,R 20 | 5,1,5,B,R 21 | 5,B,6,B,S -------------------------------------------------------------------------------- /rules/wcw.txt: -------------------------------------------------------------------------------- 1 | wcw, 33 2 | q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10 3 | a,b,c 4 | 0 5 | 10 6 | 0,a,1,X,R 7 | 0,b,3,Y,R 8 | 1,a,1,a,R 9 | 1,b,1,b,R 10 | 1,c,2,c,R 11 | 2,X,2,X,R 12 | 2,Y,2,Y,R 13 | 2,a,5,X,L 14 | 3,a,3,a,R 15 | 3,b,3,b,R 16 | 3,c,4,c,R 17 | 4,X,4,X,R 18 | 4,Y,4,Y,R 19 | 4,b,5,Y,L 20 | 5,X,5,X,L 21 | 5,Y,5,Y,L 22 | 5,c,6,c,L 23 | 6,a,7,a,L 24 | 6,b,7,b,L 25 | 6,X,8,X,R 26 | 6,Y,8,Y,R 27 | 7,a,7,a,L 28 | 7,b,7,b,L 29 | 7,X,0,X,R 30 | 7,Y,0,Y,R 31 | 8,X,8,X,R 32 | 8,Y,8,Y,R 33 | 8,c,8,c,R 34 | 8,B,9,B,L 35 | 9,c,9,c,L 36 | 9,X,9,a,L 37 | 9,Y,9,b,L 38 | 9,B,10,B,R --------------------------------------------------------------------------------