∑GateAndNet
PlannerSign 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)!