Theory of Computation etcs-206 Context Free Grammar


Step 3 − Increment i and repeat Step 2, until Wi+1 = Wi



Download 1.68 Mb.
Page2/6
Date23.07.2021
Size1.68 Mb.
#57100
1   2   3   4   5   6
CFG

Step 3 − Increment i and repeat Step 2, until Wi+1 = Wi.

Step 4 − Include all production rules that have Wi in it.

Reduction of CFG

  • Phase 2 − Derivation of an equivalent grammarG”, from the CFG, G’, such that each symbol appears in a sentential form.
    • Derivation Procedure −
    • Step 1 − Include the start symbol in Y1 and initialize i = 1.

      Step 2 − Include all symbols, Yi+1, that can be derived from Yi and include all production rules that have been applied.

      Step 3 − Increment i and repeat Step 2, until Yi+1 = Yi.

Example 1

Example 2

Find a reduced grammar equivalent to the grammar G, having production rules, P:

S -> abS | abA | abB


Download 1.68 Mb.

Share with your friends:
1   2   3   4   5   6




The database is protected by copyright ©ininet.org 2024
send message

    Main page