Question: Construct a derivation of 0 ^ 3 1 ^ 3 using the grammar given in Example 5 . EXAMPLE 5 Give a phrase - structure
Construct a derivation of using the grammar given in Example
EXAMPLE
Give a phrasestructure grammar that generates the set nn n
Solution: Two productions can be used to generate all strings consisting of a string of s followed by a string of the same number of s including the null string. The first builds up successively longer strings in the language by adding a at the start of the string and a at the end. The second production replaces S with the empty string. The solution is the grammar G V T S P where V S T S is the starting symbol, and the productions are
SS
S
The verification that this grammar generates the correct set is left as an exercise for the reader.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
