1

I want to solve the problem 2.24 of "Introduction to the theory of computation" Sipser 3th edition, below:

Let G be the following grammar:

S → T-

T → TaTb | TbTa | ε

( - is the end symbol for endmarked languages)

Use the DK-test to show that G is a DCFG. Describe a DPDA that recognizes L(G)

I tried using the DK-test but this showed me that G is not DCFG, but this is impossible because i build a DPDA that recognizes L(G).

Can someone tell me why i'm running the DK-test wrong?

I can't post photos of my work (because i don't have enough reputation), but i can explain what i did: I build the DFA DK for show that G is DCFG, but following the symbols T-a-T-b i reach in a DFA DK's state that has 2 complete rules

T→TaTb.

T→.

and this means that the grammar G is not a DCFG, but this is not true. I can't see what i'm doing wrong.

fabianod
  • 501
  • 4
  • 17
  • Does DCFG mean "deterministic context-free grammar"? Does that mean the same thing as "unambiguous"? Note that you can have nondeterministic grammars (and ambiguous ones) even for unambiguous, deterministic context-free languages for which you can find deterministic PDAs. Your grammar does not appear to be unambiguous. – Patrick87 Jun 10 '19 at 13:58
  • The DK test doesn't work on that grammar because it was nondeterministic. The exercize ask "show that..." but the grammar given is wrong. In the errata corridge of the book can be found the correct grammar for this exercize. – fabianod Jun 15 '19 at 17:51

0 Answers0