1 / 39

Basics of automata theory

Basics of automata theory. Nondeterministic Finite Automata (NFA) Nondeterministic Finite Automata on infinite words (NFW). Nondeterministic finite automaton (NFA). S0. S1. A. A. A,B. Transitions: (S0,A,S0), (S0,B,S0), (S0,A,S1),(S1,A,S1). What is the language of this automaton?

sdeleo
Download Presentation

Basics of automata theory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Basics of automata theory Nondeterministic Finite Automata (NFA) Nondeterministic Finite Automata on infinite words (NFW)

  2. Nondeterministic finite automaton (NFA) S0 S1 A A A,B • Transitions: (S0,A,S0), (S0,B,S0), (S0,A,S1),(S1,A,S1). • What is the language of this automaton? • All words that have a path to an accepting state.

  3. Equivalent deterministic automaton S0 S1 A A A,B A S0 S0,S1 A B B • Every NFA can be transformed to DFA. How ? • The price may be exponential.

  4. Determinization • Let M = (S, Σ, , I, F) be an NFA. • Define a DFA Md = (Sd, Σd, d, Id, Fd), where • Sd = P(S) // power-set of S • Σd = Σ • Id = I • d(q, a) = { (r,a) | r 2 q} for all q2 Sd, a 2 Σ • Fd = {q | q 2 Sd ∧ q ∩ F ≠ ;}

  5. Example A,B B S0 S1 A A A,B • Sd = {}{S0}{S1}{S0,S1} • d =  = {A,B} • Id = I = {S0} • d= ... • FD = {S1}{S0,S1} A S0 S1 B B A S0,S1 A

  6. Example 2 B A A A 1 0 2 A,B B Complete it yourself  0 1 2 01 02 12 012

  7. Example 2 B A B 1 A B A B 01 02 A A A 1 0 2 A,B B A,B B 0 2 A B 12 B A 012 A

  8. Few important questions (1) • Given two automata A1, A2... • How do we build an automaton A3 such thatL(A3) = L(A1) ÅL(A2) • A method to build A3: compute the product A1£ A2 • We already saw how to compute a product...

  9. Product of two NFA-s (finite words) • A1=h, S1, , I1, F1i and A2= h, S2, 2, I2, F2i • A1£ A2 = • Each state is a pair (s,t): s 2 S1 and t 2 S2. • Initial states: pairs (s,t) such that s 2 I1 and t 2 I2. • Accepting states: pairs (s,t) such that s 2 F1 and t 2 F2 • ((s,t) a (s’,t’)) is a transition if (s,a,s’) 21, and (t,a,t’) 22. Reminder

  10. Example – product of two automata b a s0 s1 b a a t0 t1 b L(A1) = (a+b)*a +  (words ending with ‘a’ + empty word) A1: L(A2) = (ba)* + (ba)*b A2: What should be the language ofA1£ A2 ?

  11. Example – product of two automata b a s0 s1 b a a t0 t1 b A1: A2: • States: (s0,t0), (s0,t1), (s1,t0), (s1,t1). • Initial state: (s0,t0). • Accepting states: (s0,t0), (s0,t1). A1£ A2:

  12. Example – product of two automata b a s0 s1 b a a t0 t1 b A1: A2: s0,t0 a s1,t0 A1£ A2: s0,t1 b a b s1,t1 L(A1£ A2) = (ba)*

  13. Example 2 – product of two automata a t0 t1 b a s0 L(A1) = (ab)* + (ab)*a (words that alternate between a and b ) s1 A1: b A2: L(A2) = (ba)* + (ba)*b (words that alternate between b and a) What should be the language of A1Å A2 ?

  14. Example 2 – product of two automata a s0 s1 A1: b a t0 t1 A2: b • States: (s0,t0), (s0,t1), (s1,t0), (s1,t1). • Initial state: (s1,t0). • Accepting states: (s0,t0), (s0,t1), (s1,t0), (s1,t1). A1Å A2:

  15. Example 2 – product of two automata a s0 s1 A1: b a t0 t1 A2: b s0,t0 s1,t0 A1Å A2: s0,t1 b a s1,t1 L(A1Å A2) = e

  16. Few important questions (2) • Given a DFA A: • How do we construct A’ such that L(A’) = * - L(A) • In other words, how do we build an automaton that accepts exactly those words that are rejected by A ? • Answer: compute the complement automaton. • How ? Let F’ = S – F. (i.e., substitute accepting and non-accepting states.)

  17. Example: complementation b b a a s0 s0 s1 s1 b b a a • The complementation of A is denoted by

  18. Few important questions (3) • Given an automaton A: • Universality: is L(A) = * ? • Emptiness: is L(A) = ;? • Emptiness: is an accepting state reachable? • Universality: check whether

  19. And now.... • ... Automata on infinite words • These are called !-automata

  20. Automata over infinite words (DFW / NFW) a S0 S1 b a b • Similar definition. • Runs on infinite words over . • Accepts when an accepting state occurs infinitely often in the computation. • This is called a Buchi automaton

  21. Automata over infinite words (DFW) a S0 S1 b a b • Formally, let F be the set of accepting states. • Let inf() µ S be the set of states appearing infinite number of times in a computation . •  is accepted by the automaton if inf() Å F ;.

  22. Automata over infinite words (DFW) a S0 S1 b a b • Consider the word a b a b a b a b… • The computation is S0 S0 S1 S0 S1 S0 S1… • This computation is accepting, since S0 appears infinitely many times.

  23. Other computations a S0 S1 b a b • For the word b b b b b… the computation is S0 S1 S1 S1 S1… and is not accepting. • For the word a a a b b b b b…, thecomputation is S0 S0 S0 S0 S1 S1 S1 S1…and ... (?) • What is the computation for a b a b b a b b b…? Is it accepting ?

  24. The language of a Buchi automaton a S0 S1 b B = a b • The language of a Buchi automaton is the set of infinite strings that are accepted by it. • Such languages are called !– languages. • Buchi automaton defines !– regular languages. • L(B) = (ab*)!

  25. NonDeterministic Buchi automata (NFW) B = S1 S0 a b a • As before, a string is accepted if there exists an accepting run. • L(B) = aa*b! • Surprise: there is no determinization procedure • We will focus on DFW

  26. Why do we need Buchi automata ? -a  a a -a a a -a • The compilation theorem: every LTL formula  can be translated to a Buchi automaton B that accepts the same language as . Fa Ga GFa

  27. What about the other direction ? a “a holds on every even step” • Can every Buchi automata be translated to an LTL formula ? • No LTL formula can express this property.

  28. About the alphabet... a,b b a :a,:b a,b a a,:b a b :a,b b • So far a 2 ∑ meant that a is some atom (a,b...) from a given set AP. • We will also use a 22AP • This is useful for representing states • (cont’d on next slide) (same thing, only write positive literals)

  29. About the alphabet... a,:b :a, :b :a, b :a, b aÇ:b :a Æb a Æ b :a Æ:b :a, b a,b a Ç b :aÆb Ç aÆ:b • ... or even a 2 22AP • This can give us a more compact representaiton

  30. About the alphabet... • A Buchi automaton can also be represented with labels on states. • There is 1-1 translation to a Buchi automaton with labels on transitions: • Move labels to outgoing edges.

  31. About the alphabet... • From labels on states to labels on transitions: Example. • Let ∑µ2AP Recall that this is {p,q} p,q  p,q p  p p

  32. For Buchi automata B1, B2: Again, important questions... • How to compute L(B1) ÅL(B2) ? • How to complement ? • Find B’s.t. • How to check for emptiness ? • Is L(B) = ; ?

  33. Intersecting two Buchi automata (infinite words) a b s0 s1 b a b a t0 t1 a b • Previous method doesn’t work: Infinite a’s Infinite b’s s0, t0 s1, t1 Empty language ! b a a a b s0, t1 s1, t0 b

  34. Intersecting two Buchi automata (infinite words) • The reason: a path should be accepted if it fulfills two separate acceptance conditions: • passes infinitely many times through s0 • passes infinitely many times through t0 • An automaton has such multiple acceptance conditions is called a generalized Buchi automata. • We will learn about this later on. • For now, we will see a reduction of this condition to a standard Buchi automaton. s0, t0 s1, t1 Empty language ! b a a a b s0, t1 s1, t0 b

  35. Intersecting two Buchi automata (infinite words) • Strategy: • “Multiply” the product automaton by 3(S = S1 £ S2 £ {0,1,2} ) • Start from the ‘0’ copy. • Transition to the ‘1’ copy when entering a state from F1 • Transition to the ‘2’ copy if in a ‘1’ state and entering a state from F2, and in the next state back to a ‘0’ state. • Make the ‘2’ copy an accepting set.

  36. s0, t0 s1, t1 b a 0 a a b s0, t1 s1, t0 b s0, t0 s1, t1 b a 1 a a b s0, t1 s1, t0 b s0, t0 s1, t1 b 2 a a a b s0, t1 s1, t0 b

  37. s0, t0 b a a 0 a a b s0, t1 s1, t0 b a s0, t0 b a 1 a a b s0, t1 s1, t0 b b b s0, t0 b 2 a a a b s0, t1 s1, t0 b simplify by removing unreachable states

  38. s0, t0 b a 0 a b s0, t1 s1, t0 b a b a b 1 a a s0, t1 s1, t0 a a b b 2 a a b s0, t1 s1, t0 b simplify by removing unreachable states

  39. Intersecting two Buchi automata (infinite words) a b s0 s1 b a b a t0 t1 a b There are total of 12 states in the product automaton. The reachable part of A1Å A2 is: h s0,t0,0 i b a h s1,t0,0 i h s0,t1,1 i a b a b b a b a a h s1,t0,2 i h s0,t1,0 i

More Related