Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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)?

0
Posted

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)?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123