Context Sensitive Grammar Example
In this class, we discuss Context Sensitive Grammar Example.
For Complete YouTube Video: Click Here
The reader should have prior knowledge of context-sensitive grammar. Click Here.
the language L = aⁿbⁿcⁿ where n >= 1
The below grammar shows the context-sensitive grammar for the language L.
S – abc | aAbc
Ab – bA
Ac – Bbcc
bB – Bb
aB – aa | aaA
Take the input string aaabbbccc
We derive the input string aaabbbccc from the context sensitive grammar.
S – aAbc [Ab is changed to bA] we get
abAc [Ac is changed to Bbcc] we get
abBbcc Similarly, we derive the string aaabbbccc.
aBbbcc
aaAbbcc
aabAbcc
aabbAcc
aabbBbccc
aabBbbccc
aaBbbbccc
aaabbbccc