/*
	accept(Xs) :-
		The string represented by the list Xs is accepted by
		the NPDA defined by initial/1, delta/5, and final/1.
*/

	accept(Xs) :- initial(Q), accept(Xs,Q,[]).

	accept([X|Xs],Q,S) :- delta(Q,X,S,Q1,S1), accept(Xs,Q1,S1).
	accept([],Q,[]) :- final(Q).

%  Program 17.3: An interpreter for a nondeterministic pushdown automaton (NPDA)
