pub trait TuringStates<Alphabet: Clone>: Sized + PartialEq {
// Required method
fn step(&self, current_token: Alphabet) -> (Self, Alphabet, Move);
// Provided methods
fn internal_step(&mut self, tape: &TuringTape<Alphabet>) { ... }
fn run_until_end(
start_state: Self,
end_states: Vec<Self>,
empty_token: Alphabet,
start_token: Alphabet,
initial_state: Vec<Alphabet>,
) -> (Self, Vec<Alphabet>) { ... }
}
Expand description
A trait that implements the behaviour for turing states
Required Methods§
Provided Methods§
Sourcefn internal_step(&mut self, tape: &TuringTape<Alphabet>)
fn internal_step(&mut self, tape: &TuringTape<Alphabet>)
Execute one step of the turing machine
Sourcefn run_until_end(
start_state: Self,
end_states: Vec<Self>,
empty_token: Alphabet,
start_token: Alphabet,
initial_state: Vec<Alphabet>,
) -> (Self, Vec<Alphabet>)
fn run_until_end( start_state: Self, end_states: Vec<Self>, empty_token: Alphabet, start_token: Alphabet, initial_state: Vec<Alphabet>, ) -> (Self, Vec<Alphabet>)
Run this turing machine from a start state, until it eaches a final state. Will return a tuple containing the end_state and a vector of the memory state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.