Skip to content

CallMeGary123/turing_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turing Machine Simulator

This program aims to simulate behaviors of a Turing machine using the formal definition.

Content

Features

Multi-track support

Although sometimes overlooked the formal definition of a Turing machine allows the usage of multiple tracks on a single tape. you can test this feature by loading demo 3.

CSV suppourt

In order to give the program more of a sandbox feeling and allow for quick edits I've added CSV suppout which allows you to define transition functions in a CSV and load it into the program. example.csv defines a machine to add two numbers represented by 1s and seperated with a 0; With one track, initial state = q0 and final state = q4 *Note: CSV file's headers must be lhs_state,input,rhs_state,replacement,direction.

Usage

Define in terminal

You define all of your Turing maching by juts typing it into the terminal. to do this run the program without any command line arguments. cargo run or <path_to_compiled_program> if you've compiled the program

Load from CSV

you can load a CSV by running cargo run -- -csv <path_to_your_file.csv> or <path_to_compiled_program_name> -csv <path_to_your_file.csv> if you've compiled the program.
*Note: CSV file's headers must be lhs_state,input,rhs_state,replacement,direction.

Demos

Run cargo run -- -demo <demo_number> or <path_to_compiled_program_name> -demo <demo_number> if you've compiled the program.
You can find a list of all exisiting demos by runuing the program with the -help argument.

Command-line arguments

Here's a list of program's command-line arguments.

Arg Description
-help Show the help menu.
-demo <demo_number> Load the specified demo.
-csv Load trantition functions from the CSV file

Issues

Please refer to issues tab to see a list of current identified issues or submit your own issues and imporvment ideas.

About

This is a Turing machine simulator written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages