Tuesday, 6 September 2016

Impotant properties in Theory of computation

Regular and Context Free Languages

  • Every regular language is also CFL, but every CFL need not be regular.
  • Every DCFL is also CFL, but every DCFL need not be regular.
  • Every regular language is also DFCL, but every DCFL need not regular.
Regular Languages
  • {w |  {a, b }* }
  • {aw | w  {a, b }* }
  • {bw | w  {a, b }* }
  • {wa | w  {a, b }* }
  • {awb | w  {a, b }* }
  • {w1abw2 | w1,w2  {a, b }* }
  • { ambn | m,n>0 }
  • { ambnck | m,n,k>=0}
  • {a2n | n>=0}
Non-Regular Languages
  • { anbn | n is a positive integer }
  • { ww | w  {a, b }* }
  • {w | w has an equal number of a’s and b’s}
  • {w| w is a palindrome of a’s and b’s}
  • {an | n is prime}
Deterministic CFLs (DCFLs)
  • { anbn | n is a positive integer }
  • {w | w has an equal number of a’s and b’s}
  • { ambn | m < n}
  • { ambn | m = 2n}
  • { ambnck | if m is even, then n=k}
  • {wCwR  | w ∈ {a, b }* , C is a special symbol and wR is the reverse of string w}
CFL’s (NCFL’s)
  • {wwR  | w  {a, b }* , and wR is the reverse of string w}
  • { ambnck | m=n or n=k}
  • { ambnck | if m=n, then n=k}
  • All regulars
  • All DCFLs

Non-CFL’s
  • { ww  | w  {a, b }*}
  • { anbncn | n>=0}
  • {an | n is prime}
  • { ambnck | m<n<k}
Important Properties:
  • Let L be a Context Free Languages, and R be a regular language. Then
    • L ∩ R = always CFL and need not be regular
    • L ∪ R = always CFL and need not be regular
    • L – R  = always CFL and need not be regular
    • R – L = Always CSL but need not be CFL
  • Let D be a DCFL, and R be a regular language. Then
    • D ∩ R = always DCFL and need not be regular
    • D ∪ R = always DCFL and need not be regular
    • D – R  = always DCFL and need not be regular
    • R – D = Always DCFL but need not be regular

No comments:

Post a Comment