/TuringMachine

Stanard one-bidirectional-infinite-tape Turing Machine simulation

Primary LanguageC++Do What The F*ck You Want To Public LicenseWTFPL

TuringMachine

Standard k-tape Turing Machine simulator
homework project of NJU course 'Preliminary Introduction to the Theory of Computation'

The problem description is here: TM-Problem.pdf

Detailed solution report is here: TM.md

Quickstart

  • have a look at config.h for customization, and /Makefile if you wanna modify executable filename, then do make
  • run demos, e.g. make test CASE=programs/palindrome, or rudely make test_all
  • create a directory for your case, containing:
    • a TM description filenamed test.tm (referring to syntax.tm and example programs)
    • your test inputs in one line filenamed input.txt
  • run make run CASE=<case-directory-path> to start your TM on given input, you should now see:
    • console logs
    • log file console.txt and results.txt generated under your case-directory

Example Programs

  • incr: increase a binary number by 1, minimal example for 1-tape TM syntax demo

  • add_3: add up two binary numbers, minimal example for multi-tape TM syntax demo

  • reverse: reverse a binary string

  • reverse_2: reverse, on 2-tape TM

  • palindrome: decide a palindrome binary string

  • palindrome_2: decide palindrome, on 2-tape TM

  • mult: decide a unary multiply equation string

  • fib_4: decide a unary string in fibonacci number length, on 4-tape TM

  • ww: decide a binary string in form of 'ww'


by Armit 2019/10/02 2019-11-26