Question
Given a string w, a string u is a prefix of w if and only if v, w = uv. Therefore, un is a prefix
Given a string w, a string u is a prefix of w if and only if v, w = uv. Therefore, un is a prefix of the word unhappy. Given a language L, Lpre = {u | w L, and u is a prefix of w}. Show that if L is a context free language, then Lpre is also context free. [10 points]
Hint: The most elegant way to do this is to use recursive constructions. Given a context free language L, think of proving Lrev, the reverse of strings in the language to be context free. You can apply similar ideas for constructing Lpre.
I know how to do this without using Lrev, but can anyone show me how to do it using Lrev?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started