Mikołaj Bojańczyk (Warszawa) Luc Segoufin (Paris)

Tree Languages Definable
with One Quantifier
Alternation
Mikołaj Bojańczyk (Warszawa)
Luc Segoufin (Paris)
e following problem is decidable:
Input: A regular tree language L, given by a tree automaton.
Question: Is L definable by a formula with quantifier prefix
∃* ∀* and also by a formula with quantifier prefix ∀*∃*
is talk is about understanding the expressive power of logics on words
and trees. e logics involved can only define (some) regular languages.
is talk is about understanding the expressive power of logics on words
and trees. e logics involved can only define (some) regular languages.
Understand logic X =
give na algorithm to decide if a language L is definable in X
all regular languages
languages
definable
in logic X
Why this notion of understanding?
ere is a rich theory connecting logic, regular languages, and algebra.
Why this notion of understanding?
ere is a rich theory connecting logic, regular languages, and algebra.
eorem. (Schützenberger, McNaughton/Papert)
e following are equivalent for a word language:
– L is definable in first-order logic
– L is star-free
– the syntactic monoid of L is group-free
Why this notion of understanding?
ere is a rich theory connecting logic, regular languages, and algebra.
eorem. (Schützenberger, McNaughton/Papert)
e following are equivalent for a word language:
– L is definable in first-order logic
– L is star-free
– the syntactic monoid of L is group-free
... more results, including modulo quantifiers,
the quantifier alternation hierarchy, etc.
Whyisthis
notion
of investigating
understanding?
is paper
part of
a program
the algebrais a rich theory
logic, regular languages,
and algebra.
logic ere
connection
forconnecting
trees. Eventually,
we want
to answer
questions such as:
– what is the expressive power of first-order logic on trees?
– what is a tree group?
– is there a Krohn-Rhodes decomposition theory?
eorem. (Schützenberger, McNaughton/Papert)
e following are equivalent for a word language:
– L is definable in first-order logic
– L is star-free
– the syntactic monoid of L is group-free
... more results, including modulo quantifiers,
the quantifier alternation hierarchy, etc.
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
!
"
∃x. a(x) ∧ ∀y < x. b(y)
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic
with
operators
F and F-1
!
"
−1
F a ∧ ¬(F c)
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀*
! ∃*
"
∀x∃y. c(x) ⇒ y < x ∧ a(y)
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
a⇾
b⇾
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
5. Turtle automata
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
5. Turtle automata
“go right to first a; go left to first c” fails
“go right to first a” works
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
5. Turtle automata
6. Monoids in DA
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
5. Turtle automata
6. Monoids in DA
7. A type of unambiguous expression
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also withWhat
prefixabout
∀* ∃*
4. Two–way orderedtrees?
deterministic automata
5. Turtle automata
6. Monoids in DA
7. A type of unambiguous expression
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
5. Turtle automata
6. Monoids in DA
7. A type of unambiguous expression
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
4. Two–way ordered deterministic automata
5. Turtle automata
6. Monoids in DA
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
5. Turtle automata
6. Monoids in DA
eorem. (Etessami, Schützenberger, Schwentick, érien, Vollimer, Wilke)
e following formalisms define the same word languages:
b* · a · {a,b,c}*
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
“two a’s”
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
“two a’s”
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
“all children of root have label a”
“two a’s”
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
“all children of root have label a”
“two a’s”
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
“three a’s”
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
“all children of root have label a”
“two a’s”
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
“three a’s”
1. Two-variable first-order logic
2. Temporal logic with operators F and F-1
“all children of root have label a”
“two a’s”
3. Languages definable with prefix ∃* ∀*
and also with prefix ∀* ∃*
6. Monoids in DA
“three a’s”
We consider forest languages
instead of tree languages
(a forest is a sequence of trees)
a
a
a
b
a
a
b
b
a
a
We use first-order formulas to describe properties of forests.
Variables quantify over nodes. Predicates allowed are:
“x ancestor of y” “x lexicographically before y” “label of x is a”
b
We are interested in forest languages that can be defined
in both ∀* ∃* and ∃* ∀*. We call this class ∆2.
We are interested in forest languages that can be defined
in both ∀* ∃* and ∃* ∀*. We call this class ∆2.
E.g. Trees ∈ ∆2
We are interested in forest languages that can be defined
in both ∀* ∃* and ∃* ∀*. We call this class ∆2.
E.g. Trees ∈ ∆2
every two nodes have
a common ancestor
∀x∀y∃z. z ≤ x ∧ z ≤ y
We are interested in forest languages that can be defined
in both ∀* ∃* and ∃* ∀*. We call this class ∆2.
E.g. Trees ∈ ∆2
every two nodes have
a common ancestor
∀x∀y∃z. z ≤ x ∧ z ≤ y
∀* ∃*
We are interested in forest languages that can be defined
in both ∀* ∃* and ∃* ∀*. We call this class ∆2.
E.g. Trees ∈ ∆2
every two nodes have
a common ancestor
∀x∀y∃z. z ≤ x ∧ z ≤ y
∀* ∃*
some node is ancestor
to every node
∃x∀y. x ≤ y
We are interested in forest languages that can be defined
in both ∀* ∃* and ∃* ∀*. We call this class ∆2.
E.g. Trees ∈ ∆2
every two nodes have
a common ancestor
∀x∀y∃z. z ≤ x ∧ z ≤ y
∀* ∃*
some node is ancestor
to every node
∃x∀y. x ≤ y
∃* ∀*
Question:
What forest languages can be defined in ∆2 ?
Preferably, give an algorithm that decides if L ∈ ∆2.
a word w can have two encodings:
a
b
b
a
a
b
b
a
a
b
a
a
b
hor(w)
a
ver(w)
Fact. if L is a word language definable in ∆2, then both
hor(L) and ver(L) are forest languages definable in ∆2.
Our characterization is stated as an identity.
Intuitively, a forest language is definable in ∆2 iff
it admits a certain pumping lemma.
A context is a forest with a
hole in a leaf
b
a
a
a
b
A context is a forest with a
hole in a leaf
b
b
a
a
a
a
=
b
b
a
a
b
a
b
a
b
a
a
b
A context is a forest with a
hole in a leaf
b
b
a
a
a
a
=
b
a
a
b
a
b
a
b
b
Notion of piece for contexts.
is a piece of
a
a
b
Myhill-Nerode congruence for a forest language L.
Myhill-Nerode congruence for a forest language L.
Two contexts
and
are called L-equivalent if
Myhill-Nerode congruence for a forest language L.
Two contexts
for every context
and
are called L-equivalent if
and every forest
Myhill-Nerode congruence for a forest language L.
Two contexts
and
for every context
are called L-equivalent if
and every forest
∈L
iff
∈L
Main eorem.
A forest language is definable in ∆2 iff
the following holds for all sufficiently large n
Main eorem.
A forest language is definable in ∆2 iff
the following holds for all sufficiently large n
if
is a piece of
, then
Main eorem.
A forest language is definable in ∆2 iff
the following holds for all sufficiently large n
if
n times
is a piece of
{
, then
}
n times
is equivalent
to
n times
{
}
n times
Main eorem.
A forest language is definable in ∆2 iff
the following holds for all sufficiently large n
is criterion is decidable.
We also have variants of the theorem for
unordered
trees
/
forests.
if
is a piece of
, then
n times
{
}
n times
is equivalent
to
n times
{
}
n times
Application.
e set of binary trees (every node has zero or two children)
is not definable in ∆2
is confused with
Big project: understand the
expressive power of first-order
logic on trees.
Big project: understand the
expressive power of first-order
logic on trees.
regular
languages
F O(≤)
Big project: understand the
expressive power of first-order
logic on trees.
Σ1 (≤)
regular
languages
F O(≤)
Π1 (≤)
Big project: understand the
expressive power of first-order
logic on trees.
Easy excercise
regular
languages
Σ1 (≤)
F O(≤)
Π1 (≤)
Big project: understand the
expressive power of first-order
logic on trees.
F O(≤)
Bool(Σ1 (≤))
Easy excercise
regular
languages
Σ1 (≤)
Π1 (≤)
Big project: understand the
expressive power of first-order
logic on trees.
F O(≤)
BSS LICS 
Bool(Σ1 (≤))
Easy excercise
regular
languages
Σ1 (≤)
Π1 (≤)
Big project: understand the
expressive power of first-order
logic on trees.
F O(≤)
Σ2 (≤)
BSS LICS 
Bool(Σ1 (≤))
Easy excercise
regular
languages
Σ1 (≤)
Π1 (≤)
Π2 (≤)
∆2 (≤)
Big project: understand the
expressive power of first-order
logic on trees.
F O(≤)
Σ2 (≤)
BSS LICS 
Bool(Σ1 (≤))
this paper
Easy excercise
regular
languages
Σ1 (≤)
Π1 (≤)
Π2 (≤)
∆2 (≤)
Big project: understand the
expressive power of first-order
logic on trees.
F O(≤) =?
Σ2 (≤) =?
BSS LICS 
Bool(Σ1 (≤))
this paper
Easy excercise
regular
languages
Σ1 (≤)
Π1 (≤)
Π2 (≤) =?
∆2 (≤)