Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Turing Machine (C++ Implementation)

0.00/5 (No votes)
12 Nov 2002 1  
The C++-program simulates a Turing Machine (TM). TM is defined by input files: metafile, states file, alphabet file, transition file, input word(s) file(s).

Introduction

The C++-program simulates a Turing Machine (TM).
TM is defined by input files: metafile, states file, alphabet file, transition file, input word(s) file(s):

  1. Each row of metafile contains data related to some Turing machine (number of tapes, names of states file, alphabet file, transition file, input word(s) file(s)).
  2. States file contains a list of initial, halting and internal states.
  3. Alphabet contains a list of empty, input and internal symbols.
  4. Each row of transition contains some transition rule.
  5. Each row of input word(s) contains input word for some tape.

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 as a demo sample of Turing Machine.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here