Unambiguous Finite Automata
Christof LodingDepartment of Computer Science
RWTH Aachen University, Germany
17th International Conference onDevelopments in Language Theory
Paris-Est, June 20, 2013
Unambiguous Finite Automata · DLT 2013, Paris 1
Unambiguous Automata
Definition: A nondeterministic automaton is called unambiguous iffor each word there is at most one accepting run from an initialstate.
determinism
unambiguity
nondeterminism
big automata
inclusion, equivalence, universality are easy
small automatainclusion, equivalence, universality are hard
Unambiguous Finite Automata · DLT 2013, Paris 2
In this talk
Unambiguous automata on finite words and trees have alreadybeen investigated a lot.
This talk: Present some results and open problems concerningunambiguous automata on infinite words and trees.
finite words finite trees
infinite words infinite trees
Unambiguous Finite Automata · DLT 2013, Paris 3
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 4
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 5
Unambiguous automata on finite words
• On finite words, deterministic automata are as expressive asnondeterministic ones. Therefore each regular language canbe accepted by an unambiguous automaton.
• Unambiguous automata can be exponentially more succinctthan deterministic ones.
q0 p1 p2 · · · pn
a, b
a a, b a, b a, b
Unambiguous Finite Automata · DLT 2013, Paris 6
Decision Problems
Theorem (Meyer/Stockmeyer’72)
The problems of universality, equivalence, and inclusion for NFAsare PSPACE-hard.
Theorem (Stearns/Hunt’85)
The problems of universality, equivalence, and inclusion forunambiguous finite automata are in PTIME.
(Can also be derived from earlier results of Schutzenberger)
Unambiguous Finite Automata · DLT 2013, Paris 7
Counting Accepting Runs
Idea for the PTIME inclusion algorithm:
• Problem: test if L(A) ⊆ L(B) for given automata A and B
• Consider A∩ B (product construction), which is againunambiguous:• L(A∩ B) ⊆ L(A)• L(A) ⊆ L(B) ⇔ L(A∩ B) = L(A)
L(A) L(B) L(A) L(B)
Unambiguous Finite Automata · DLT 2013, Paris 8
Counting Accepting Runs
Idea for the PTIME inclusion algorithm:
• Problem: test if L(A) ⊆ L(B) for given automata A and B
• Consider A∩ B (product construction), which is againunambiguous:• L(A∩ B) ⊆ L(A)• L(A) ⊆ L(B) ⇔ L(A∩ B) = L(A)
• If for each length n, the number of accepting runs of length n isthe same in A∩ B and A, then L(A ∩ B) = L(A):• computing the number of accepting runs of increasing length is
easy (dynamic programming)• if the equality holds for runs up to length |A| · |B|, then it holds
for all lengths
Unambiguous Finite Automata · DLT 2013, Paris 8
Finite Trees
The results can be extended to finite trees.
Theorem (Seidl’90)
The problems of universality, equivalence, and inclusion forunambiguous finite automata on ranked trees are in PTIME.
Unambiguous Finite Automata · DLT 2013, Paris 9
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 10
Buchi Automata
q0 q1
ab
b
a
p0 p1
aa
b
b
Buchi automaton:
• same syntax as nondeterministic finite automata (NFAs)
• accepts all infinite words that admit a run visiting infinitely oftena final state
Most decision problems for B uchi automata are at least ashard as for NFAs
Unambiguous Finite Automata · DLT 2013, Paris 11
Unambiguous Buchi Automata Always Exist
Deterministic Buchi automata are weaker than nondeterministicones.
A nondeterministic Buchi automaton for “finitely many b”:
q0 q1
a, b
a
a
Unambiguous Finite Automata · DLT 2013, Paris 12
Unambiguous Buchi Automata Always Exist
Deterministic Buchi automata are weaker than nondeterministicones.
A nondeterministic Buchi automaton for “finitely many b”:
q0 q1
a, b
a
a
Theorem (Arnold’83)
For each Buchi automaton there is an equivalent unambiguousBuchi automaton.
What about algorithmic properties of unambiguous Buchiautomata?
Unambiguous Finite Automata · DLT 2013, Paris 12
Methods from Finite Case do not Generalize
• Runs in a Buchi automaton are infinite, counting runs up to acertain length does not work.
• But: Regular languages of infinite words can be characterizedusing finite words: ultimately periodic words.
• Can this be used to lift the methods from the finite case?
Unambiguous Finite Automata · DLT 2013, Paris 13
Ultimately Periodic Words
Definition: An infinite word is called ultimately periodic if it is of theform uvω = uvvvvv · · · for finite words u, v.
Examples:
• aabaabaabaabaab · · · = a(aba)ω = aa(baa)ω
• aba bb︸︷︷︸
2
a bbb︸︷︷︸
3
a bbbb︸︷︷︸
4
a bbbbb︸ ︷︷ ︸
5
a · · · is not ultimately periodic
Unambiguous Finite Automata · DLT 2013, Paris 14
Ultimately Periodic Words
Definition: An infinite word is called ultimately periodic if it is of theform uvω = uvvvvv · · · for finite words u, v.
Examples:
• aabaabaabaabaab · · · = a(aba)ω = aa(baa)ω
• aba bb︸︷︷︸
2
a bbb︸︷︷︸
3
a bbbb︸︷︷︸
4
a bbbbb︸ ︷︷ ︸
5
a · · · is not ultimately periodic
Theorem (Buchi’62)
Two Buchi automata are equivalent if, and only if, they accept thesame ultimately periodic words. For inclusion the correspondingresult holds.
Can we count runs for ultimately periodic words?
Unambiguous Finite Automata · DLT 2013, Paris 14
Unambiguous Buchi Automata
Problems when trying to lift the counting method:
Decompositions of ultimately periodic words are not unique:
aa a
a
a
a
Unambiguous Finite Automata · DLT 2013, Paris 15
Unambiguous Buchi Automata
Problems when trying to lift the counting method:
Decompositions of ultimately periodic words are not unique:
aa a
a
a
a
Working with ultimately periodic words is difficult, even fordeterministic automata:
Proposition (Bousquet/L.2010)
Deciding whether a given deterministic Buchi automaton acceptsan ultimately periodic word with period of length n for given n isNP-hard.
Unambiguous Finite Automata · DLT 2013, Paris 15
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 16
Strong Unambiguity
Definition: A Buchi automaton is called strongly unambiguous if foreach word there is at most one state from which it is accepted.
Remark 1 : Determinism does not imply strong unambiguity:
q0 q1a
a, b
Unambiguous Finite Automata · DLT 2013, Paris 17
Strong Unambiguity
Definition: A Buchi automaton is called strongly unambiguous if foreach word there is at most one state from which it is accepted.
Remark 1 : Determinism does not imply strong unambiguity:
q0 q1a
a, b
p0 p1
aa
b
b
Unambiguous Finite Automata · DLT 2013, Paris 17
Strong Unambiguity
Definition: A Buchi automaton is called strongly unambiguous if foreach word there is at most one state from which it is accepted.
Remark 1 : Determinism does not imply strong unambiguity:
q0 q1a
a, b
p0 p1
aa
b
b
Remark 2 : Strong unambiguity implies unambiguity.· · ·
· · ·not unambiguous
Unambiguous Finite Automata · DLT 2013, Paris 17
Strong Unambiguity
Definition: A Buchi automaton is called strongly unambiguous if foreach word there is at most one state from which it is accepted.
Remark 1 : Determinism does not imply strong unambiguity:
q0 q1a
a, b
p0 p1
aa
b
b
Remark 2 : Strong unambiguity implies unambiguity.· · ·
· · ·not unambiguous
not strongly unambiguous
Unambiguous Finite Automata · DLT 2013, Paris 17
Overview
determinism strong unambiguity
unambiguity
nondeterminism
Unambiguous Finite Automata · DLT 2013, Paris 18
Overview
determinism strong unambiguity
unambiguity
nondeterminism
Theorem (Carton, Michel 2003)
For every nondeterministic Buchi automaton there is an equivalentstrongly unambiguous Buchi automaton.
Unambiguous Finite Automata · DLT 2013, Paris 18
Reduction to finite words
Theorem (Bousquet/L. 2010)
There is a polynomial time reduction from the equivalence (resp.inclusion) problem for strongly unambiguous Buchi automata to theequivalence (resp. inclusion) problem for unambiguous automataon finite words.
Unambiguous Finite Automata · DLT 2013, Paris 19
Reduction to finite words
Theorem (Bousquet/L. 2010)
There is a polynomial time reduction from the equivalence (resp.inclusion) problem for strongly unambiguous Buchi automata to theequivalence (resp. inclusion) problem for unambiguous automataon finite words.
Proof steps : for a strongly unambiguous Buchi automaton A
• ultimately periodic words uvω are accepted with short loops:u
vu v
v
Unambiguous Finite Automata · DLT 2013, Paris 19
Reduction to finite words
Theorem (Bousquet/L. 2010)
There is a polynomial time reduction from the equivalence (resp.inclusion) problem for strongly unambiguous Buchi automata to theequivalence (resp. inclusion) problem for unambiguous automataon finite words.
Proof steps : for a strongly unambiguous Buchi automaton A
• ultimately periodic words uvω are accepted with short loops:u
vu v
v
• construct polynomial size unambiguous NFA A′ such thatuvω is accepted by A iff u#v is accepted by A′
uv
u # v
Unambiguous Finite Automata · DLT 2013, Paris 19
Reduction to finite words
Theorem (Bousquet/L. 2010)
There is a polynomial time reduction from the equivalence (resp.inclusion) problem for strongly unambiguous Buchi automata to theequivalence (resp. inclusion) problem for unambiguous automataon finite words.
Corollary
The equivalence and inclusion problems for strongly unambiguousBuchi automata are in PTIME.
Unambiguous Finite Automata · DLT 2013, Paris 19
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 20
Safety and reachability automata
Safety automata: Buchi automata inwhich all states are accepting, excepta rejecting sink state (usually omit-ted):
0
1
2
3
a
a
a
a
b
b
b
b
Reachability automata: Buchi auto-mata in which all states are rejecting,except one accepting sink state:
0
1 2
3
4 5
6
b
a
c
a
b
b
b
a
c
c
c
a, b
a, b, c
Unambiguous Finite Automata · DLT 2013, Paris 21
Result on safety an reachability automata
Theorem (Isaak/L. 2012)
For unambiguous safety and reachability automata the problems ofinclusion, equivalence, and universality can be solved in polynomialtime.
Unambiguous Finite Automata · DLT 2013, Paris 22
A simple case: universality of safety automata
Let A be an unambiguous safety automaton.
Observation: A accepts all infinite words iff A considered as NFAaccepts all finite words.
But: A considered as NFA needs not to be unambiguous.
qaa
qab
qba
qbb
a
a
a
a
b
b
b
b
Unambiguous Finite Automata · DLT 2013, Paris 23
A simple case: universality of safety automata
Let A be an unambiguous safety automaton.
Observation: A accepts all infinite words iff A considered as NFAaccepts all finite words.
But: A considered as NFA needs not to be unambiguous.
qaa
qab
qba
qbb
a
a
a
a
b
b
b
b
Solution:
• Pick some infinite word, say aω.
• Declare those states final, fromwhich aω is accepted.
• The resulting NFA is unambiguousand accepts all finite words iff Aaccepts all infinite words.
Unambiguous Finite Automata · DLT 2013, Paris 23
A simple case: universality of safety automata
Let A be an unambiguous safety automaton.
Observation: A accepts all infinite words iff A considered as NFAaccepts all finite words.
But: A considered as NFA needs not to be unambiguous.
qaa
qab
qba
qbb
a
a
a
a
b
b
b
b
Solution:
• Pick some infinite word, say aω.
• Declare those states final, fromwhich aω is accepted.
• The resulting NFA is unambiguousand accepts all finite words iff Aaccepts all infinite words.
Unambiguous Finite Automata · DLT 2013, Paris 23
Reachability automata
For reachability automata A the situation is dual:
• A considered as NFA is unambiguous if A is unambiguous.• However, language inclusion or equivalence is not preserved
when considering the automata as NFAs.
0 1a
a, b, c
0
1 2
3
4 5
6
b
a
c
a
b
b
b
a
c
c
c
a, b
a, b, c
Unambiguous Finite Automata · DLT 2013, Paris 24
Reachability automata
For reachability automata A the situation is dual:
• A considered as NFA is unambiguous if A is unambiguous.• However, language inclusion or equivalence is not preserved
when considering the automata as NFAs.
0 1a
a, b, c
0
1 2
3
4 5
6
b
a
c
a
b
b
b
a
c
c
c
a, b
a, b, c
As for safety automata, a reduction to the finite word case can beachieved (basically) by recomputing the set of final states.
Unambiguous Finite Automata · DLT 2013, Paris 24
The general case
Question: What is the complexity of inclusion, equivalence,universality for the full class of unambiguous Buchi automata?
The methods developed so far do not seem to generalize.
Unambiguous Finite Automata · DLT 2013, Paris 25
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 26
Automata on infinite trees
• Automata A = (Q, Σ, q0, ∆, Acc) on infinite binary trees
• Transitions of the form (q, a, q′, q′′)
Run of A : b
a
b
a a
b
a a
b
b
b a
b
a a...
Unambiguous Finite Automata · DLT 2013, Paris 27
Automata on infinite trees
• Automata A = (Q, Σ, q0, ∆, Acc) on infinite binary trees
• Transitions of the form (q, a, q′, q′′)
Run of A : bq0
a
b
a a
b
a a
b
b
b a
b
a a...
Unambiguous Finite Automata · DLT 2013, Paris 27
Automata on infinite trees
• Automata A = (Q, Σ, q0, ∆, Acc) on infinite binary trees
• Transitions of the form (q, a, q′, q′′)
Run of A : bq0
(q0, b, q1, q2) ∈ ∆
aq1
b
a a
b
a a
bq2
b
b a
b
a a...
Unambiguous Finite Automata · DLT 2013, Paris 27
Automata on infinite trees
• Automata A = (Q, Σ, q0, ∆, Acc) on infinite binary trees
• Transitions of the form (q, a, q′, q′′)
Run of A : bq0
(q0, b, q1, q2) ∈ ∆
aq1
(q1, a, q3, q4) ∈ ∆
bq3
a a
bq4
a a
bq2
b
b a
b
a a...
Unambiguous Finite Automata · DLT 2013, Paris 27
Automata on infinite trees
• Automata A = (Q, Σ, q0, ∆, Acc) on infinite binary trees
• Transitions of the form (q, a, q′, q′′)
Run of A : bq0
(q0, b, q1, q2) ∈ ∆
aq1
(q1, a, q3, q4) ∈ ∆
bq3
a a
bq4
a a
bq2
(q2, b, q5, q6) ∈ ∆
bq5
b a
bq6
a a...
Unambiguous Finite Automata · DLT 2013, Paris 27
Automata on infinite trees
• Automata A = (Q, Σ, q0, ∆, Acc) on infinite binary trees
• Transitions of the form (q, a, q′, q′′)
Run of A : bq0
(q0, b, q1, q2) ∈ ∆
aq1
(q1, a, q3, q4) ∈ ∆
bq3
a a
bq4
a a
bq2
(q2, b, q5, q6) ∈ ∆
bq5
b a
bq6
a a...
• Acc ⊆ Qω (conditions as for automata on infinite words can beused)
• Run accepting if state sequence on each path is in Acc.
Unambiguous Finite Automata · DLT 2013, Paris 27
Example
The set Ta of all trees t over {a, b} such that t contains at least onenode labeled a:
• States: qa that nondeterministically searches for an a,q for the rest of the tree
• Initial state: qa
• Transitions: (qa, b, qa, q) (qa, b, q, qa) (qa, a, q, q)
• Acceptance: on each path finally only q.
Nondeterminism is required for this language.
Unambiguous Finite Automata · DLT 2013, Paris 28
Ambiguous languages
Theorem (Carayol/L./Niwinski/Walukiewicz 2010)
There are languages of infinite trees that can be accepted by anondeterministic automaton but not by an unambiguous automaton.The language Ta is such a language.
Proof idea:
• An automaton for Ta can be modified, such that it marks ineach accepting run exactly one a (by a special state, say).
• An unambiguous automaton could thus be turned into anautomaton choosing for each tree in Ta exactly one a.
• Such a “choice automaton” cannot exist (Gurevich/Shelah’83,Carayol/L./Niwinski/Walukiewicz 2010)
Unambiguous Finite Automata · DLT 2013, Paris 29
The counterexamplesb 1
b0
· · ·b
b0
0
b1
b 0
· · ·b
b0
0
b1
...
b0
b1
b0
· · ·b
b0
0
a1
0,1 a = (0N0∗1)N
TN = unravelling of this graph
Unambiguous Finite Automata · DLT 2013, Paris 30
The counterexamplesb 1
b0
· · ·b
b0
0
b1
b 0
· · ·b
b0
0
b1
...
b0
b1
b0
· · ·b
b0
0
a1
0,1 a = (0N0∗1)N
TN = unravelling of this graph
Theorem (CLNW’10) For each auto-maton A there exists N such that Afails to choose a unique a on TN.
Unambiguous Finite Automata · DLT 2013, Paris 30
Deciding unambiguity
The result on inherently ambiguous languages of infinite treesraises a new question:
Is it decidable whether a given regular language of infinite trees canbe accepted by an unambiguous automaton?
Unambiguous Finite Automata · DLT 2013, Paris 31
Deciding unambiguity
The result on inherently ambiguous languages of infinite treesraises a new question:
Is it decidable whether a given regular language of infinite trees canbe accepted by an unambiguous automaton?
Recent partial results (Bilkowski/Skrzypczak’13):
• It is decidable for a deterministic tree automaton whether itscomplement is unambiguous.
• Bi-unambiguity (unambiguity of a language and itscomplement) is decidable if a certain conjecture on definabilityof choice functions on infinite trees is true.
Unambiguous Finite Automata · DLT 2013, Paris 31
Outline
1 Finite Words (and Trees)
2 Infinite Words
Strongly unambiguous Buchi automata
Safety and reachability automata
3 Infinite Trees
4 Conclusion
Unambiguous Finite Automata · DLT 2013, Paris 32
Conclusion
finite words finite trees
infinite words infinite trees
Two central open questions:
• What is the complexity of universality, equivalence, inclusiontesting for unambiguous Buchi automata?
• Is it decidable for a given language of infinite trees whetherthere is an unambiguous automaton for this language?
Unambiguous Finite Automata · DLT 2013, Paris 33