0

I have this list of formalisms and i need to order them according to their expressive power, also one of them doesn't really belong.

Context-free Grammar(CFG)
Deterministic Finite Automata(DFA)
Deterministic Pushdown Automata(DPDA)
LR(0) Grammar
LR(1) Grammar
Nondeterministic Finite Automata(NFA)
Nondeterministic Finite Automata with epsilon transitions(NFAe)
Nondeterministic Turing MAchines(NTM)
Pushdown Automata(PDA)
Regular expressions(reg.exp)
Turing Machines(TM)
Turing MAchines with twi heads(TM2h)

I have ordered them in the following way:

1. NFAe, NFA, DFA, reg.exp
2. DPDA
3. PDA, CFG
4. TM, TM2h, NTM

where those in 4 are the most powerful. and i removed LR grammars, becuase they are just a way of writing CFG's so that they can be parsed by an LR-parser.

However im not sure if this is correct or not.

Conviley
  • 131
  • 2
  • 10
  • LR(1) grammars are a subset of context-free grammars and LR(0) grammars are a subset of LR(1) grammars. A language is LR(0) resp. LR(1) if there exists an LR(0) resp. LR(1) grammar for it. Whether such a grammar exists is undecidable, but it is easy to prove that non-LR(k) languages exist for any `k`. – rici May 23 '16 at 21:40

1 Answers1

0

LR(1) is equal to DPDA.

LR(0) is incomparable to REG, DFA etc. Thus if you are supposed to provide a total order with all but one of the classes, LR(0) must be left out. As soon as you put it in the order, the four regular formalisms cannot be in the same total order due to the incomparability.

Peter Leupold
  • 1,162
  • 1
  • 9
  • 16