Skip to content

Stanard one-bidirectional-infinite-tape Turing Machine simulation

License

Notifications You must be signed in to change notification settings

Kahsolt/TuringMachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Stanard one-bidirectional-infinite-tape Turing Machine simulation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published