Turing-Machine-Executor

An executor of Turing machines.

View on GitHub

EMT’s code documentation!

Class: Machine

class machine.Machine()

The Turing’s machine.

get_alphabet()

Get the alphabet of the machine.

get_blank()

Get the blank character of the machine.

get_first_state()

Get the first state of the machine (the initial state).

get_program()

Get the program of the machine.

get_states()

Get the states of the machine.

static is_direction(to_check: str)

Check if a string represents a valid direction for a Turing machine.

is_halt(state: str)

Check if a state is an halting state for the machine.

is_state(to_check: str)

Check if a string is a valid state for the machine.

is_symbol(to_check: str)

Check if a character is a valid symbol for the machine.

set_alphabet(new_alpha: str)

Set the alphabet of the Turing machine.

set_halting_states(halting_states: List[str])

Set the machine’s halting states.

set_program(new_program: Dict[Tuple[str, str], Optional[Tuple[str, str, str]]])

Set the program of the machine.

set_states(new_states: List[str])

Set the machine’s states.