Automata for Real-time Systems
B. Srivathsan
Chennai Mathematical Institute
Lecture 2:
Timed languages and timed
automata
L5:={(abcd.Σ∗, τ )|τ3−τ1 ≤2 andτ4−τ2 ≥5}
Interleaving distances
0 1 2 3 4 5 6 7
a b c d
q0 a q1 q2 q3 q4
{x}
b {y}
x≤1,c y≥5,d Σ
Exercise:Prove thatL5cannot be accepted by a one-clock TA.
ninterleavings⇒neednclocks
n+1 clocks more expressive thannclocks
{(ak, τ)|τi+2−τi≤1 for alli≤k−2}
q0 q1 q2
a {x}
a,y≤1
a,x≤1 {y} {x}
{(ak, τ)|τi+2−τi≤1 for alli≤k−2}
q0 q1 q2
a {x}
a,y≤1
a,x≤1 {y}
{x}
Timed automata
Runs
1 clock<2 clocks< . . .
L6:={(ak, τ )|τiis some integer for eachi}
0 1 2 3 4 5 6 7
a a a
Claim: No timed automatoncan acceptL6
L6:={(ak, τ )|τiis some integer for eachi}
0 1 2 3 4 5 6 7
a a a
Claim: No timed automatoncan acceptL6
Step 1: SupposeL6=L(A)
Letcmaxbe the maximum constant appearing in a guard ofA
Step 2: For a clockx, x=dcmaxe+1 and x=dcmaxe+1.1
satisfy the same guards
Step 3: (a; dcmaxe+1)∈L6and soAhas an accepting run (q0,v0)−−−−−−−−−→δ=dcmaxe+1 (q0,v0+δ)−→a (qF,vF)
Step 4: By Step 2, the following is an accepting run (q0,v0) δ
0=dcmaxe+1.1
−−−−−−−−−−→(q0,v0+δ0)−→a (qF,v0F) Hence(a; dcmaxe+1.1)∈L(A)6=L6
Thereforeno timed automatoncan acceptL6
Step 1: SupposeL6=L(A)
Letcmaxbe the maximum constant appearing in a guard ofA Step 2: For a clockx,
x=dcmaxe+1 and x=dcmaxe+1.1 satisfy the same guards
Step 3: (a; dcmaxe+1)∈L6and soAhas an accepting run (q0,v0)−−−−−−−−−→δ=dcmaxe+1 (q0,v0+δ)−→a (qF,vF)
Step 4: By Step 2, the following is an accepting run (q0,v0) δ
0=dcmaxe+1.1
−−−−−−−−−−→(q0,v0+δ0)−→a (qF,v0F) Hence(a; dcmaxe+1.1)∈L(A)6=L6
Thereforeno timed automatoncan acceptL6
Step 1: SupposeL6=L(A)
Letcmaxbe the maximum constant appearing in a guard ofA Step 2: For a clockx,
x=dcmaxe+1 and x=dcmaxe+1.1 satisfy the same guards
Step 3: (a; dcmaxe+1)∈L6and soAhas an accepting run (q0,v0)−−−−−−−−−→δ=dcmaxe+1 (q0,v0+δ)−→a (qF,vF)
Step 4: By Step 2, the following is an accepting run (q0,v0) δ
0=dcmaxe+1.1
−−−−−−−−−−→(q0,v0+δ0)−→a (qF,v0F) Hence(a; dcmaxe+1.1)∈L(A)6=L6
Thereforeno timed automatoncan acceptL6
Step 1: SupposeL6=L(A)
Letcmaxbe the maximum constant appearing in a guard ofA Step 2: For a clockx,
x=dcmaxe+1 and x=dcmaxe+1.1 satisfy the same guards
Step 3: (a; dcmaxe+1)∈L6and soAhas an accepting run (q0,v0)−−−−−−−−−→δ=dcmaxe+1 (q0,v0+δ)−→a (qF,vF)
Step 4: By Step 2, the following is an accepting run (q0,v0) δ
0=dcmaxe+1.1
−−−−−−−−−−→(q0,v0+δ0)−→a (qF,v0F)
Hence(a; dcmaxe+1.1)∈L(A)6=L6
Thereforeno timed automatoncan acceptL6
Step 1: SupposeL6=L(A)
Letcmaxbe the maximum constant appearing in a guard ofA Step 2: For a clockx,
x=dcmaxe+1 and x=dcmaxe+1.1 satisfy the same guards
Step 3: (a; dcmaxe+1)∈L6and soAhas an accepting run (q0,v0)−−−−−−−−−→δ=dcmaxe+1 (q0,v0+δ)−→a (qF,vF)
Step 4: By Step 2, the following is an accepting run (q0,v0) δ
0=dcmaxe+1.1
−−−−−−−−−−→(q0,v0+δ0)−→a (qF,v0F) Hence(a; dcmaxe+1.1)∈L(A)6=L6
Thereforeno timed automatoncan acceptL6
L7={( (ab)k, τ )|τ2i+2−τ2i+1< τ2i−τ2i−1for eachi ≥1}
Convergingabdistances
0 1 2 3 4 5 6 7
a b a b a b
Exercise:Prove thatno timed automatoncan acceptL7
L7={( (ab)k, τ )|τ2i+2−τ2i+1< τ2i−τ2i−1for eachi ≥1}
Convergingabdistances
0 1 2 3 4 5 6 7
a b a b a b
Exercise:Prove thatno timed automatoncan acceptL7
L7={( (ab)k, τ )|τ2i=i and τ2i+2−τ2i+1 < τ2i−τ2i−1}
Pivoted convergingabdistances
>1
0 1 2 3 4
b b b b
a a a a
τ2i+2−τ2i+1<τ2i−τ2i−1 ⇔ τ2i+2−τ2i<τ2i+1−τ2i−1
⇔ 1<τ2i+1−τ2i−1
q0 a q1 q2
{x}
y=1,b {y} x>1,a
{x}
L7={( (ab)k, τ )|τ2i=i and τ2i+2−τ2i+1 < τ2i−τ2i−1}
Pivoted convergingabdistances
>1
0 1 2 3 4
b b b b
a a a a
τ2i+2−τ2i+1<τ2i−τ2i−1 ⇔ τ2i+2−τ2i<τ2i+1−τ2i−1
⇔ 1<τ2i+1−τ2i−1
q0 a q1 q2
{x}
y=1,b {y} x>1,a
{x}
L7={( (ab)k, τ )|τ2i=i and τ2i+2−τ2i+1 < τ2i−τ2i−1}
Pivoted convergingabdistances
>1
0 1 2 3 4
b b b b
a a a a
τ2i+2−τ2i+1<τ2i−τ2i−1 ⇔ τ2i+2−τ2i<τ2i+1−τ2i−1
⇔ 1<τ2i+1−τ2i−1
q0 a q1 q2
{x}
y=1,b {y} x>1,a
{x}
L7={( (ab)k, τ )|τ2i=i and τ2i+2−τ2i+1 < τ2i−τ2i−1}
Pivoted convergingabdistances
>1
0 1 2 3 4
b b b b
a a a a
τ2i+2−τ2i+1<τ2i−τ2i−1 ⇔ τ2i+2−τ2i<τ2i+1−τ2i−1
⇔ 1<τ2i+1−τ2i−1
q0 a q1 q2
{x}
y=1,b {y}
x>1,a {x}
Timed automata
Runs
1 clock<2 clocks< . . . Role of max constant
Timed regular lngs.
Timed automata
Runs
1 clock<2 clocks< . . . Role of max constant
Timed regular lngs.
Timed regular languages
Timed languages
L06=L(A)
Timed regular languages L=L(A)
L0
L
Definition
A timed language is calledtimed regularif it can beacceptedby a timed automaton
L=L(A)
L
L0 L0=L(A0)
L∪L0
L∪L0=L(A∪)
A= (Q,Σ,X,T,Q0,F) A0= (Q0,Σ,X0,T0,Q00,F0)
A∪= (Q∪Q0, Σ, X∪X0, T∪T0, Q0∪Q00, F∪F0) L(A)∪ L(A0) =L(A∪)
Timed regular languages areclosedunderunion
L=L(A)
L
L0 L0=L(A0)
L∩L0
L∩L0=L(A∩)
A= (Q,Σ,X,T,Q0,F) A0= (Q0,Σ,X0,T0,Q00,F0) A∩= (Q×Q0, Σ, X∪X0, T∩, Q0×Q00, F ×F0)
T∩: (q1,q01) a,g∧g
0
−−−−−−−→(q2,q20)if
R∪R0
q1 a,g
−−−−→q2∈T and q01 a,g
0
−−−−→q02∈T0
R R0
L : a timed language overΣ Untime(L) ≡ {w∈Σ∗ | ∃τ.(w, τ)∈L}
Untiming construction
Forevery timedautomatonAthere is afinite automatonAus.t.
Untime(L(A) ) =L(Au)
more about this later. . .
Complementation
Σ :{a,b}
L = {(w, τ)| there is anaat some timetand no action occurs at timet+1}
L = {(w, τ)| everyahas an action at a distance 1 from it}
Claim: No timed automatoncan acceptL
Decision problems for timed automata: A survey
Alur, Madhusudhan.SFM’04: RT
Complementation
Σ :{a,b}
L = {(w, τ)| there is anaat some timetand no action occurs at timet+1}
L = {(w, τ)| everyahas an action at a distance 1 from it}
Claim: No timed automatoncan acceptL
Decision problems for timed automata: A survey
Alur, Madhusudhan.SFM’04: RT
Step 1: L = {(w, τ)| everyahas an action at a distance 1 from it} SupposeLis timed regular
Step 2: LetL0 = {(a∗b∗, τ)| alla’s occur before time 1 and no twoa’s happen at same time} ClearlyL0is timed regular
Step 3: Untime(L∩L0 )should be a regular language
Step 4: But, Untime(L∩L0) ={anbm|m≥n},not regular!
ThereforeLcannot be timed regular
Step 1: L = {(w, τ)| everyahas an action at a distance 1 from it} SupposeLis timed regular
Step 2: LetL0 = {(a∗b∗, τ)| alla’s occur before time 1 and no twoa’s happen at same time} ClearlyL0is timed regular
Step 3: Untime(L∩L0 )should be a regular language
Step 4: But, Untime(L∩L0) ={anbm|m≥n},not regular!
ThereforeLcannot be timed regular
Step 1: L = {(w, τ)| everyahas an action at a distance 1 from it} SupposeLis timed regular
Step 2: LetL0 = {(a∗b∗, τ)| alla’s occur before time 1 and no twoa’s happen at same time} ClearlyL0is timed regular
Step 3: Untime(L∩L0 )should be a regular language
Step 4: But, Untime(L∩L0) ={anbm|m≥n},not regular!
ThereforeLcannot be timed regular
Step 1: L = {(w, τ)| everyahas an action at a distance 1 from it} SupposeLis timed regular
Step 2: LetL0 = {(a∗b∗, τ)| alla’s occur before time 1 and no twoa’s happen at same time} ClearlyL0is timed regular
Step 3: Untime(L∩L0 )should be a regular language
Step 4: But, Untime(L∩L0 ) ={anbm|m≥n},not regular!
ThereforeLcannot be timed regular
Step 1: L = {(w, τ)| everyahas an action at a distance 1 from it} SupposeLis timed regular
Step 2: LetL0 = {(a∗b∗, τ)| alla’s occur before time 1 and no twoa’s happen at same time} ClearlyL0is timed regular
Step 3: Untime(L∩L0 )should be a regular language
Step 4: But, Untime(L∩L0 ) ={anbm|m≥n},not regular!
L
L
Timed regular languages arenot closedundercomplementation
Timed automata
Runs
1 clock<2 clocks< . . . Role of max constant
Timed regular lngs.
Closure under∪,∩
Non-closure under complement
ε -transitions
Timed automata
Runs
1 clock<2 clocks< . . . Role of max constant
Timed regular lngs.
Closure under∪,∩
Non-closure under complement
ε -transitions
L6:={(ak, τ )|τiis some integer for eachi}
ε ε ε ε
0 1 2 3 4 5 6 7
a a a
q0
x=1, ε, {x}
x=1,a,{x}
L6:={(ak, τ )|τiis some integer for eachi}
ε ε ε ε
0 1 2 3 4 5 6 7
a a a
q0
x=1, ε, {x}
x=1,a,{x}
Claim: No timed automatoncan acceptL6
L6:={(ak, τ )|τiis some integer for eachi}
ε ε ε ε
0 1 2 3 4 5 6 7
a a a
q0
x=1, ε, {x}
x=1,a,{x}
Claim: No timed automatoncan acceptL6
ε-transitions
ε-transitionsadd expressive powerto timed automata.
However, they add poweronlywhen a clock isresetin anε-transition.
Characterization of the expressive power of silent transitions in timed automata
Bérard, Diekert, Gastin, Petit.Fundamenta Informaticae’98
ε-transitions
ε-transitionsadd expressive powerto timed automata. However, they add poweronlywhen a clock isresetin anε-transition.
Characterization of the expressive power of silent transitions in timed automata
Bérard, Diekert, Gastin, Petit.Fundamenta Informaticae’98
Timed automata
Runs
1 clock<2 clocks< . . . Role of max constant
Timed regular lngs.
Closure under∪,∩
Non-closure under complement
ε -transitions
More expressive
−−→ε without reset≡TA
Recall...
Huge system Property
Higher-level description Higher-level description
AutomatonA AutomatonB
translation translation
Model-Checker
L(A)⊆ L(B)?
L(A)⊆ L(B) iff
L(A) ∩ L(B) =∅
non-closure under complement⇒the abovecannot be donefor TA!
L(A)⊆ L(B) iff
L(A) ∩ L(B) =∅
non-closure under complement⇒the abovecannot be donefor TA!
Course plan
Timed automaton
Emptiness L(A) =∅?
Inclusion L(A)⊆ L(B)?
Decidable Complexity Better algos
Undecidable Variations of TA for decidability
One-clock Alternation Event-clock, Integer reset L.1
L.2
L.3 L.4
L.5, L.6 L.7, L.8 L.9, L.10 L.11-12
L.13-18
Special topics
Diagonal constraints Infinite timed words Example from industry L.19
L.20-21 L.22
Course plan
Timed automaton
Emptiness L(A) =∅?
Inclusion L(A)⊆ L(B)?
Decidable Complexity Better algos
Undecidable Variations of TA for decidability
One-clock Alternation Event-clock, Integer reset L.1
L.2
L.3 L.4
L.5, L.6 L.7, L.8 L.9, L.10 L.11-12
L.13-18
Special topics
Diagonal constraints Infinite timed words Example from industry L.19
L.20-21 L.22