Edinburgh Research Explorer
Second-Order Simple Grammars
Citation for published version:
Stirling, C 2006, Second-Order Simple Grammars. in CONCUR 2006 - Concurrency Theory: 17th
International Conference, CONCUR 2006, Bonn, Germany, August 27-30, 2006, Proceedings. vol. 4137,
Springer Berlin Heidelberg, pp. 509-523. https://doi.org/10.1007/11817949_34
Digital Object Identifier (DOI):
10.1007/11817949_34
Link:
Link to publication record in Edinburgh Research Explorer
Document Version:
Peer reviewed version
Published In:
CONCUR 2006 - Concurrency Theory
General rights
Copyright for the publications made accessible via the Edinburgh Research Explorer is retained by the author(s)
and / or other copyright owners and it is a condition of accessing these publications that users recognise and
abide by the legal requirements associated with these rights.
Take down policy
The University of Edinburgh has made every reasonable effort to ensure that Edinburgh Research Explorer
content complies with UK legislation. If you believe that the public display of this file breaches copyright please
contact openaccess@ed.ac.uk providing details, and we will remove access to the work immediately and
investigate your claim.
Download date: 10. Aug. 2022
Seond-Order Simple Grammars
Colin Stirling
Shool of Informatis
University of Edinburgh
Edinburgh EH9 3JZ, UK
email: psinf.ed.a.uk
1 Intro dution
Higher-order notations for trees have a venerable history from the 1970s and
1980s when shemes (that is, funtional programs without interpretations) and
their relationship to formal language theory were rst studied. Inluded are
higher-order reursion shemes and pushdown automata. Automata and lan-
guage theory study nitely presented mehanisms for generating languages. In-
stead of language generators, one an view them as pro ess aluli, propagators
of possibly innite labelled transition systems. Reently, mo del-heking teh-
niques have b een suessfully extended to these higher-order notations in the
deterministi ase [18, 9, 8, 21℄.
A long standing open question is: given two
n
th-order shemes do they gen-
erate the same tree? Courelle [10℄ showed that for
n
= 1 the problem oin-
ides with the language equivalene problem for deterministi pushdown au-
tomata (DPDA) that was subsequently solved p ositively by Senizergues [23℄.
For
n >
1, equivalene of
safe
n
th-order reursion shemes oinides with equiv-
alene between determinisiti
n
th-order pushdown automata [12, 18℄. It is not
known whether safety is a genuine restrition on expressive power: see [1℄.
Seond-order pushdown automata involve nite-state ontrol over a stak
of staks. They have appliations in language theory as they haraterize the
indexed
languages introdued by Aho [2℄. Also, they generalize the \mildly"
ontext-sensitive languages used in omputational linguistis [29℄. Aho dened
these languages using indexed grammars and also haraterized them in terms
of nested stak automata [3℄. Their haraterization in terms of seond-order
pushdown automata is due to Maslov, who also dened a hierarhy of higher-
order indexed languages haraterized by higher-order pushdown automata, [20℄.
A more detailed aount is given by Damm and Goerdt [12℄.
There has b een onsiderable researh ativity on deision pro edures for
bisimulation equivalene between rst-order systems, initiated with [4℄ for normed
ontext-free grammars and then extended to lasses of pushdown automata [26℄.
Reent results show that bisimulation equivalene is undeidable [17℄.
Here, we present a deidability result for equivalene of seond-order sys-
tems. A onguration of a seond-order pushdown automaton is a state and a
stak of staks. The operations p op staks and push staks onto it. We examine
deterministi seond-order pushdown automata whih generalize DPDA. A on-
guration of a DPDA is a state and a stak. Simple grammars are an instane
of DPDA when there is a single state and no
-transitions. So a onguration of
a simple grammar is justa stak. Korenjak and Hop roft showed that language
equivalene is deidable between ongurations of simple grammars [19℄. Here,
we introdue seond-order simple grammars as the subset of seond-order deter-
ministi pushdown automata when there is a single state and no
-transitions.
A onguration of suh a grammar is, therefore, a stak of staks. We show that
language equivalene is deidable for a subset of seond-order simple grammars.
The pro of tehnique is based on bisimulation equivalene and some ombina-
toris ab out rep etitions of stak extensions (lo osely based on ideas from [28℄).
We view this result as a rst step towards understanding the general equivalene
problem for higher-order shemes.
In Setion 2, we desrib e 2nd-order (deterministi) pushdown automata and
in Setion 3 we introdue 2nd-order simple grammars and the subset that we
study. Some properties of the grammars are outlined in Setion 4. In Setions 5
and 6 we present the equivalene deision pro edure, using tableaux.
2 2nd-order pushdown automata
The following four nite sets are ingredients of a 2nd-order pushdown automaton,
a 2PDA: states
P
, stak symb ols
S
, alphabet
A
and basi transitions
T
. A basi
transition is
pX
a
!
q
where
p
and
q
are states in
P
,
X
is a stak symbol in
S
,
a
2
A
[ f
g
and
is an operation belonging to
f
swap
;
push
;
pop :
2
S
g
.
A 2-stak is a sequene of non-empty staks
1
:
: : :
:
n
, so eah
i
2
S
+
.
We use
for the empty stak and apital greek letters
,
,
: : :
to range over
sequenes of staks with
for the empty sequene. An operation
is dened on
a 2-stak as follows:
swap
(
X
:
) =
:
push(
:
) =
:
:
pop (
:
) =
A onguration of a 2PDA onsists of a state
p
2
P
and a 2-stak
. The
transitions of a onguration are dened by the following rule from the basi
transitions
T
.
PRE If
pX
a
!
q
2
T
then
pX
:
a
!
q
(
X
:
)
A traditional automaton interpretation is that on input
a
with basi transition
pX
a
!
q
the onguration
pX
:
in state
p
with
X
at the top of the
rst stak hanges to state
q
and
(
X
:
) replaes
X
:
. Alternatively,
with resp et to a generational or pro ess alulus persp etive the onguration
pX
:
generates, or p erforms,
a
and b eomes
q
(
X
:
). In b oth aounts
-transitions have a speial status. If
a
=
then the onguration may hange
without reading an input or it may beome
q
(
X
:
) silently without p er-
forming an observable ation. In the following we abbreviate a basi transition
pX
a
!
q
swap
to
pX
a
!
q
.
The
transition graph
G
(
p
) is generated by deriving all possible transitions
from
p
and every onguration reahable from it using the rule PRE.
Example 1.
Consider the following basi transitions.
pZ
a
!
q Z q Z
a
!
q AZ q A
a
!
q AA q A
b
!
r
push
rA
b
!
r rZ
!
s
pop
sA
!
s sZ
!
s
pop
Part of the transition graph
G
(
pZ
) is depited in Figure 1.
ut
pZ
a
!
q Z
a
!
q AZ
a
!
q AAZ
a
!
: : :
#
b
#
b
rAZ
:
AZ rAAZ
:
AAZ
#
b
#
b
sZ
sAZ
rZ
:
AZ rAZ
:
AAZ
#
"
#
b
s : : :
.
.
.
Fig. 1.
A 2PDA
A 2PDA is presentable in normal form, up to isomorphism of transition
graphs, where eah transition of the form
pX
a
!
q
2
T
obeys the onstraint
that the length of
,
j
j
, is at most 2. Enforement of the normal form is easy
to ahieve, by intro duing extra stak symbols.
Denition 1.
The
language
of a onguration
p
,
L
(
p
)
, is the set of words
w
2
A
suh that
p
w
!
q
for some
q
.
When reognising any suh word the 2-stak is thereby emptied. For instane,
L
(
pZ
) in the ase of Example 1 is
f
a
n
b
n
n
:
n
2
g
whih is a ontext-sensitive
language. This is alled
empty stak aeptane
. A word
w
2
A
is in
L
(
p
) if
there is a
w
-path from
p
to a terminal state
q
for some
q
in the graph
G
(
p
).
The languages reognized oinide with those reognized if nal states were also
inluded.
Our denition of a 2PDA is based on [18℄ exept that it expliitly extends
a standard PDA (beause of swap transitions). It is simpler than Maslov's,
Damm and Go erdt's denition [20, 12℄. In their ase, a 2-stak is a sequene
of pairs (
X
i
;
i
) where
X
i
2
S
, with operations pop
1
, pop
2
, push
1
(
), push
2
(
)
whih work as follows: pop
1
[(
X;
1
) :
℄ =
, p op
2
[(
X; Y
) :
℄ = (
X;
) :
,
push
1
(
Z
1
Z
2
)[(
X;
) :
℄ = (
Z
1
;
) : (
Z
2
;
) :
and push
2
(
Z
1
Z
2
)[(
X;
) :
℄
= (
X; Z
1
Z
2
) :
. There is no loss in expressive p ower (with respet to lan-
guage equivalene) as these op erations an b e simulated by families of 2PDA
operations.
The family of languages reognized by 2PDA is the
indexed languages
, intro-
dued by Aho in 1968 [2, 3℄, whih p ermit some ontext-dependeny, as Exam-
ple 1 illustrates. Aho oers a grammatial metho d for generating them as well as
an automata theoreti metho d (using nested stak automata) whih turns out
to b e equivalent to the 2PDA, as shown by Maslov [20℄. An equivalent, shema-
like, formalism is the OI maro-grammars of Fisher [14℄. Aho also shows that
the indexed languages are ontext-sensitive whih is not obvious beause re-
peated push transitions an inrease the size of a onguration non-linearly.
They form an AFL and are a prop er subset of the ontext-sensitive languages:
f
(
ab
n
)
n
:
n
0
g
is not an indexed language via a pumping lemma for them
[16, 5℄. The subset of
linear
indexed languages is the mildly ontext-sensitive
languages generated by tree adjoining grammars [29℄.
A 2PDA is
deterministi
if
T
obeys the following onditions.
{
if
pX
a
!
q
and
pX
a
!
r
then
q
=
r
and
=
{
if
pX
!
q
and
pX
a
!
r
then
a
=
Example 1 is a determinisiti 2PDA. The equivalene question, whether two
ongurations of a determinisiti 2PDA reognise the same language, general-
izes the DPDA equivalene problem, that was solved p ositively by Senizergues
[25, 23, 24, 27, 28℄. A DPDA onguration
p
an b e oded as a deterministi
2PDA onguration
pZ
where
Z
is a new end of stak marker with the extra
transitions
q Z
!
q
pop for eah state
q
.
Due to empty stak aeptane, the language reognized by a deterministi
2PDA has the prex free property: if
w
2
L
(
p
) then no proper prex
v
of
w
an
belong to
L
(
p
). However, as with DPDA and empty stak aeptane, for any
deterministi indexed language
L
, when dened in the Maslov style [22℄ with nal
state aeptane, there is a deterministi 2PDA that aepts
f
w
$ :
w
2
L
g
where
$ is a new alphab et symbol: deterministi 2PDA oinide with deterministi
Maslov pushdown automata with empty stak aeptane. The deterministi
indexed languages are losed under omplement (and are therefore a proper
subset of the indexed languages) and inlude inherently ambiguous ontext-free
languages suh as
f
a
i
b
j
k
:
i; j; k >
0 and
i
=
j
or
j
=
k
g
[22℄.
3 Seond-order simple grammars
In this setion we onsider seond-order simple grammars, 2SGs. These are de-
terminisiti 2PDAs whih have just one state and no
-transitions. We an there-
fore drop the state from transitions and ongurations: transitions now have the
form
X
a
!
and a onguration has the form
. Reahability prop erties of
their nondeterministi version, at higher-orders, have been examined in [6℄. We
onjeture that simple grammars dened from Maslov pushdown automata are
more expressive than 2SGs.