0
$\begingroup$

The example says that C is unreachable, but there is the production S-> aBC so C is clearly reachable. This is an error right? or am I missing something.enter image description here

$\endgroup$

2 Answers 2

0
$\begingroup$

Yes, that is an error, because C is reachable from S by using the production rule S->aBC and derives the string ababb using production rule C->abb and B->b. Hence C is reachable.

$\endgroup$
-1
$\begingroup$

Just because C is a suffix of output of rule S -> aBC doesn't make C reachable from S, since aBC -> C is not necessarily reachable. Reachability from initial state is about reachability of strings of terminal symbols (denoted by strings containing only lower case letters). Nonterminals (the capital letters) are supposed to be expanded out at some point using the rules.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.