17 lines
718 B
Text
17 lines
718 B
Text
:- type incrementer_states ---> a ; halt.
|
|
:- type incrementer_symbols ---> b ; '1'.
|
|
|
|
:- func incrementer_config = config(incrementer_states, incrementer_symbols).
|
|
incrementer_config = config(a, % the initial state
|
|
set([halt]), % the set of halting states
|
|
b). % the blank symbol
|
|
|
|
:- pred incrementer(incrementer_states::in,
|
|
incrementer_symbols::in,
|
|
incrementer_symbols::out,
|
|
action::out,
|
|
incrementer_states::out) is semidet.
|
|
incrementer(a, '1', '1', right, a).
|
|
incrementer(a, b, '1', stay, halt).
|
|
|
|
TapeOut = turing(incrementer_config, incrementer, [1, 1, 1]).
|