<s>
a	O
type	O
of	O
automaton	B-Application
that	O
employs	O
a	O
stack	B-Application
.	O
</s>
<s>
Pushdown	B-Application
automata	I-Application
are	O
used	O
in	O
theories	O
about	O
what	O
can	O
be	O
computed	O
by	O
machines	O
.	O
</s>
<s>
They	O
are	O
more	O
capable	O
than	O
finite-state	B-Architecture
machines	I-Architecture
but	O
less	O
capable	O
than	O
Turing	B-Architecture
machines	I-Architecture
(	O
see	O
below	O
)	O
.	O
</s>
<s>
Deterministic	B-Application
pushdown	I-Application
automata	I-Application
can	O
recognize	O
all	O
deterministic	O
context-free	O
languages	O
while	O
nondeterministic	O
ones	O
can	O
recognize	O
all	O
context-free	O
languages	O
,	O
with	O
the	O
former	O
often	O
used	O
in	O
parser	B-Language
design	O
.	O
</s>
<s>
The	O
term	O
"	O
pushdown	B-Application
"	O
refers	O
to	O
the	O
fact	O
that	O
the	O
stack	B-Application
can	O
be	O
regarded	O
as	O
being	O
"	O
pushed	O
down	O
"	O
like	O
a	O
tray	O
dispenser	O
at	O
a	O
cafeteria	O
,	O
since	O
the	O
operations	O
never	O
work	O
on	O
elements	O
other	O
than	O
the	O
top	O
element	O
.	O
</s>
<s>
A	O
stack	B-Application
automaton	B-Application
,	O
by	O
contrast	O
,	O
does	O
allow	O
access	O
to	O
and	O
operations	O
on	O
deeper	O
elements	O
.	O
</s>
<s>
Stack	B-Application
automata	O
can	O
recognize	O
a	O
strictly	O
larger	O
set	O
of	O
languages	O
than	O
pushdown	B-Application
automata	I-Application
.	O
</s>
<s>
A	O
nested	B-Application
stack	I-Application
automaton	I-Application
allows	O
full	O
access	O
,	O
and	O
also	O
allows	O
stacked	O
values	O
to	O
be	O
entire	O
sub-stacks	O
rather	O
than	O
just	O
single	O
finite	O
symbols	O
.	O
</s>
<s>
A	O
finite-state	B-Architecture
machine	I-Architecture
just	O
looks	O
at	O
the	O
input	O
signal	O
and	O
the	O
current	O
state	O
:	O
it	O
has	O
no	O
stack	B-Application
to	O
work	O
with	O
.	O
</s>
<s>
A	O
pushdown	B-Application
automaton	I-Application
(	O
PDA	O
)	O
differs	O
from	O
a	O
finite	B-Architecture
state	I-Architecture
machine	I-Architecture
in	O
two	O
ways	O
:	O
</s>
<s>
It	O
can	O
use	O
the	O
top	O
of	O
the	O
stack	B-Application
to	O
decide	O
which	O
transition	O
to	O
take	O
.	O
</s>
<s>
It	O
can	O
manipulate	O
the	O
stack	B-Application
as	O
part	O
of	O
performing	O
a	O
transition	O
.	O
</s>
<s>
A	O
pushdown	B-Application
automaton	I-Application
reads	O
a	O
given	O
input	O
string	O
from	O
left	O
to	O
right	O
.	O
</s>
<s>
In	O
each	O
step	O
,	O
it	O
chooses	O
a	O
transition	O
by	O
indexing	O
a	O
table	O
by	O
input	O
symbol	O
,	O
current	O
state	O
,	O
and	O
the	O
symbol	O
at	O
the	O
top	O
of	O
the	O
stack	B-Application
.	O
</s>
<s>
A	O
pushdown	B-Application
automaton	I-Application
can	O
also	O
manipulate	O
the	O
stack	B-Application
,	O
as	O
part	O
of	O
performing	O
a	O
transition	O
.	O
</s>
<s>
The	O
manipulation	O
can	O
be	O
to	O
push	O
a	O
particular	O
symbol	O
to	O
the	O
top	O
of	O
the	O
stack	B-Application
,	O
or	O
to	O
pop	O
off	O
the	O
top	O
of	O
the	O
stack	B-Application
.	O
</s>
<s>
The	O
automaton	B-Application
can	O
alternatively	O
ignore	O
the	O
stack	B-Application
,	O
and	O
leave	O
it	O
as	O
it	O
is	O
.	O
</s>
<s>
Put	O
together	O
:	O
Given	O
an	O
input	O
symbol	O
,	O
current	O
state	O
,	O
and	O
stack	B-Application
symbol	O
,	O
the	O
automaton	B-Application
can	O
follow	O
a	O
transition	O
to	O
another	O
state	O
,	O
and	O
optionally	O
manipulate	O
(	O
push	O
or	O
pop	O
)	O
the	O
stack	B-Application
.	O
</s>
<s>
If	O
,	O
in	O
every	O
situation	O
,	O
at	O
most	O
one	O
such	O
transition	O
action	O
is	O
possible	O
,	O
then	O
the	O
automaton	B-Application
is	O
called	O
a	O
deterministic	B-Application
pushdown	I-Application
automaton	I-Application
(	O
DPDA	B-Application
)	O
.	O
</s>
<s>
In	O
general	O
,	O
if	O
several	O
actions	O
are	O
possible	O
,	O
then	O
the	O
automaton	B-Application
is	O
called	O
a	O
general	O
,	O
or	O
nondeterministic	O
,	O
PDA	O
.	O
</s>
<s>
A	O
given	O
input	O
string	O
may	O
drive	O
a	O
nondeterministic	B-Application
pushdown	I-Application
automaton	I-Application
to	O
one	O
of	O
several	O
configuration	O
sequences	O
;	O
if	O
one	O
of	O
them	O
leads	O
to	O
an	O
accepting	O
configuration	O
after	O
reading	O
the	O
complete	O
input	O
string	O
,	O
the	O
latter	O
is	O
said	O
to	O
belong	O
to	O
the	O
language	O
accepted	O
by	O
the	O
automaton	B-Application
.	O
</s>
<s>
It	O
has	O
the	O
intended	O
meaning	O
that	O
,	O
in	O
state	O
,	O
on	O
the	O
input	O
and	O
with	O
as	O
topmost	O
stack	B-Application
symbol	O
,	O
may	O
read	O
,	O
change	O
the	O
state	O
to	O
,	O
pop	O
,	O
replacing	O
it	O
by	O
pushing	O
.	O
</s>
<s>
Here	O
contains	O
all	O
possible	O
actions	O
in	O
state	O
with	O
on	O
the	O
stack	B-Application
,	O
while	O
reading	O
on	O
the	O
input	O
.	O
</s>
<s>
In	O
order	O
to	O
formalize	O
the	O
semantics	O
of	O
the	O
pushdown	B-Application
automaton	I-Application
a	O
description	O
of	O
the	O
current	O
situation	O
is	O
introduced	O
.	O
</s>
<s>
Any	O
3-tuple	O
is	O
called	O
an	O
instantaneous	O
description	O
(	O
ID	O
)	O
of	O
,	O
which	O
includes	O
the	O
current	O
state	O
,	O
the	O
part	O
of	O
the	O
input	O
tape	O
that	O
has	O
not	O
been	O
read	O
,	O
and	O
the	O
contents	O
of	O
the	O
stack	B-Application
(	O
topmost	O
symbol	O
written	O
first	O
)	O
.	O
</s>
<s>
In	O
general	O
pushdown	B-Application
automata	I-Application
are	O
nondeterministic	O
meaning	O
that	O
in	O
a	O
given	O
instantaneous	O
description	O
there	O
may	O
be	O
several	O
possible	O
steps	O
.	O
</s>
<s>
With	O
the	O
above	O
definition	O
in	O
each	O
step	O
always	O
a	O
single	O
symbol	O
(	O
top	O
of	O
the	O
stack	B-Application
)	O
is	O
popped	O
,	O
replacing	O
it	O
with	O
as	O
many	O
symbols	O
as	O
necessary	O
.	O
</s>
<s>
As	O
a	O
consequence	O
no	O
step	O
is	O
defined	O
when	O
the	O
stack	B-Application
is	O
empty	O
.	O
</s>
<s>
Computations	O
of	O
the	O
pushdown	B-Application
automaton	I-Application
are	O
sequences	O
of	O
steps	O
.	O
</s>
<s>
The	O
computation	O
starts	O
in	O
the	O
initial	O
state	O
with	O
the	O
initial	O
stack	B-Application
symbol	O
on	O
the	O
stack	B-Application
,	O
and	O
a	O
string	O
on	O
the	O
input	O
tape	O
,	O
thus	O
with	O
initial	O
description	O
.	O
</s>
<s>
The	O
pushdown	B-Application
automaton	I-Application
either	O
accepts	O
by	O
final	O
state	O
,	O
which	O
means	O
after	O
reading	O
its	O
input	O
the	O
automaton	B-Application
reaches	O
an	O
accepting	B-Architecture
state	I-Architecture
(	O
in	O
)	O
,	O
or	O
it	O
accepts	O
by	O
empty	O
stack	B-Application
(	O
)	O
,	O
which	O
means	O
after	O
reading	O
its	O
input	O
the	O
automaton	B-Application
empties	O
its	O
stack	B-Application
.	O
</s>
<s>
The	O
first	O
acceptance	O
mode	O
uses	O
the	O
internal	O
memory	O
(	O
state	O
)	O
,	O
the	O
second	O
the	O
external	O
memory	O
(	O
stack	B-Application
)	O
.	O
</s>
<s>
For	O
each	O
single	O
pushdown	B-Application
automaton	I-Application
these	O
two	O
languages	O
need	O
to	O
have	O
no	O
relation	O
:	O
they	O
may	O
be	O
equal	O
but	O
usually	O
this	O
is	O
not	O
the	O
case	O
.	O
</s>
<s>
A	O
specification	O
of	O
the	O
automaton	B-Application
should	O
also	O
include	O
the	O
intended	O
mode	O
of	O
acceptance	O
.	O
</s>
<s>
Taken	O
over	O
all	O
pushdown	B-Application
automata	I-Application
both	O
acceptance	O
conditions	O
define	O
the	O
same	O
family	O
of	O
languages	O
.	O
</s>
<s>
stack	B-Application
alphabet	O
:	O
</s>
<s>
start	B-Architecture
state	I-Architecture
:	O
</s>
<s>
start	O
stack	B-Application
symbol	O
:	O
</s>
<s>
accepting	B-Architecture
states	I-Architecture
:	O
</s>
<s>
In	O
words	O
,	O
the	O
first	O
two	O
instructions	O
say	O
that	O
in	O
state	O
any	O
time	O
the	O
symbol	O
is	O
read	O
,	O
one	O
is	O
pushed	O
onto	O
the	O
stack	B-Application
.	O
</s>
<s>
The	O
third	O
and	O
fourth	O
instructions	O
say	O
that	O
,	O
at	O
any	O
moment	O
the	O
automaton	B-Application
may	O
move	O
from	O
state	O
to	O
state	O
.	O
</s>
<s>
Finally	O
,	O
the	O
sixth	O
instruction	O
says	O
that	O
the	O
machine	O
may	O
move	O
from	O
state	O
to	O
accepting	B-Architecture
state	I-Architecture
only	O
when	O
the	O
stack	B-Application
consists	O
of	O
a	O
single	O
.	O
</s>
<s>
Every	O
context-free	O
grammar	O
can	O
be	O
transformed	O
into	O
an	O
equivalent	O
nondeterministic	B-Application
pushdown	I-Application
automaton	I-Application
.	O
</s>
<s>
Where	O
the	O
grammar	O
rewrites	O
a	O
nonterminal	O
,	O
the	O
PDA	O
takes	O
the	O
topmost	O
nonterminal	O
from	O
its	O
stack	B-Application
and	O
replaces	O
it	O
by	O
the	O
right-hand	O
part	O
of	O
a	O
grammatical	O
rule	O
(	O
expand	O
)	O
.	O
</s>
<s>
Where	O
the	O
grammar	O
generates	O
a	O
terminal	O
symbol	O
,	O
the	O
PDA	O
reads	O
a	O
symbol	O
from	O
input	O
when	O
it	O
is	O
the	O
topmost	O
symbol	O
on	O
the	O
stack	B-Application
(	O
match	O
)	O
.	O
</s>
<s>
In	O
a	O
sense	O
the	O
stack	B-Application
of	O
the	O
PDA	O
contains	O
the	O
unprocessed	O
data	O
of	O
the	O
grammar	O
,	O
corresponding	O
to	O
a	O
pre-order	O
traversal	O
of	O
a	O
derivation	O
tree	O
.	O
</s>
<s>
The	O
PDA	O
accepts	O
by	O
empty	O
stack	B-Application
.	O
</s>
<s>
Its	O
initial	O
stack	B-Application
symbol	O
is	O
the	O
grammar	O
's	O
start	O
symbol	O
.	O
</s>
<s>
For	O
a	O
context-free	O
grammar	O
in	O
Greibach	O
normal	O
form	O
,	O
defining	O
(	O
1	O
,	O
γ	O
)	O
∈	O
δ(1,a,A )	O
for	O
each	O
grammar	O
rule	O
A	O
→	O
aγ	O
also	O
yields	O
an	O
equivalent	O
nondeterministic	B-Application
pushdown	I-Application
automaton	I-Application
.	O
</s>
<s>
The	O
language	O
of	O
strings	O
accepted	O
by	O
a	O
deterministic	B-Application
pushdown	I-Application
automaton	I-Application
(	O
DPDA	B-Application
)	O
is	O
called	O
a	O
deterministic	O
context-free	O
language	O
.	O
</s>
<s>
As	O
a	O
consequence	O
,	O
the	O
DPDA	B-Application
is	O
a	O
strictly	O
weaker	O
variant	O
of	O
the	O
PDA	O
.	O
</s>
<s>
Even	O
for	O
regular	B-General_Concept
languages	I-General_Concept
,	O
there	O
is	O
a	O
size	O
explosion	O
problem	O
:	O
for	O
any	O
recursive	O
function	O
and	O
for	O
arbitrarily	O
large	O
integers	O
,	O
there	O
is	O
a	O
PDA	O
of	O
size	O
describing	O
a	O
regular	B-General_Concept
language	I-General_Concept
whose	O
smallest	O
DPDA	B-Application
has	O
at	O
least	O
states	O
.	O
</s>
<s>
For	O
many	O
non-regular	O
PDAs	O
,	O
any	O
equivalent	O
DPDA	B-Application
would	O
require	O
an	O
unbounded	O
number	O
of	O
states	O
.	O
</s>
<s>
A	O
finite	B-Architecture
automaton	I-Architecture
with	O
access	O
to	O
two	O
stacks	B-Application
is	O
a	O
more	O
powerful	O
device	O
,	O
equivalent	O
in	O
power	O
to	O
a	O
Turing	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
A	O
linear	B-Application
bounded	I-Application
automaton	I-Application
is	O
a	O
device	O
which	O
is	O
more	O
powerful	O
than	O
a	O
pushdown	B-Application
automaton	I-Application
but	O
less	O
so	O
than	O
a	O
Turing	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
A	O
pushdown	B-Application
automaton	I-Application
is	O
computationally	O
equivalent	O
to	O
a	O
'	O
restricted	O
 '	O
