turing is a GAP package that simulates Turing machines.
A Turing machine is an abstract computing device dreamed up by Alan Turing
It consist of a Tape, a Program and a current State.
The current State and the Symbol read from the Tape are used to 6.2-1 an action to perform.
Below there is a session that demonstrated the Turing machine that increments a unary number.
gap> LoadPackage("turing");; gap> program := TmProgram(TmState(1)); <program empty> gap> TmAddRule(program, TmState(1), TmSymbol('I'), TmState(1), TmSymbol('I'), TmRight()); gap> TmAddRule(program, TmState(1), TmBlank() , TmState(2), TmSymbol('I'), TmLeft()); gap> TmAddRule(program, TmState(2), TmSymbol('I'), TmState(2), TmSymbol('I'), TmLeft()); gap> TmAddRule(program, TmState(2), TmBlank() , TmHalt(1) , TmBlank() , TmRight()); gap> tape := TmTape(); <tape empty> gap> TmTapeWrite(tape, TmSymbol('I')); gap> machine := TmMachine(tape, program); <machine q1 <tape |__[I]__|>> gap> TmRun(machine); gap> machine; <machine h1 <tape |__[I]I_|>>
‣ IsTuringDirection( arg ) | ( category ) |
Returns: true or false
the category of all direcitons.
‣ IsTuringLeft( arg ) | ( category ) |
Returns: true or false
the category of the direction left.
‣ IsTuringRight( arg ) | ( category ) |
Returns: true or false
the category of the direction right.
‣ IsTuringMachine( arg ) | ( category ) |
Returns: true or false
the category of turing machines.
‣ IsTuringProgram( arg ) | ( category ) |
Returns: true or false
Determines if an object is a turing program.
‣ IsTuringState( arg ) | ( category ) |
Returns: true or false
determines if arg is a turing state.
‣ IsTuringHaltState( arg ) | ( category ) |
Returns: true or false
determines if arg is a turing halting state.
‣ IsTuringSymbol( arg ) | ( category ) |
Returns: true or false
the category of all turing symbols.
‣ IsTuringBlank( arg ) | ( category ) |
Returns: true or false
the category of all turing blank symbols.
‣ IsTuringTape( arg ) | ( category ) |
Returns: true or false
Determines if arg is a turing tape.
The next definitions are global.
‣ IsTuringObject( arg ) | ( category ) |
Returns: true or false
Determines if arg is a turing object.
generated by GAPDoc2HTML