Click here to Skip to main content
14,934,321 members
Articles / Programming Languages / C++
Article
Posted 11 Nov 2002

Stats

80.8K views
1 download
19 bookmarked

Turing Machine (C++ Implementation)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
12 Nov 2002CPOL
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)

    Share

    About the Author

    Alex Vinokur
    Web Developer
    Israel Israel
    No Biography provided

    Comments and Discussions

     
    QuestionSome of these links are dead Pin
    David_Spector9-Oct-18 8:43
    MemberDavid_Spector9-Oct-18 8:43 
    GeneralAhh Pin
    benjymous13-Nov-02 5:20
    Memberbenjymous13-Nov-02 5:20 
    GeneralRe: Ahh Pin
    Alex Vinokur13-Nov-02 6:26
    MemberAlex Vinokur13-Nov-02 6:26 
    GeneralRe: Ahh Pin
    benjymous13-Nov-02 6:29
    Memberbenjymous13-Nov-02 6:29 
    GeneralRe: Ahh Pin
    Ernesto Perales Soto18-Nov-02 10:56
    MemberErnesto Perales Soto18-Nov-02 10:56 
    GeneralRe: Ahh Pin
    Bilby18-Nov-02 21:59
    MemberBilby18-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.