0
$\begingroup$

Hey guys I am having trouble generating strings from this language, I haven't seen a grammar that looks like this and can't figure how to generate strings from this grammar, is this Context Sensitive grammar? Thank you.

$G=(\{S, L_x,R_x,W_x \},\{a,b\},P,S) \\ P = \{ \\S \to \lambda \mid L_x R_x, \\ L_x \to x \mid L_xyW_y, \\ W_xy \to yW_x, \\ W_xR_y \to R_yx, \\ R_x \to x \\\} \\ x, y ∈ \{a,b \} \text{ this means that } x=y \text{ but also it can be } x \neq y $

$\endgroup$
2
  • $\begingroup$ What do you mean that you're having trouble generating strings? Start from $S$ and apply the production rules until there are no more non-terminals. And yes, this grammar is context-sensitive as it can be seen by checking the definition of CFG grammar. $\endgroup$
    – Steven
    Commented Feb 15, 2021 at 19:28
  • $\begingroup$ Same grammar has been mentioned here Derivation from grammar. The question has an answer there, but I am also curious: where does this quastion originate? $\endgroup$ Commented Feb 15, 2021 at 19:52

0