The question is pretty short, but I've been thinking about it quite some time: Are terminal symbols that are not in the defined alphabet still valid?
$\begingroup$
$\endgroup$
2
-
$\begingroup$ Not a real answer here, so I write a comment. If you define a grammar $G = (N, \{a, b\}, P, S)$ and have a production rule like $\alpha \to \beta c \gamma$, one may say that this rule cannot be in $P$. But all in all the question is not really profound. Why should anyone define a grammar with such inconsistency? $\endgroup$– ttnickJun 8, 2018 at 14:06
-
$\begingroup$ @PHPNick because it's not mine :) $\endgroup$– justdekoJun 8, 2018 at 15:06
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
2
No. The grammar is defined like this:
G = (V,SIGMA, R, S) where V is your set of variables (non-terminals) and SIGMA is your alphabet (terminals). All the symbols you are allowed to use in the substitution of a rule are the union of V and SIGMA. If you simply cannot use a symbol out of that set, since it does not exists in the context of your grammar.
-
$\begingroup$ So if I have a production rule S -> a where S is a variable in the grammar but a isn't anywhere, than what chomsky type is the grammar? Non-existant? $\endgroup$– justdekoJun 8, 2018 at 12:51
-