___________           .__                
\__    ___/_ _________|__| ____    ____  
  |    | |  |  \_  __ \  |/    \  / ___\ 
  |    | |  |  /|  | \/  |   |  \/ /_/  >
  |____| |____/ |__|  |__|___|  /\___  / 
                              \//_____/  
   _____                .__    .__                      
  /     \ _____    ____ |  |__ |__| ____   ____   ______
 /  \ /  \\__  \ _/ ___\|  |  \|  |/    \_/ __ \ /  ___/
/    Y    \/ __ \\  \___|   Y  \  |   |  \  ___/ \___ \ 
\____|__  (____  /\___  >___|  /__|___|  /\___  >____  >
        \/     \/     \/     \/        \/     \/     \/ 
  _________.__              .__          __                
 /   _____/|__| _____  __ __|  | _____ _/  |_  ___________ 
 \_____  \ |  |/     \|  |  \  | \__  \\   __\/  _ \_  __ \
 /        \|  |  Y Y  \  |  /  |__/ __ \|  | (  <_> )  | \/
/_______  /|__|__|_|  /____/|____(____  /__|  \____/|__|   
        \/          \/                \/                   

Project name: Turing Machines Simulator

Licence: GNU GPL

Brief: The Turing Machines Simulator is an implementation of abstract programming interface called Turing Machine. Particularly, it's possible to proof mathematicaly that using of Turing Machine enables to create any algorithm.

Detailed description: The project was prepared for the Wroclaw University of Technology for the Mathematical Complexity of Algorithms course. The aim was to create a simple multiplatform simulator that everyone could use. The mathematical definition of the machine consists of the following parts: the finite set of language, the set of tapes (data streams), the set of machine's states. In application it's possible to define every ot those elements and additionaly:

The aplication was developed in simple manner. The diagram shows main classes of the source code 1.0 version:

diagram

The machine file structure:

#TURING MACHINES FILE#

#LANGUAGE#
//finite set of language characters
01_

#INITIAL STATE#
//name of initial state
a

#TAPE0#
//tape data stream, unlimited tapes numbers possible starting from 0
_____111_11_______

#CODE#
//states code format
//set of states = {r - right, l - left, s - stop}
(a, _) (a, _, r)
(a, 1) (q, 1, s)
(q, 1) (q, 1, r)
(q, _) (s, 1, l)
(s, 1) (s, 1, l)
(s, _) (r, _, r)
(r, 1) (r1, _, r)
(r1, 1) (r2, _, r)
(r2, 1) (h, 1, s)

This particular example adds two nambers of format n+1 and returns the result in format n+1. The header in first line is necessary in every machine. The CODE section consists from lines. First bracket defines actial state and the current data in headers position. Second brackets define state after step execution, data to write in headers and move of headers. Three moves are possible {r - right, l - left, s - stop}. It's also possible to define more than one tape using names "TAPE1, TAPE2...". If more then one tape defined you need to use additional bracket for data definition and for moves (see multitape example in files). The machine finishes execution when there is no next state or data found in definitions for current step.

Files:

tms_win32_bin.zip (Win32 Executable with examples)

tms_x86_bin.tar (Linux executable with examples)

tms_src.tar.gz (Full Source Code)

Notice: The example files are not the same for Windows and Linux due to different encoding new line characters. To convert from DOS to Linux format use dos2unix < dos.txt > linux.txt command in Linux console.

Contact:

Feel free to contact the author:

wizytowka

Links:

Wroclaw University of Technology

Dr. Robert Ralowski Webpage