Context-sensitive grammar question :(

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Sep 2003
Posts: 3
Reputation: fever is an unknown quantity at this point 
Solved Threads: 0
fever fever is offline Offline
Newbie Poster

Context-sensitive grammar question :(

 
0
  #1
Sep 27th, 2003
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC