Trait turingmachine_rs::TuringStates[][src]

pub trait TuringStates<Alphabet: Clone>: Sized + PartialEq {
    fn step(&self, current_token: Alphabet) -> (Self, Alphabet, Move);

    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>) { ... } }

A trait that implements the behaviour for turing states

Required methods

fn step(&self, current_token: Alphabet) -> (Self, Alphabet, Move)[src]

The internal step function Output the new state, token at current cursor position, and move of the cursor position

Loading content...

Provided methods

fn internal_step(&mut self, tape: &TuringTape<Alphabet>)[src]

Execute one step of the turing machine

fn run_until_end(
    start_state: Self,
    end_states: Vec<Self>,
    empty_token: Alphabet,
    start_token: Alphabet,
    initial_state: Vec<Alphabet>
) -> (Self, Vec<Alphabet>)
[src]

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.

Loading content...

Implementors

Loading content...