GateMCQSCIENTIFIC PREP LAB
PlanSign Up

Formal Languages Closure & Decidability Reference

Property / OperationRegularDCFLCFLCSLRecursive (REC)Rec. Enum. (RE)
Unionβœ…βŒβœ…βœ…βœ…βœ…
Intersectionβœ…βŒβŒβœ…βœ…βœ…
Complementβœ…βœ…βŒβœ…βœ…βŒ
Concatenation / Kleene Starβœ…βŒβœ…βœ…βœ…βœ…
Intersection with Regularβœ…βœ…βœ…βœ…βœ…βœ…
Emptiness (L=βˆ…?L = \emptyset?)DecidableDecidableDecidableUndecidableUndecidableUndecidable
Equivalence (L1=L2?L_1 = L_2?)DecidableDecidableUndecidableUndecidableUndecidableUndecidable

Compiler Parsing Hierarchy

LR(0)⊊SLR(1)⊊LALR(1)⊊CLR(1)=Deterministic CFL\text{LR}(0) \subsetneq \text{SLR}(1) \subsetneq \text{LALR}(1) \subsetneq \text{CLR}(1) = \text{Deterministic CFL}

  • Number of States: ∣LR(0)∣=∣SLR(1)∣=∣LALR(1)βˆ£β‰€βˆ£CLR(1)∣|\text{LR}(0)| = |\text{SLR}(1)| = |\text{LALR}(1)| \le |\text{CLR}(1)|
  • Ambiguous Grammar: Never LL(k)LL(k), never LR(k)LR(k)!