HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

What is a "sentential form"?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
sententialformwhat

Problem

I do know what a "left-most-" and a "right-most derivation" is, but I stumble across the term "sentential form" and its specific differences "right-sentential form" as well as "left-sentential form" and I just don't understand what is meant with this term.

Is the concept "sentential form" so different from the concept "derivation" that it is necessary to "have" it" ?

Can some of you please explain?

Yours sincerely

Solution

Assuming you know what leftmost and rightmost derivations are, let $S \Rightarrow^*W_1W_2\dots W_m$ be a derivation (a sequence of replacement using derivation rules), where $W_i$ is a terminal or nonterminal symbol. Then the string $W_1W_2\dots W_m$ is a sentential form of a grammar $G$. In addition, if $W_1W_2\dots W_m$ contains only terminal symbols then it is called a sentence.

If the derivation $S \Rightarrow^*W_1W_2\dots W_m$ is leftmost (rightmost) then the sentential form $W_1W_2\dots W_m$ is called left-sentential form (right-sentential form).


Is the concept "sentential form" so different from the concept "derivation"

Yes, these are different concepts. A derivation is a sequence of replacements of nonterminals using derivation rules given as a part of grammar, while a sentential form is a string over terminals and nonterminals. You generate/derive/obtain sentential form using derivation (process).

Example:

$S \rightarrow aSa \mid bSb \mid \epsilon$

Derivation: $S\Rightarrow aSa \Rightarrow abSba \Rightarrow abbSbba \Rightarrow abbbba$

Sentential form: $abbSbba$.

Sentence: $abbbba$ (since it has no nonterminal)

Context

StackExchange Computer Science Q#82292, answer score: 6

Revisions (0)

No revisions yet.