-turing(Tape0, Tape) :-
 -    perform(q0, [], Ls, Tape0, Rs),
 -    reverse(Ls, Ls1),
 -    append(Ls1, Rs, Tape).
 -
 -perform(qf, Ls, Ls, Rs, Rs) :- !.
 -perform(Q0, Ls0, Ls, Rs0, Rs) :-
 -    symbol(Rs0, Sym, RsRest),
 -    once(rule(Q0, Sym, Q1, NewSym, Action)),
 -    action(Action, Ls0, Ls1, [NewSym|RsRest], Rs1),
 -    perform(Q1, Ls1, Ls, Rs1, Rs).
 -
 -symbol([], b, []).
 -symbol([Sym|Rs], Sym, Rs).
 -
 -action(left, Ls0, Ls, Rs0, Rs) :- left(Ls0, Ls, Rs0, Rs).
 -action(stay, Ls, Ls, Rs, Rs).
 -action(right, Ls0, [Sym|Ls0], [Sym|Rs], Rs).
 -
 -left([], [], Rs0, [b|Rs0]).
 -left([L|Ls], Ls, Rs, [L|Rs]).