Turing	B-Architecture
Machine	I-Architecture
(	O
TM	O
)	O
with	O
two	O
tapes	O
which	O
is	O
restricted	O
in	O
the	O
following	O
manner	O
-	O
On	O
the	O
first	O
tape	O
,	O
the	O
TM	O
can	O
only	O
read	O
the	O
input	O
and	O
move	O
from	O
left	O
to	O
right	O
(	O
it	O
cannot	O
make	O
changes	O
)	O
.	O
</s>
<s>
We	O
can	O
achieve	O
this	O
by	O
introducing	O
a	O
second	O
stack	B-Application
.	O
</s>
<s>
In	O
the	O
TM	O
model	O
of	O
PDA	O
of	O
last	O
paragraph	O
,	O
this	O
is	O
equivalent	O
to	O
a	O
TM	O
with	O
3	O
tapes	O
,	O
where	O
the	O
first	O
tape	O
is	O
the	O
read-only	O
input	O
tape	O
,	O
and	O
the	O
2nd	O
and	O
the	O
3rd	O
tape	O
are	O
the	O
'	O
push	B-Application
and	I-Application
pop	I-Application
 '	O
(	O
stack	B-Application
)	O
tapes	O
.	O
</s>
<s>
In	O
order	O
for	O
such	O
a	O
PDA	O
to	O
simulate	O
any	O
given	O
TM	O
,	O
we	O
give	O
the	O
input	O
of	O
the	O
PDA	O
to	O
the	O
first	O
tape	O
,	O
while	O
keeping	O
both	O
the	O
stacks	B-Application
empty	O
.	O
</s>
<s>
It	O
then	O
goes	O
on	O
to	O
push	O
all	O
the	O
input	O
from	O
the	O
input	O
tape	O
to	O
the	O
first	O
stack	B-Application
.	O
</s>
<s>
When	O
the	O
entire	O
input	O
is	O
transferred	O
to	O
the	O
1st	O
stack	B-Application
,	O
now	O
we	O
proceed	O
like	O
a	O
normal	O
TM	O
,	O
where	O
moving	O
right	O
on	O
the	O
tape	O
is	O
the	O
same	O
as	O
popping	O
a	O
symbol	O
from	O
the	O
1st	O
stack	B-Application
and	O
pushing	O
a	O
(	O
possibly	O
updated	O
)	O
symbol	O
into	O
the	O
second	O
stack	B-Application
,	O
and	O
moving	O
left	O
corresponds	O
to	O
popping	O
a	O
symbol	O
from	O
the	O
2nd	O
stack	B-Application
and	O
pushing	O
a	O
(	O
possibly	O
updated	O
)	O
symbol	O
into	O
the	O
first	O
stack	B-Application
.	O
</s>
<s>
We	O
hence	O
have	O
a	O
PDA	O
with	O
2	O
stacks	B-Application
that	O
can	O
simulate	O
any	O
TM	O
.	O
</s>
<s>
A	O
GPDA	O
is	O
a	O
PDA	O
that	O
writes	O
an	O
entire	O
string	O
of	O
some	O
known	O
length	O
to	O
the	O
stack	B-Application
or	O
removes	O
an	O
entire	O
string	O
from	O
the	O
stack	B-Application
in	O
one	O
step	O
.	O
</s>
<s>
As	O
a	O
generalization	O
of	O
pushdown	B-Application
automata	I-Application
,	O
Ginsburg	O
,	O
Greibach	O
,	O
and	O
Harrison	O
(	O
1967	O
)	O
investigated	O
stack	B-Application
automata	O
,	O
which	O
may	O
additionally	O
step	O
left	O
or	O
right	O
in	O
the	O
input	O
string	O
(	O
surrounded	O
by	O
special	O
endmarker	O
symbols	O
to	O
prevent	O
slipping	O
out	O
)	O
,	O
and	O
step	O
up	O
or	O
down	O
in	O
the	O
stack	B-Application
in	O
read-only	O
mode	O
.	O
</s>
<s>
A	O
stack	B-Application
automaton	B-Application
is	O
called	O
nonerasing	O
if	O
it	O
never	O
pops	O
from	O
the	O
stack	B-Application
.	O
</s>
<s>
The	O
class	O
of	O
languages	O
accepted	O
by	O
nondeterministic	O
,	O
nonerasing	O
stack	B-Application
automata	O
is	O
NSPACE(n2 )	O
,	O
which	O
is	O
a	O
superset	O
of	O
the	O
context-sensitive	O
languages	O
.	O
</s>
<s>
The	O
class	O
of	O
languages	O
accepted	O
by	O
deterministic	O
,	O
nonerasing	O
stack	B-Application
automata	O
is	O
DSPACE( n⋅	O
log(n )	O
)	O
.	O
</s>
<s>
Aizikowitz	O
and	O
Kaminski	O
introduced	O
synchronized	O
alternating	O
pushdown	B-Application
automata	I-Application
(	O
SAPDA	O
)	O
that	O
are	O
equivalent	O
to	O
conjunctive	O
grammars	O
in	O
the	O
same	O
way	O
as	O
nondeterministic	O
PDA	O
are	O
equivalent	O
to	O
context-free	O
grammars	O
.	O
</s>
