#=====================================
# Turing Machine (C++ Implementation)
# --> [Version 1.0]
# Alex Vinokur
# http://up.to/alexvn
# alexvn@go.to, alexv@hitechclub.com
#-------------------------------------
# MINGW
# GNU gcc version 3.2.0
#-------------------------------------
# START
# Sat Nov 09 17:58:27 2002
#=====================================
---> YOUR COMMAND LINE : turing -h
USAGE : turing [ metafile-name : Default = metafile.txt ]
: turing [ -h|--help|? ]
EXAMPLES : turing
: turing abcd.txt
: turing -h
: turing --help
: turing ?
########## Metafile structure ##########
Each row contains data related to some Turing machine
----------------------------------------
Field#1 : number of tapes
Field#2 : states file name
Field#3 : alphabet file name
Field#4 : transitions file name
Field#5 : input words file#1 name
Field#6 : input words file#2 name [optional]
....... : .........
Field#n : input words file#(n-4) name [optional]
########################################
========== States file structure ==========
Row#1 : list of initial states
Row#2 : list of halting states
Row#3 : list of internal states
===========================================
========== Alphabet file structure ==========
Row#1 : list of empty symbols (empty symbols alphabet)
Row#2 : list of internal symbols
Row#3 : list of input symbols
=============================================
========== Transition file structure ==========
Each row contains some transition rule
Let n be number of tapes
-----------------------------------------------
Field# 0 : current state
Field# 1 : current symbol on tape#0
Field# 2 : current symbol on tape#1
Field# 3 : current symbol on tape#2
....................
Field# n+1 : next state
Field# n+2 : next symbol on tape#0
Field# n+3 : shift on tape#0
Field# n+4 : next symbol on tape#1
Field# n+5 : shift on tape#1
Field# n+6 : next symbol on tape#2
Field# n+7 : shift on tape#2
....................
===============================================
========== Input words file structure ==========
Each row contains input word for some tape
Let n be number of tapes
------------------------------------------------
Row# 0 : input word on tape#0
Row# 1 : input word on tape#1
Row# 2 : input word on tape#2
....................
Row# n-1 : input word on tape#(n-1)
================================================
########## Metafile sample ##########
2 states1.txt alphabet1.txt rules1.txt input11.txt input12.txt input13.txt
5 XXX YYY ZZZ SSS
#####################################
/// --- Sample of Turing Machine Definition : BEGIN --- \\\
A Turing Machine example (Recognition of Palindromes)
* from "The Design and Analysis of Computer Algorithms [1976]"
* by A.V.Aho, J.E.Hopcroft, J.D.Ullman
* --> See examples 1.8, 1.9
is used in samples below
========== States file sample ==========
q0
q5
q1 q2 q3 q4
========================================
========== Alphabet file sample ==========
b
x
0 1
==========================================
========== Transitions file sample ==========
------------ Number of tapes = 2 ------------
q0 0 b q1 0 N x R
q0 1 b q1 1 N x R
q0 b b q5 b N b N
q1 0 b q1 0 R 0 R
q1 1 b q1 1 R 1 R
q1 b b q2 b N b L
q2 b 0 q2 b N 0 L
q2 b 1 q2 b N 1 L
q2 b x q3 b L x R
q3 0 0 q4 0 N 0 R
q3 1 1 q4 1 N 1 R
q4 0 0 q3 0 L 0 N
q4 0 1 q3 0 L 1 N
q4 1 0 q3 1 L 0 N
q4 1 1 q3 1 L 1 N
q4 0 b q5 0 N b N
q4 1 b q5 1 N b N
=============================================
========== Input words file sample ==========
------------ Number of tapes = 2 ------------
0 1 0
b
=============================================
/// --- Sample of Turing Machine Definition : END --- \\\
#=====================================
# Turing Machine (C++ Implementation)
# --> [Version 1.0]
# Alex Vinokur
# http://up.to/alexvn
# alexvn@go.to, alexv@hitechclub.com
#-------------------------------------
# MINGW
# GNU gcc version 3.2.0
#-------------------------------------
# FINISH
# Sat Nov 09 17:58:27 2002
#=====================================