943,907 Members | Top Members by Rank

Ad:
Sep 27th, 2003
0

Context-sensitive grammar question :(

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fever is offline Offline
3 posts
since Sep 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: Help in CSP[Communicting sequential processes]
Next Thread in Computer Science Forum Timeline: Gaussian elimination with row interchange





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC