Skip to main content

Regular and Context Free Languages

Amu_Ke_Fundye


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 is a palindrome of a’s and b’s}
  • {an | n is prime}
Deterministic CFLs (DCFLs)
  • { anbn | n is a positive integer }
  •  
  • { ambn | m < n}
  • { ambn | m = 2n}
  • { ambnck | if m is even, then n=k}
  • {wCw | w ∈ {a, b }* , C is a special symbol and wR is the reverse of string w}
CFL’s (NCFL’s)
  • {ww | 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
Regards 
Amrut Jagdish Gupta

Comments

Popular posts from this blog

Undecidability

Amu_Ke_Fundye Undecidability Decidable Problem If there is a Turing machine that decides the problem, called as Decidable problem. A decision problem that can be solved by an algorithm that halts on all inputs in a finite number of steps. A problem is decidable, if there is an algorithm that can answer either yes or no. A language for which membership can be decided by an algorithm that halts on all inputs in a finite number of steps. Decidable problem is also called as totally decidable problem, algorithmically solvable, recursively solvable. Undecidable Problem A problem that cannot be solved for all cases by any algorithm whatsoever. Equivalent Language cannot be recognized by a Turing machine that halts for all inputs. The following problems are undecidable problems: Halting Problem:  A halting problem is undecidable problem. There is no general method or algorithm which can solve the halting problem for all possible inputs. Emptyness Problem:...

Instruction Pipelining

Amu_Ke_Fundye Instruction Pipelining Parallel processing provides simultaneous data processing tasks for the purpose of increasing the computational speed of a computer system rather than each instruction is processed sequentially, a parallel processing system is able to perform concurrent data processing to achieve faster execution time and increase throughput. There are more advantages with parallel processing but it has some issues also. Due to parallel processing, the amount of hardware increases and the cost of system increases. Parallel processing is established by distributing the data among the multiple functional units. Flynn’s Classification Flynn introduced the parallel processing classification. This classification considers the organisation of a computer system by the number of instructions and data items that are manipulated simultaneously. The sequence of instructions read from the memory constitutes an instruction stream. The operations perfo...

ALU and Data Path

Amu_Ke_Fundye ALU and Data Path The CPU can be divided into a data section and a control section. The   data section , which is also called the   datapath. Datapath The registers, the ALU, and the interconnecting bus are collectively referred to as the datapath.  Each bit in datapath is functionally identical.  The datapath is capable of performing certain operations on data items. The  control section  is basically the  control unit ,  which issues control signals to the datapath . Bus : A Bus is a collection of wires or distinct lines meant to carry data, address and control information. Data Bus : it is used for transmission of data. The number of data lines corresponds to the number of bits in a word. Address Bus : it carries the address of the main memory location from where the data can be accessed. Control Bus : it is used to indicate the direction of data transfer and to coordinate the timing of ...