unit 5 regular properties
play

Unit-5: -regular properties B. Srivathsan Chennai Mathematical - PowerPoint PPT Presentation

Unit-5: -regular properties B. Srivathsan Chennai Mathematical Institute NPTEL-course July - November 2015 1 / 14 Module 2: -regular expressions 2 / 14 Languages over finite words = set of all words over : finite alphabet


  1. Unit-5: ω -regular properties B. Srivathsan Chennai Mathematical Institute NPTEL-course July - November 2015 1 / 14

  2. Module 2: ω -regular expressions 2 / 14

  3. Languages over finite words Σ ∗ = set of all words over Σ Σ : finite alphabet Language: A set of finite words { ab , abab , ababab , ... } finite words starting with an a finite words starting with a b { ε , b , bb , bbb , ... } { ε , ab , abab , ababab , ... } { ε , bbb , bbbbbb , ( bbb ) 3 , ... } words starting and ending with an a { ε , ab , aabb , aaabbb , a 4 b 4 ... } 3 / 14

  4. Regular expressions Σ ∗ = set of all words over Σ Σ : finite alphabet Language: A set of finite words ab ( ab ) ∗ { ab , abab , ababab , ... } a Σ ∗ finite words starting with an a b Σ ∗ finite words starting with a b b ∗ { ε , b , bb , bbb , ... } ( ab ) ∗ { ε , ab , abab , ababab , ... } ( bbb ) ∗ { ε , bbb , bbbbbb , ( bbb ) 3 , ... } a Σ ∗ a words starting and ending with an a { ε , ab , aabb , aaabbb , a 4 b 4 ... } 4 / 14

  5. = { a , b } Alphabet Σ = { a , b } · { a , b } Σ · Σ = { aa , ab , ba , bb } Σ 0 = { ε } (empty word, with length 0) aba · ε = aba = words of length 1 Σ 1 ε · bbb = bbb Σ 2 = words of length 2 w · ε = w Σ 3 = words of length 3 . ε · w = w . . Σ k = words of length k . . . i ≥ 0 Σ i � Σ ∗ = = set of all finite length words 5 / 14

  6. Regular expressions 6 / 14

  7. Regular expressions ε 6 / 14

  8. Regular expressions ε | a | b 6 / 14

  9. Regular expressions ε | a | b | r 1 r 2 6 / 14

  10. Regular expressions ε | a | b | r 1 r 2 | r 1 + r 2 6 / 14

  11. Regular expressions ε | a | b | r 1 r 2 | r 1 + r 2 | r ∗ 6 / 14

  12. Regular expressions ε | a | b | r 1 r 2 | r 1 + r 2 | r ∗ where r 1 , r 2 , r are regular expressions themselves 6 / 14

  13. Regular expressions ε | a | b | r 1 r 2 | r 1 + r 2 | r ∗ where r 1 , r 2 , r are regular expressions themselves a ∗ + b ∗ ab + bb + baa ( a + b ) ∗ ab ( ba + bb ) ( ab + bb ) ∗ . . . 6 / 14

  14. Theorem 1. Every regular expression can be converted to an NFA accepting the language of the expression 2. Every NFA can be converted to a regular expression describing the language of the NFA 7 / 14

  15. Coming next: Languages over infinite words 8 / 14

  16. Σ = { a , b } 9 / 14

  17. Σ = { a , b } Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } 9 / 14

  18. Σ = { a , b } Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } 9 / 14

  19. Σ = { a , b } Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } 9 / 14

  20. Σ = { a , b } Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } 9 / 14

  21. Σ = { a , b } Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } Example 5: Infinite words where b occurs infinitely often { abababababab ... , bbbabbbabbbabbba ... , bbbbbbbbbbbbb ..., ... } 9 / 14

  22. Σ = { a , b } a ω Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } Example 5: Infinite words where b occurs infinitely often { abababababab ... , bbbabbbabbbabbba ... , bbbbbbbbbbbbb ..., ... } 9 / 14

  23. Σ = { a , b } a ω Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } a ω + b ω Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } Example 5: Infinite words where b occurs infinitely often { abababababab ... , bbbabbbabbbabbba ... , bbbbbbbbbbbbb ..., ... } 9 / 14

  24. Σ = { a , b } a ω Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } a ω + b ω Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } aa Σ ∗ aa · b ω a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } Example 5: Infinite words where b occurs infinitely often { abababababab ... , bbbabbbabbbabbba ... , bbbbbbbbbbbbb ..., ... } 9 / 14

  25. Σ = { a , b } a ω Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } a ω + b ω Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } aa Σ ∗ aa · b ω a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } ( a + b ) ∗ · b ω Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } Example 5: Infinite words where b occurs infinitely often { abababababab ... , bbbabbbabbbabbba ... , bbbbbbbbbbbbb ..., ... } 9 / 14

  26. Σ = { a , b } a ω Infinite word consisting only of a Example 1: { aaaaaaaaaaaaaaaa ... } a ω + b ω Example 2: Infinite words containing only a or only b { aaaaaaaaaaaaaaa ... , bbbbbbbbbbbb ... } aa Σ ∗ aa · b ω a word in aa Σ ∗ aa followed by only b -s Example 3: { aaaabbbbbbb ... , aababaabbbbbb ... , aabbbbaabbbbbbb ..., ... } ( a + b ) ∗ · b ω Example 4: Infinite words where b occurs only finitely often { aaaaaaaaaaaaaaaa ... , baaaaaaaaaa ... , babbaaaaaaaaaaaa ..., ... } ( a ∗ b ) ω Example 5: Infinite words where b occurs infinitely often { abababababab ... , bbbabbbabbbabbba ... , bbbbbbbbbbbbb ..., ... } 9 / 14

  27. ω -regular expressions G = E 1 · F ω + E 2 · F ω + ··· + E n · F ω 1 2 n E 1 , ..., E n , F 1 , ..., F n are regular expressions and ε / ∈ L ( F i ) for all 1 ≤ i ≤ n 10 / 14

  28. ω -regular expressions G = E 1 · F ω + E 2 · F ω + ··· + E n · F ω 1 2 n E 1 , ..., E n , F 1 , ..., F n are regular expressions and ε / ∈ L ( F i ) for all 1 ≤ i ≤ n L ( F ω ) = { w 1 w 2 w 3 ... | each w i ∈ L ( F ) } 10 / 14

  29. More examples 11 / 14

  30. More examples ◮ ( a + b ) ω set of all infinite words 11 / 14

  31. More examples ◮ ( a + b ) ω set of all infinite words ◮ a ( a + b ) ω infinite words starting with an a 11 / 14

  32. More examples ◮ ( a + b ) ω set of all infinite words ◮ a ( a + b ) ω infinite words starting with an a ◮ ( a + bc + c ) ω words where every b is immediately followed by c 11 / 14

  33. More examples ◮ ( a + b ) ω set of all infinite words ◮ a ( a + b ) ω infinite words starting with an a ◮ ( a + bc + c ) ω words where every b is immediately followed by c ◮ ( a + b ) ∗ c ( a + b ) ω words with a single occurrence of c 11 / 14

  34. More examples ◮ ( a + b ) ω set of all infinite words ◮ a ( a + b ) ω infinite words starting with an a ◮ ( a + bc + c ) ω words where every b is immediately followed by c ◮ ( a + b ) ∗ c ( a + b ) ω words with a single occurrence of c ◮ (( a + b ) ∗ c ) ω words where c occurs infinitely often 11 / 14

  35. { p 1 , p 2 , ... , p k } AP = Σ = PowerSet (AP) = { { } , { p 1 } , ... , { p k } , { p 1 , p 2 } , { p 1 , p 3 } , ... , { p k − 1 , p k } , ... { p 1 , p 2 , ..., p k } } A property is a language of infinite words over alphabet Σ 12 / 14

  36. { p 1 , p 2 , ... , p k } AP = Σ = PowerSet (AP) = { { } , { p 1 } , ... , { p k } , { p 1 , p 2 } , { p 1 , p 3 } , ... , { p k − 1 , p k } , ... { p 1 , p 2 , ..., p k } } A property is a language of infinite words over alphabet Σ The property is ω -regular if it can be described by an ω -regular expression 12 / 14

  37. { wait, crit } AP = Σ = PowerSet (AP) = { { } , { wait } , { crit } , { wait, crit } } 13 / 14

  38. { wait, crit } AP = Σ = PowerSet (AP) = { { } , { wait } , { crit } , { wait, crit } } Property: Process enters critical section infinitely often 13 / 14

  39. { wait, crit } AP = Σ = PowerSet (AP) = { { } , { wait } , { crit } , { wait, crit } } Property: Process enters critical section infinitely often ( ( { } + { wait } ) ∗ ( { crit } + { wait, crit } ) ) ω 13 / 14

Recommend


More recommend