Hi, I was wondering if anyone would be able to give hints of any sort to this question:
"Give a context-sensitive grammar for the language
L = {x#y | y is a substring of x, where x,y є {0,1}* }"
I've got how to get eg. y є {0,1}* by
<S> --> <A><B><C>
<A><B> --> a<A><D> | b<A><E>
<D><C> --> <B>a<C>
<E><C> --> <B>b<C>
<D>a --> a<D>
<D>b --> b<D>
<E>a --> a<E>
<E>b --> b<E>
<A><B> --> є
<C> --> є
a<B> --> <B>a
b<B> --> <B>b
but how do I check that y is in x? when both y and x can use the above method, but how can I restrict it so that the only accepted language is a string x that contains y?
I'm really stuck on this :sad: