Instruction

Trait Instruction 

Source
pub trait Instruction<Q, S>
where Q: RawState,
{ // Required methods fn direction(&self) -> Direction; fn current_state(&self) -> &State<Q>; fn next_state(&self) -> &State<Q>; fn symbol(&self) -> &S; fn write_symbol(&self) -> &S; // Provided methods fn head(&self) -> Head<&Q, &S> { ... } fn tail(&self) -> Tail<&Q, &S> { ... } fn as_rule(&self) -> Rule<&Q, &S> { ... } }
Expand description

The Instruction trait defines the expected behaviors of a particular rule within a Turing machine program.

Required Methods§

Source

fn direction(&self) -> Direction

returns a copy of the direction of the head

Source

fn current_state(&self) -> &State<Q>

returns a reference to the current state of the Turing machine

Source

fn next_state(&self) -> &State<Q>

returns a reference to the next state of the Turing machine

Source

fn symbol(&self) -> &S

returns a reference to the current symbol under the head

Source

fn write_symbol(&self) -> &S

returns a reference to the symbol to be written by the head

Provided Methods§

Source

fn head(&self) -> Head<&Q, &S>

returns an instance of Head containing references to the current state and symbol

Source

fn tail(&self) -> Tail<&Q, &S>

returns an instance of Tail containing references to the next state and symbol

Source

fn as_rule(&self) -> Rule<&Q, &S>

returns an instance of Rule containing references to the states and symbols within

Implementors§

Source§

impl<A, Q, S> Instruction<Q, S> for A
where A: Scope<Q, S> + Directive<Q, S>, Q: RawState, S: Symbol,