A program to simulate computational models execution. In particular, the supported models are:
- Turing machine (singletape, multitape, deterministic, non-deterministic)
- Finite states automata (deterministic, non-deterministic, epsilon)
- Pushdown automata (deterministic, non-deterministic, epsilon)
- RAM machine
- lambda calculus
The input files are in text format. Each line that starts with // is a comment and is ignored. The first line of the file is the name of the model:
tm
for Turing Machinefsm
for Finite States Automatapda
for Pushdown Automataram
for RAM Machinelambda
for lambda calculustm_e
for Turing Machine encodingram_e
for RAM Machine encoding
Then there are parameters specific for each model, on each line. More details on the parameters and what they mean can be found in the documentation.
// This is a comment
tm
// initial state
q0
// accept state
q1
// reject state
q2
// halt state
q3
// blank symbol
_
// states
q0 q1 q2 q3
// input symbols
a b c
// tape symbols
a b c _
// transitions
q0 a q1 b R
q1 b q2 c L
q2 c q3 a R
q3 _ q1 _ R
To run the program, you need to have cargo installed. More infromation on rust, cargo and how to install them can be found here.
First, clone the repository:
git clone https://github.com/dpunv/computing_simulator.git
cd computing_simulator
Then, build the project:
cargo build --release
This will create an executable file in the target/release
directory.
To run the program, you need to pass the input file, the input string and other optional parameters. To check the parameters, and how to use the program, run:
./target/release/computing_simulator --help
To build the documentation, run:
cargo doc --open
This project is licensed under the MIT License - see the LICENSE file for details.
If you want to contribute to the project, feel free to open an issue or a pull request. Any help is welcome.
- dp