pub trait Scope<S: Symbolic>: Include<S> + Insert<usize, S> + Stateful<State> {
    // Required methods
    fn cursor(&self) -> usize;
    fn set_index(&mut self, index: usize);
    fn set_symbol(&mut self, elem: S);
    fn tape(&self) -> Tape<S>;

    // Provided methods
    fn current(&self) -> S { ... }
    fn shift(&mut self, shift: Move, elem: S) { ... }
}
Expand description

Scope describes the focus of the [crate::turing::Turing]

Required Methods§

source

fn cursor(&self) -> usize

Scope::cursor returns the current position of the Scope on the Tape

source

fn set_index(&mut self, index: usize)

Scope::set_index sets the current position of the Scope on the Tape

source

fn set_symbol(&mut self, elem: S)

Scope::set_symbol sets the current element of the Scope on the Tape

source

fn tape(&self) -> Tape<S>

Scope::tape returns the Tape of the Scope

Provided Methods§

source

fn current(&self) -> S

Scope::current returns the current element of the Scope on the Tape

source

fn shift(&mut self, shift: Move, elem: S)

Move::Left inserts a new element at the start of the tape if the current position is 0 Move::Right inserts a new element at the end of the tape if the current position equals the total number of cells Move::Stay does nothing

Implementors§

source§

impl<S: Symbolic> Scope<S> for Driver<S>