Derivation
. If there is a production A a then we say that A derives a and is denoted by A a
. a A ß a γ ß if A γ is a production
. If a1 a2 . an then a 1 an
. Given a grammar G and a string w of terminals in L(G) we can write S w
. If S a where a is a string of terminals and non terminals of G then we say that a is a sentential form of G
If there is a production A a then it is read as " A derives a " and is denoted by A a . The production tells us that we could replace one instance of an A in any string of grammar symbols by a .
In a more abstract setting, we say that a A ß a γ ß if A ? is a production and a and ß are arbitrary strings of grammar symbols
If a 1 a 2 . a n then we say a 1 derives a n . The symbol means "derives in one step". Often we wish to say "derives in one or more steps". For this purpose, we can use the symbol with a + on its top as shown in the slide. Thus, if a string w of terminals belongs to a grammar G, it
+ *
is written as S w . If S a , where a may contain non-terminals, then we say that a is a sentential form of G. A sentence is a sentential form with no non-terminals.
|