11

I'm studying context free grammar and I'm curious what the arrow with the star and the arrow without the star mean in parts f and g where:

  • f is false.
  • g is true.

enter image description here

ddschmitz
  • 508
  • 1
  • 8
  • 18
jfisk
  • 6,125
  • 20
  • 77
  • 113

2 Answers2

18

"x ⇒ y" means that y can be derived from x in exactly one application of some production of the grammar. Putting an asterisk over the ⇒ means that y is derived from x via zero or more (but finitely many!) applications of some sequence of productions.

jwodder
  • 54,758
  • 12
  • 108
  • 124
  • so f is false because i cant obtain aba by running through this sequence once (which makes sense) but arrow* is correct because i can first get ab, then a in the second pass? – jfisk Oct 18 '11 at 23:37
  • 1
    @jfisk: Almost; the full sequence for g is T ⇒ XTX ⇒ aTX ⇒ aTa ⇒ aXa ⇒ aba (among other possible orders of events). – jwodder Oct 18 '11 at 23:57
3

See http://en.wikipedia.org/wiki/Context-free_grammar#Repetitive_rule_application for an explanation.

That is to say, if u star-arrow v, there is some series of applications of rules that goes from u to v.

kestrel
  • 1,314
  • 10
  • 31