Closure Properties for Regular Languages

Closure Properties for Regular Languages

CS 208: Automata Theory and Logic Closure Properties for Regular Languages Ashutosh Trivedi b a a start A 8x(La(x) ! 9y:(x < y) ^ Lb(y)) B b Department of Computer Science and Engineering, Indian Institute of Technology Bombay. Ashutosh Trivedi – 1 of 13 Ashutosh Trivedi Regular Languages Closure Properties Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg 3. Complementation: A = fw : w 62 Ag 4. Concatenation: AB = fwv : w 2 A and v 2 Bg 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Define the notion of a set being closed under an operation (say, N and ×). Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties 3. Complementation: A = fw : w 62 Ag 4. Concatenation: AB = fwv : w 2 A and v 2 Bg 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Define the notion of a set being closed under an operation (say, N and ×). Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties 4. Concatenation: AB = fwv : w 2 A and v 2 Bg 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Define the notion of a set being closed under an operation (say, N and ×). Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg 3. Complementation: A = fw : w 62 Ag Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Define the notion of a set being closed under an operation (say, N and ×). Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg 3. Complementation: A = fw : w 62 Ag 4. Concatenation: AB = fwv : w 2 A and v 2 Bg Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties Define the notion of a set being closed under an operation (say, N and ×). Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg 3. Complementation: A = fw : w 62 Ag 4. Concatenation: AB = fwv : w 2 A and v 2 Bg 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg 3. Complementation: A = fw : w 62 Ag 4. Concatenation: AB = fwv : w 2 A and v 2 Bg 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Define the notion of a set being closed under an operation (say, N and ×). Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties Regular Languages: Properties Definition (Regular Languages) A language is called regular if it is accepted by a finite state automaton. Let A and B be languages (remember they are sets). We define the following operations on them: 1. Union: A [ B = fw : w 2 A or w 2 Bg 2. Intersection: A \ B = fw : w 2 A and w 2 Bg 3. Complementation: A = fw : w 62 Ag 4. Concatenation: AB = fwv : w 2 A and v 2 Bg 5. Closure (Kleene Closure, or Star): ∗ A = fw1w2 ::: wk : k ≥ 0 and wi 2 Ag. In other words: ∗ i A = [i≥0A where A0 = ;, A1 = A, A2 = AA, and so on. Define the notion of a set being closed under an operation (say, N and ×). Theorem The class of regular languages is closed under union, intersection, complementation, concatenation, and Kleene closure. Ashutosh Trivedi – 2 of 13 Ashutosh Trivedi Regular Languages Closure Properties Proof. – Prove that for regular languages L1 and L2 that L1 [ L2 is regular. – Let M1 = (S1; Σ; δ1; s1; F1) and M2 = (S2; Σ; δ2; s2; F2) be DFA for L1 and L2. – DFA Construction: (the Product Construction) We claim the DFA M = (S1 × S2; Σ; δ; (s1; s2); F) where – δ((s1; s2); a) = (δ1(s1; a); δ2(s2; a)) for all s1 2 S1, s2 2 S2, and a 2 Σ, – F = (F1 × S2) [ (S1 × F2). accepts L1 [ L2 i.e. L(M) = L(M1) [ L(M2). – Proof of correctness: For every string w, we have ^ ^ ^ 1. δ((s1; s2); w) = (δ1(s1; w); δ2(s2; w)) ^ ^ ^ 2. δ((s1; s2); w) 2 F iff δ1(s1; w) 2 F or δ2(s2; w) 2 F. – L1 [ L2 is regular since there is a DFA accepting this language. Closure under Union Lemma The class of regular languages is closed under union. Ashutosh Trivedi – 3 of 13 Ashutosh Trivedi Regular Languages Closure Properties – Let M1 = (S1; Σ; δ1; s1; F1) and M2 = (S2; Σ; δ2; s2; F2) be DFA for L1 and L2. – DFA Construction: (the Product Construction) We claim the DFA M = (S1 × S2; Σ; δ; (s1; s2); F) where – δ((s1; s2); a) = (δ1(s1; a); δ2(s2; a)) for all s1 2 S1, s2 2 S2, and a 2 Σ, – F = (F1 × S2) [ (S1 × F2). accepts L1 [ L2 i.e. L(M) = L(M1) [ L(M2). – Proof of correctness: For every string w, we have ^ ^ ^ 1. δ((s1; s2); w) = (δ1(s1; w); δ2(s2; w)) ^ ^ ^ 2. δ((s1; s2); w) 2 F iff δ1(s1; w) 2 F or δ2(s2; w) 2 F. – L1 [ L2 is regular since there is a DFA accepting this language. Closure under Union Lemma The class of regular languages is closed under union. Proof. – Prove that for regular languages L1 and L2 that L1 [ L2 is regular. Ashutosh Trivedi – 3 of 13 Ashutosh Trivedi Regular Languages Closure Properties – DFA Construction: (the Product Construction) We claim the DFA M = (S1 × S2; Σ; δ; (s1; s2); F) where – δ((s1; s2); a) = (δ1(s1; a); δ2(s2; a)) for all s1 2 S1, s2 2 S2, and a 2 Σ, – F = (F1 × S2) [ (S1 × F2). accepts L1 [ L2 i.e. L(M) = L(M1) [ L(M2). – Proof of correctness: For every string w, we have ^ ^ ^ 1. δ((s1; s2); w) = (δ1(s1; w); δ2(s2; w)) ^ ^ ^ 2. δ((s1; s2); w) 2 F iff δ1(s1; w) 2 F or δ2(s2; w) 2 F. – L1 [ L2 is regular since there is a DFA accepting this language. Closure under Union Lemma The class of regular languages is closed under union. Proof. – Prove that for regular languages L1 and L2 that L1 [ L2 is regular. – Let M1 = (S1; Σ; δ1; s1; F1) and M2 = (S2; Σ; δ2; s2; F2) be DFA for L1 and L2. Ashutosh Trivedi – 3 of 13 Ashutosh Trivedi Regular Languages Closure Properties – Proof of correctness: For every string w, we have ^ ^ ^ 1.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    46 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us