rstm
The library is currently in the early stages of development and is still settling in on a feel for the api.
Welcome to rstm! This crate provides a simple and easy-to-use interface for creating and executing Turing machines. The crate is designed to be flexible and extensible, allowing developers to create and execute a wide range of Turing machines. Furthermore, the crate focuses on efficiency and leverages feature-gating to reduce overhead.
Getting Started
For a more detailed guide on getting started, please refer to the QUICKSTART.md file.
Adding rstm to your project
To add rstm to your Rust project, include it in your Cargo.toml file:
[]
= "0.0.x"
= [
"default",
]
Building from the source
Start by cloning the repository
Then, change into the directory:
Run an example
Usage
Rulesets
To faciliate the creation of rules for the machine, the crate provides a ruleset! macro. The macro mimics the
structure of the transition function $\delta$ defined by "On topological dynamics of Turing machines" by Petr Kůrka.
$$\delta : Q\times{A}\rarr{Q\times{A}\times{(0, \pm{1})}}$$
The syntax of the macro is as follows:
ruleset!
The macro expands into a Vec<Rule> where Rule is structure consisting of two other structures, namely: Head<Q, S> and the Tail<Q, S>. Each of these structures is a direct representation of the two sides of the transition function defined above
Rules
where Head and Tail are defined as follows:
Note: the macro is hygenic, meaning developers will not need to import the Direction enum nor its variants in order to use the macro.
Example usage
The following example demonstrates the use of the ruleset! macro to define a set of rules for a three-state, two-symbol Turing machine.
use ruleset;
// define the ruleset for the machine
let rules = ruleset!;
Examples
Executing a program using an Actor
extern crate rstm;
use ;
Contributing
Contributions are welcome! For more information visit the CONTRIBUTING.md file.