Git Product home page Git Product logo

turingmachines's Introduction

TuringMachines

0. Instruction

How to compile?

Basically, there is a Makefile in the src directory. Thus, all you need to do is go in to src directory, and type "make" to build the program.

How to run the program?

Once you type "make", you would get executable file "runtm". To run the executable file "runtm", you need to follow one of things on below.

1) ./runtm <description_file_path> <input_tape_file_path>

    With this command, you would be able to run deterministic turing machine with the given input tape.

2) ./runtm <description_file_path>

    With this command, you would be able to run deterministic turing machine with the blank tape.

3) ./runtm -n <description_file_path> [<input_tape_file_path>]

    With this command, you would be able to run non-deterministic turing machine with multiple tape files.

What is a description file?

A description file is a file that contains the line that describe the turing machine. Basically, the desciption file should contain the number of states, name of each state, accepted and rejected state, and all transitions.

The format of each line for transition should be something like this:

< state1 > < tapeinput > < state2 > < tapeoutput > < move >

1. What is a turing machine?

A Turing machine is a type of machine that is more powerful than a PDA: it can can recognise languages that are not context-free, and in addition to accepting and rejecting words it can also produce output. We shall see in the next chapter that Turing machines can do anything that a real computer can do. Slightly more formally, a Turing machine is like a deterministic finite state automaton, but with a tape that it can read and write and move about on. The tape has a left hand end, but is infinite in the other direction, and is divided up into squares called cells. The blank symbol _ indicates that nothing is written in that cell.

2. Differences with DFAs and PDAs

  1. Unlike a DFA, a Turing machine can write on the tape, instead of just reading input. Unlike a PDA, the Turing machine can write anywhere on the tape, once it has moved the read/write head to the desired cell. At each step the Turing machine must move one cell left or one cell right, unless the read/write head is at the left-most end, when a “move left” instruction results in staying put.

  2. There is a single accept state, qa, and a single reject state, qr. Basically, the machine stops as soon as one of these is entered.

turingmachines's People

Contributors

yeonwoosung avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.