The `directly derives relation would appear to allow words containing nonterminals, but isn it supposed to only produce words that are accepted by the grammar (terminals only)?
The “directly derives” relation ⇒ means derived in exactly one production step. It is a relation from a string made up of terminals and nonterminals to another string made up of terminals and nonterminals. This is expressed mathematically as: ⇒ ⊆ (N ∪ T)* × (N ∪ T)* So A ⇒ B is valid if we can derive B from A in one step by applying a production rule. A string is derivable if we can derive it from the start symbol by applying ⇒ zero or more times (written ⇒*). However, just because a string is derivable doesn’t mean it is a word in the language. Only derivable strings consisting only of terminal symbols are words in the language.
Related Questions
- The `directly derives relation would appear to allow words containing nonterminals, but isn it supposed to only produce words that are accepted by the grammar (terminals only)?
- Do the Words "High Iron Illustrations" appear in the Design Area of Lithographs?
- Can the words "Saint Louis" appear without the word "Billikens"?