Click here to Skip to main content
15,881,027 members
Articles / Programming Languages / C++

Turing Machine (C++ Implementation)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
12 Nov 2002CPOL 86K   19   6
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


    Written By
    Web Developer
    Israel Israel
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

    Comments and Discussions

     
    QuestionSome of these links are dead Pin
    David_Spector9-Oct-18 8:43
    David_Spector9-Oct-18 8:43 
    GeneralAhh Pin
    benjymous13-Nov-02 5:20
    benjymous13-Nov-02 5:20 
    GeneralRe: Ahh Pin
    Alex Vinokur13-Nov-02 6:26
    Alex Vinokur13-Nov-02 6:26 
    GeneralRe: Ahh Pin
    benjymous13-Nov-02 6:29
    benjymous13-Nov-02 6:29 
    GeneralRe: Ahh Pin
    Ernesto Perales Soto18-Nov-02 10:56
    Ernesto Perales Soto18-Nov-02 10:56 
    GeneralRe: Ahh Pin
    Bilby18-Nov-02 21:59
    Bilby18-Nov-02 21:59 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.