Sunteți pe pagina 1din 17

Lucrri individuale

1. AUTOMATE FINITE
1) S se reprezinte automatul finit n form tabelar i grafic.
2) Pentru cinci cuvinte ( 3 corecte i 2 incorecte) s se demonstreze printr-un calcul de
configuraii acceptarea sau neacceptarea cuvintelor.
1. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1}, F={q3}, (q0,1)={q0} (q3,1)={q3},
(q1,1)={q0, q3}, (q3,0)={q3}, (q0,0)={q1}, (q2,0)={q3}, (q1,0)={q2}, (q2,1)={q0}

q0

q1

q0

q1

q2

q0, q3

q2

q3

q0

q3

q3

q3

100001
(q0 , 100001) ( q0 , 0001) ( q1 , 001) ( q2 , 01) ( q3 , 1) ( q3 , ) - acceptat
010110
(q0 , 010110) ( q1 , 10110) ( q0 , 0110) ( q1 , 110) ( q0 , 10) ( q0 , 0)
( q3 , 10)
( q1 , ) - err q1 F
( q3 , 0) ( q3 , ) - acceptat
( q3 , 0110) ( q3 , 110) ( q3 , 10) ( q3 , 0) ( q3 ,
) - acceptat
00110
(q0 , 00110) ( q1 , 0110) ( q2 , 110) ( q0 , 10) ( q0 , 0) ( q1 , ) - err q1
F
111111
(q0 , 111111) ( q0 , 11111) ( q0 , 1111) ( q0 , 111) ( q0 , 11) ( q0 , 1)
( q0 , ) - err q0 F
110101
(q0 , 110101) ( q0 , 10101) ( q0 , 0101) ( q1 , 101) ( q0 , 01) ( q1 , 1)
( q0 , ) - err q0 F
( q3 , ) - acceptat
( q3 , 01) ( q3 , 1) ( q3 , ) acceptat

1)
2)
3)
4)

2. ECHIVALENA AFND I AFD


Reprezentai automatul finit n form grafic.
Construii automatul finit determinist echivalent.
Reprezentai automatul finit determinist n form grafic.
Pentru dou cuvinte acceptate de automatul finit nedeterminist demonstrai, printr-un calcul
de configuraii, acceptarea sau neacceptarea cuvintelor i de automatul finit determinist.
5. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={7,8,9}, F={q3}, (q0,7)={q0,q1},
(q1,8)={q1,q2}, (q1,7)={q1}, (q2,9)={q3}, (q3,9)={q3}
1)

2) ADF=(Q, , ', q0, F)

Q={[q0], [q1], [q3], [q0q1], [ q1q2]}


'([q0], 7)=[ q0q1]
'([q1], 7)=[q1]
'([q1], 8)=[ q1q2]
'([q2], 9)=[ q3]
'([q3], 9)=[ q3]

'([q0q1],7)=[ q0q1]
'([q0q1],8)=[ q1q2]
'([q1q2],7)=[ q1]
'([q1q2],8)=[ q1q2]
'([q1q2],9)=[ q3]

F={ [q3]}
3)

4) 7789

(q0 , 7789) ( q0q1, 789) ( q0q1, 89) ( q1q2, 9) ( q3 , ) - acceptat


778899
(q0 , 778899) ( q0q1, 78899) ( q0q1, 8899) ( q1q2, 899) ( q1q2, 99) ( q3 ,
9) ( q3 , ) - acceptat
3. ECHIVALENA GRAMATICILOR REGULATE I A AUTOMATELOR FINITE
1. Din gramatica data s se genereze trei forme propoziionale (cuvinte).
2. S se construiasca arborele de derivare pentru fiecare din cuvintele generate.
3. S se construiasc automatul finit echivalent.
4. Printr-un calcul de configuraii s se demonstreze c formele propoziionale
generate de gramatic sunt acceptate i de automatul finit construit.
1. G=({S, C, D}, {0, 1}, P, S), unde P:
1) S1C | 0D; 2) C0D | 0S | 1; 3) D1C | 1S | 0.
2. G=({S, A, B, C}, {a, b, c}, P, S), unde P:
1) SaA | bB | aC; 2) AbA | bB | c; 3) BaA | cC | b; 4) CbB | bC |a.
3. G=({K, L, M, N}, {a, b, +, -, }, P, K), unde P:
1) KaL | bM; 2) L-N | -M; 3) M+N; 4) NaL | bM | .
4. G=({X, Y, Z, W, V}, {0, 1, ~, #, &}, P, X), unde P:
1) X0Y | 1Z | 1; 2) Y0Z | ~W | #; 3) Z1Y | 1W | 0V;
4) W0W | 1W | #; 5) V&Z.
5. G=({K, L, M, N, Q, P, R, S}, {0, 1, *, $, /}, V, K), unde V:
1) K1L | 0N; 2) L0M | 0P | /Q; 3) N1R | 1M | *S;
4) Q1P;5) P*L | $; 6) M$; 7) S0R; 8) R/N | $.
6. G=({E, A, B, C, D}, {0, 1, a, b, c}, P, E), unde P:
1) E0A | c; 2) AaB | aD; 3) BbB | 1C | c; 4) DaD | 0C | c.
7. G=({S, A, B, C, D}, {a, b, c, d, }, P, S), unde P:
1) SaA | bB; 2) AcC | ; 3) CcC | cA; 4) BdD | ; 5) DdD |dB.
8. G=({K, L, M, N, P}, {0, 1, &, %, a, b}, C, K), unde C:
1) K1M | 1; 2) M0L | &N | &P; 3) L1L | 0L | %P; 4) NaN | bN | %P;

5) P1P | aP | 0.
9. G=({I, J, K, M, N}, {0, 1, ~, !}, P, I), unde P:
1) I0J | 1K | 0M; 2) J~K | 0M; 3) K~M | 0J | 0N; 4) M1K | !;
5) N0I | 1I | !.
10. G=({S, A, B, C, D, E}, {a, b, c, d, e, $, }, P, S), unde P:
1) SaA | bB | cC; 2) AdD; 3) B#D | $E; 4) DdD | dB | ; 5) CcE;
6) EeE | eB | .
11. G=({X, Y, Z, V}, {(, ), y, z, v}, P, X), unde P:
1) X(Y | y; 2) YyY | zY | zZ; 3) ZzZ | vZ | vV; 4) VvV | ).
12. G=({A, B, C}, {a, b}, P, A), unde P:
1) AbC | aC; 2) CbB | 0A | 1; 3) BaC | bA | a.
13. G=({S, A, B, C}, {1, 2, 3}, P, S), unde P:
1) S2A | 1B | 1C; 2) A3A | 1B | 3; 3) B3A |2C | 3; 4) C2B | 3C |1.
14. G=({A, L, G, N}, {a, b, +, -, } P, A), unde P:
1) AaL | bN; 2) L-N | -G; 3) G+N; 4) NaL | bG | b.
15. G=({X, Y, Z, W, V}, {0, 1, a,b,c}, P, X), unde P:
1) X0Y | 1Z | a; 2) Y0Z | cW | b; 3) Z1Y | 1W | 0V;
4) W0W | 1W | a; 5) VbZ.
16. G=({K, L, M, N, Q, P, R, S}, {0, 1, 2}, V, K), unde V:
1) K1L | 0N; 2) L0M | 0P | 1Q; 3) N1R | 1M | 2S;
4) Q1P;5) P2L | 2; 6) M1; 7) S0R; 8) R2N | 0.
17. G=({E, A, B, C, D}, {0, 1, 2,a, b, c}, P, E), unde P:
1) E0A | 2; 2) AaB | aD; 3) BbB | 1C | c; 4) DaD | 0C | 2.
18. G=({F, A, B, C, D}, {0, 1, 2, 3, 4}, P, F), unde P:
1) F0A | 2; 2) A4B | 3D; 3) B1B | 0C | 0; 4) D4D | 3C | 2.
19. G=({S, A, B, C, D}, {a, b, c, d, e}, P, S), unde P:
1) ScA | bB; 2) AcC | e; 3) CcC | cA; 4) BdD | e; 5) DdD |aB.
20. G=({K, L, M, N, P}, {0, 1, a, b}, C, K), unde C:
1) K1M | 0; 2) M0L | 1N | aP; 3) L1L | 0L | bP;
4) NaN | bN | 0P; 5) P1P | aP | 0.
21. G=({F, J, K, M, N}, {0, 1, e,t}, P, F), unde P:
1) F0J | 1K | 0M; 2) JtK | 0M; 3) KeM | 0J | 0N; 4) M1K | t;
5) N0I | 1F | e.
22. G=({S, A, B, C, D, E}, {a, b, c, d, e}, P, M), unde P:
1) MaA | bB | cC; 2) AdD; 3) BaD | bE; 4) DdD | dB | e; 5) CcE;
6) EeE | eB | b.
23. G=({X, Y, Z, V}, {a, b, y, z, v}, P, X), unde P:
1) XaY | b; 2) YyY | zY | zZ; 3) ZzZ | vZ | vV;
24. G=({S, A, B, C, D}, {a, b, c, d, e}, P, S), unde P:

4) VbV | y.

1)ScA | bB; 2) AcC | e; 3) CcC | cA; 4) BdD | d; 5) DdB |aA.

4. ECHIVALENA AUTOMATELOR FINITE I A GRAMATICILOR REGULATE


1) S se reprezinte automatul finit n form grafic.
2) S se construiasc gramatica regulat echivalent.
3) Pentru dou cuvinte acceptate de automatul finit, s se demonstreze printr-un

calcul de derivri generarea acestor cuvinte i de gramatica regulat.


4) S se construiasc arborele de derivare pentru fiecare din cuvinte.
AF=(Q,,,q0,F), Q={q0,q1,q2}, ={a,b}, F={q2}, (q0,a)={q0,q1}, (q0,b)={q0,q2},

(q1,a)={ q1, q2}, (q2,b)={q2}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1}, F={q3}, (q0,1)={q0} (q3,1)={q3},

(q1,1)={q0, q2 ,q3}, (q3,0)={q3}, (q0,0)={q1}, (q2,0)={q3}, (q2,1)={q0}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q1}, (q0,b)={q1},

(q1,b)={q0,q2}, (q2,a)={q1}, (q2,c)={q3, q0}, (q3,a)={ q2}


AF=(Q,,,q0,F), Q={q0,q1,q2}, ={a,b}, F={q2}, (q0,b)={q0,q1}, (q0,a)={q0},

(q1,a)={q2}, (q2,b)={q2, q1}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q1}, (q0,b)={q1},

(q1,b)={q0}, (q1,a)={q2}, (q2,a)={q1}, (q2,c)={q3, q0}, (q3,a)={ q2}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q0,q1},(q2,b)={q2},

(q3,c)={q3}, (q1,b)={q1,q2}, (q2,c)={q2,q3}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b}, F={q3}, (q0,a)={q0,q1}, (q0,b)={q0,q2},

(q1,a)={ q1, q3}, (q2,b)={q3}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b}, F={q3}, (q0,a)={q0,q1}, (q0,b)={q0,q2},

(q1,a)={q3}, (q2,b)={ q1, q3}


AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={7,8,9}, F={q3}, (q0,7)={q0,q1}, (q1,8)={q1,q2},

(q1,7)={q1}, (q2,9)={q3}, (q3,9)={q3}


10 AF=(Q,,,q0,F), Q={q0,q1,q2}, ={1,2}, F={q2}, (q0,1)={q0,q1}, (q0,2)={q0},
(q1,2)={q2}, (q2,2)={q2, q1}
11 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1}, F={q3}, (q0,1)={q0} (q3,1)={q3},
(q1,1)={q0, q3}, (q3,0)={q3}, (q0,0)={q1}, (q2,0)={q3}, (q1,0)={q2}, (q2,1)={q0}
12 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,2,3}, F={q3}, (q0,1)={q1}, (q0,2)={q1, q0},
(q1,2)={q0}, (q1,1)={q2}, (q2,1)={q1}, (q2,3)={q3}, (q3,1)={q1, q2}, (q3,2)={q2}
13 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,8,4}, F={q3}, (q0,1)={q1}, (q1,8)={q1,q2},
(q1,1)={q1}, (q2,4)={q3}, (q3,4)={ q1,q3}
14 AF=(Q,,,q0,F), Q={q0,q1,q2}, ={1,2,3}, F={q2}, (q0,1)={q0,q2}, (q0,2)={q0, q1},
(q1,2)={q2}, (q2,3)={q2, q1}
15 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1,2}, F={q3}, (q0,1)={q0, q1}, (q3,2)={q3},
(q1,1)={q0, q3}, (q3,1)={q3}, (q2,0)={q3}, (q1,0)={q2}, (q2,2)={q0, q3}
16 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b}, F={q3}, (q0,a)={q1}, (q0,b)={q1},
(q1,a)={q0, q1}, (q1,a)={q2}, (q2,b)={q1}, (q2,a)={q3, q0}, (q3,b)={q2}
17 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={9,1,3}, F={q3}, (q0,3)={q1}, (q0,9)={q1, q0},
(q1,3)={q0}, (q1,1)={q2}, (q2,9)={q1}, (q2,3)={q3}, (q3,9)={q1}

18 F=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={b,c}, F={q3}, (q0,b)={q1}, (q1,b)={q0},


(q1,c)={q2}, , (q2,c)={q3, q0, q1}, (q3,b)={q1}
19 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1,2,3}, F={q3}, (q0,1)={q1}, (q0,2)={q1, q0},
(q1,2)={q1}, (q1,0)={q2}, (q2,1)={q1}, (q2,3)={q3}, (q3,1)={q1, q2}, (q3,0)={q2}
20 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c,d}, F={q3}, (q0,a)={q1},(q2,b)={q2},
(q3,c)={ q0,q3}, (q1,d)={q3,q2}, (q2,c)={q1,q3}
21 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q0,q1}, (q0,c)={q0,q2},
(q1,a)={ q1, q3}, (q2,b)={q3}
22 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,2,9}, F={q3}, (q0,1)={q0,q1}, (q1,2)={q1,q2,q3},
(q1,1)={q1, q3}, (q2,2)={q3}, (q3,9)={ q1,q3}
23 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c,d}, F={q3}, (q0,d)={q1, q2}, (q2,b)={q0,q2},
(q3,c)={q3}, (q1,b)={ q0,q1,q3}, (q2,c)={q2}, (q1,a)={q2}, (q3,b)={q1}
24 AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,8,4}, F={q3}, (q0,1)={q0,q1}, (q1,8)={q1,q2},
(q1,8)={q1}, (q2,4)={q3}, (q3,1)={q3,q1}

5. LEMA DE POMPARE
S se construiasc reprezentarea uvw pentru trei cuvinte recunoscute de automatul finit aplicnd
lema de pompare.
1. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q1}, (q0,b)={q1},
(q1,b)={q0}, (q1,a)={q2}, (q2,a)={ q0,q1}, (q2,c)={q3}, (q3,a)={ q2}
2. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q1},(q2,b)={ q0,q2},
(q3,c)={q3}, (q1,b)={q2}, (q2,c)={q3}
3. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b}, F={q3}, (q0,a)={q1}, (q0,b)={q2}, (q1,a)={
q3}, (q2,b)={ q2,q3}
4. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b}, F={q3}, (q0,a)={q0,q1}, (q0,b)={q0,q2},
(q1,a)={q3}, (q2,b)={ q1, q3}
5. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={7,8,9}, F={q3}, (q0,7)={q0,q1}, (q1,8)={q1,q2},
(q1,7)={q1}, (q2,9)={q3}, (q3,9)={q3}
6. AF=(Q,,,q0,F), Q={q0,q1,q2}, ={1,2}, F={q2}, (q0,1)={q0,q1}, (q0,2)={q0},
(q1,2)={q2}, (q2,2)={q2, q1}
7. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1}, F={q3}, (q0,1)={q0} (q3,1)={q3},
(q1,1)={q0, q3}, (q3,0)={q3}, (q0,0)={q1}, (q2,0)={q3}, (q1,0)={q2}, (q2,1)={q0}
8. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,2,3}, F={q3}, (q0,1)={q1}, (q0,2)={q1, q0},
(q1,2)={q0}, (q1,1)={q2}, (q2,1)={q1}, (q2,3)={q3}, (q3,1)={q1, q2}, (q3,2)={q2}
9. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,8,4}, F={q3}, (q0,1)={q1}, (q1,8)={q1,q2},
(q1,1)={q1}, (q2,4)={q3}, (q3,4)={ q1,q3}
10. AF=(Q,,,q0,F), Q={q0,q1,q2}, ={1,2,3}, F={q2}, (q0,1)={q0,q2}, (q0,2)={q0, q1},
(q1,2)={q2}, (q2,3)={q2, q1}
11. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1,2}, F={q3}, (q0,1)={q0, q1}, (q3,2)={q3},
(q1,1)={q0, q3}, (q3,1)={q3}, (q2,0)={q3}, (q1,0)={q2}, (q2,2)={q0, q3}
12. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b}, F={q3}, (q0,a)={q1}, (q0,b)={q1},
(q1,a)={q0, q1}, (q1,b)={q2}, (q2,b)={q1}, (q2,a)={q3, q0}, (q3,b)={q2}
13. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={9,1,3}, F={q3}, (q0,3)={q1}, (q0,9)={q1, q0},
(q1,3)={q0}, (q1,1)={q2}, (q2,9)={q1}, (q2,3)={q3}, (q3,9)={q1}
14. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={b,c}, F={q3}, (q0,b)={q1}, (q1,b)={q0},
(q1,c)={q2}, (q2,c)={q3, q0, q1}, (q3,b)={q1}
15. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1,2,3}, F={q3}, (q0,1)={q1}, (q0,2)={q1, q0},
(q1,2)={q1}, (q1,0)={q2}, (q2,1)={q1}, (q2,3)={q3}, (q3,1)={q1, q2}, (q3,0)={q2}
16. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c,d}, F={q3}, (q0,a)={q1},(q2,b)={q2},
(q3,c)={ q0,q3}, (q1,d)={q3,q2}, (q2,c)={q1,q3}
17. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q0,q1}, (q0,c)={q0,q2},
(q1,a)={ q1, q3}, (q2,b)={q3}
18. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,2,9}, F={q3}, (q0,1)={q0,q1}, (q1,2)={q1,q2,q3},
(q1,1)={q1, q3}, (q2,2)={q3}, (q3,9)={ q1,q3}
19. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c,d}, F={q3}, (q0,d)={q1, q2}, (q2,b)={q0,q2},
(q3,c)={q3}, (q1,b)={ q0,q1,q3}, (q2,c)={q2}, (q1,a)={q2}, (q3,b)={q1}

20. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={1,8,4}, F={q3}, (q0,1)={q0,q1}, (q1,8)={q1,q2},


(q1,8)={q1}, (q2,4)={q3}, (q3,1)={q3,q1}
21. AF=(Q,,,q0,F), Q={q0,q1,q2}, ={a,b}, F={q2}, (q0,b)={q0,q1}, (q0,a)={q0},
(q1,a)={q2}, (q2,b)={q2, q1}
22. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={0,1}, F={q3}, (q0,1)={q0} (q3,1)={q3},
(q1,1)={q0, q2 ,q3}, (q3,0)={q3}, (q0,0)={q1}, (q2,0)={q3}, (q2,1)={q0}
23. AF=(Q,,,q0,F), Q={q0,q1,q2,q3}, ={a,b,c}, F={q3}, (q0,a)={q1}, (q0,b)={q1},
(q1,b)={q0,q2}, (q2,a)={q1}, (q2,c)={q3, q0}, (q3,a)={ q2}
24. AF=(Q,,,q0,F), Q={q0,q1,q2}, ={a,b}, F={q2}, (q0,a)={q0,q1}, (q0,b)={q0,q2},
(q1,a)={ q1, q2}, (q2,b)={q2}

6. EXPRESII REGULATE
I.
S se scrie expresia regulat a cuvintelor generate de gramatica dat:
1. G=({M, A, B, D, E}, {a, b, c, d, e}, P, M), unde P:
1) MaA | bB; 2) AdD; 3) BaD | bE; 4) DdD | e; 5) EeE | eB | b.
2. G=({X, Y, Z, V}, {a, b, y, z, v}, P, X), unde P:
1) XaY | b; 2) YyY | zY | zZ; 3) ZzZ | vZ | vV; 4) VbV | y.
3. G=({S, C, D}, {0, 1}, P, S), unde P:
1) S1C | 0D; 2) C0D | 0S | 1; 3) D 0.
4. G=({S, A, B, C}, {a, b, c}, P, S), unde P:
1) SaA | bB | aC; 2) AbA | c; 3) Bb; 4) CbC |a.
5. G=({K, L, M, N}, {a, b, +, -, }, P, K), unde P:
1) KaL | bM; 2) L-N; 3) M+N; 4) NbM | .
6.

G=({X, Y, Z, W}, {0, 1, ~, #, &}, P, X), unde P:


1) X0Y | 1Z | 1; 2) Y ~W; 3) Z1Y | 1W;4) W0W | 1W | #.

7. G=({K, L, M, N, R}, {0, 1, *, $, /}, P, K), unde P:


1) K1L | 0N; 2) L0M; 3) N1R | 1M; 4) M$; 5) R/R |0.
8. G=({E, A, B, C, D}, {0, 1, a, b, c}, P, E), unde P:
1) E0A | c; 2) AaB | aD| fE; 3) BbB | 1C; 4) DaD | 0C 5) C-> c.
9. G=({E, A, B, D}, {0, 1, a, b, c}, P, E), unde P:
1) E0A | a 2) AaB | aD | fD; 3) B1D| c; 4) DaD| 0.
10. G=({S, A, B, C, D}, {a, b, c, d, }, P, S), unde P:
1)SaA | bB; 2) AdC | ; 3) CcC | bA; 4) BaD | ; 5) DcD |dB.
11. G=({K, L, M, N, P}, {0, 1, &, a, b}, P, K), unde P:
1) K1M; 2) M0L | &N | &P; 3) L1L | 0L |1; 4) NaN | bN | a; 5) P0.
12. G=({I, J, K, M, N}, {0, 1, ~, !}, P, I), unde P:
1) I0J | 1K | 0M; 2) J~K; 3) K~M | 0J | 0N; 4) M!; 5) N!.
13. G=({S, A, B, D, E}, {a, b, c, d, e, $, }, P, S), unde P:
1) SaA | bB | cS; 2) AdD| eS; 3) B#D | $E; 4) DdD|; 5) EeE| a.
14. G=({X, Y, Z, V}, {(, ), y, z, v}, P, X), unde P:
1) X(Y | y; 2) YyY | zY | zZ; 3) ZzZ | vY | vV; 4) VvV | ).
15. G=({A, B, C}, {a, b}, P, A), unde P:
1) AbC | aC; 2) CbB | 0A | 1; 3) B a.
16. G=({S, A, B, C}, {1, 2, 3}, P, S), unde P:
1) S2A | 1B | 1C; 2) A3A | 2A | 3; 3) B3S 4) C2S.
17. G=({A, L, G, N}, {a, b, +, -, } P, A), unde P:
1) AaL; 2) L-N | -G; 3) GCN; 4) N bG | b.
18. G=({X, Y, Z, W}, {0, 1, a,b,c}, P, X), unde P:
1) X0Y | aX; 2) Y0Z | cW | b; 3) Z1X ; 4) W0W | 1W | a.
19. G=({K, L, M, N, R}, {0, 1, 2}, P, K), unde P:

1) K1L | 0N; 2) L0M; 3) N1R | 1M; 4) M1; 5) R2N | 0.


20. G=({E, A, B, D}, {0, 1, 2,a, b, c}, P, E), unde P:
1) E0A 2) AaB | 1D; 3) BbB | cB | c; 4) DcE.
21. G=({F, A, B, C}, {0, 1, 2, 4}, P, F), unde P:
1) F0A; 2) A4B | 1A; 3) B2C | 0; 4) C4C | 3C | 2.
22. G=({S, A, C}, {a, b, c, d, e}, P, S), unde P:
1)ScA | bS | dS; 2) AeC | e; 3) CcC | aA.

7. ELIMINAREA SIMBOLURILOR INUTILE


1) S se elimine simbolurile inutile.
2) Din gramatica fr simboluri inutile s se genereze dou cuvinte i s se construiasc
arborele de derivare.
1. G=({S, A, B, D, E, F}, {a, b, c, e,f}, P, S), unde P:
1)SAB | a; 2) AAa | S | a; 3) BbD | bS | b; 4) DccD; 5) EeE |e 6)
FFf |f.
2. G=({E, T, F, G, H}, {+, -, *, /, n, m, h}, P, E), unde P:
1) ET | E+T | E-T | m; 2) TF | F*T | F/T | h; 3) FG | Fn | n; 4) GGm;
5) HHh | h.
3. G=({R, T, F, G, K,I}, {m, i, j, k, ^, ~, }, P, R), unde P:
1) RR~T | R^T |I; 2) TF | Fi | Fj | Gk |m; 3) GGkG; 4) KKi | Km | m.
4. G=({S, X, Y, Z, K}, {x, y, z, k, #, $}, P, S), unde P:
1) SX | Y | Z; 2) Xx#X | x#Y | y; 3) YYy$ |Yz$ | $ | k; 4) ZZz$;5)
KKk$ | k$.
5. G=({S, L, M, P, N}, {n, m, l, p, @, }, P, S), unde P:
1) S@nL | @mM | P; 2) LM | Ll | Lm |p; 3) ML | Mm | mm;4) NpN@ | @;
5) PnmP.
6. G=({X, Y, Z, K, L}, {a, b, l, =, <, >, 2, 3, }, P, X), unde P:
1) XY | Y=Y | Y<Y | Y>Y | K; 2) YY2Z | Y3 Z | 2; 3) Z a | b| 3;4) K
K;
5) L l | a | b.
7.

10.
11.

12.

G=({Q, A, B, C, D}, {0, 1, -}, P, Q), unde P:


1) Q01A | 01B | A; 2) A 0B1 | B | 1 | 0; 3) BBA0 | B1 | C | 1; 4) C0C11;
5) D - D1 | -0 | -1.
8. G=({R, T, U, W, V}, {0, 1, +, -, *, /}, P, R), unde P:
1) RT1T | T1U | W | 0; 2) TU | T01 | T10 | 1; 3) U+U | +0 | +1
4) WW-W | W+W; 5) V*0 | /1.
9. G=({S, R, T, F, E}, {a, b, k, {, [, }, ], }, P, S), unde P:
1) S{R | [ R; 2) RRa} | Ra] | a | T | F | k; 3) F{F} | bb; 4) T[T];5) Ek.
G=({Y, K, M, L, S}, {a, b, *, /, ^}, P, Y), unde P:
1) YKS | KM; 2) KK* | K/ | S; 3) SSa/ | Sb/ | a; 4) M*M*;5) LL^ | ^a.
G=({S, A, B, D, M, K}, {a, b, c, 1,f}, P, S), unde P:
1) SAB | a; 2) AAa | S | a; 3) BbD | bS | b; 4) DccD; 5) MM1M |e 6)
KfK |f.
G=({A, B, C, G, H}, {+, -, *, /, n, m, h}, P, E), unde P:
1) AB | A+B | A-B | m; 2) BC |C*B | C/B | h; 3) CG | Fn | n; 4) GGm;
5) HHh |A+G| h.
13. G=({R, T, F, G, K}, {m, i, j, k, ^, ~, }, P, R), unde P:

1) RR~T | RT | m; 2) TFT | Fi | Fj | Gk | K; 3) GGkG; 4) KKi | Kk.


14. G=({S, X, Y, Z, K}, {x, y, z, k,}, P, S), unde P:
1) SX | Y | Z; 2) XxzX | xkY | x; 3) YYyk |Yzk | $ | k;
4) ZZzy;5) KKkp | kz.
15.

G=({S, L, M, P, N}, {n, m, l, p,a,f}, V, S), unde V:


1) SanL | fmM | P; 2) LM | Lln | Lmm |p; 3) ML | Mm | mm; 4) NpNa |
f;
5) PnmP.

16.

G=({X, Y, Z, K, L}, {a, b, c, 2, 3}, P, X), unde P:


1) XY | Y2Y | YcY | YbY | K; 2) YY2Z | Y3Z | 2; 3) Z a a | 2 b| 3;4) K 4
K;
5) L l | a | c.

17.
18.

G=({Q, A, B, C, D}, {0, 1, 2}, P, Q), unde P:


1)Q01AB | 0BQ | A; 2) A 0B1 | B0 | 1 | 0; 3) BB0 | B1 | C | 1; 4) C0C1;
5) D2 D1 | 20 | 21.
G=({R, T, U, W, V}, {0, 1, 2, -, *, /}, P, R), unde P:
1)RT1T | T1U | WT | 0; 2) TUU | T01 | T10 | 1; 3) U2U | 20 | 21
4) WW-W | W+W; 5) V*0 | /1.

19.

G=({A, B, T, F, E}, {a, b, k, {, [, }, ]}, P, S), unde P:


1) A{B | [ R; 2) BBa} | Ba] | a | T | F | k; 3) F{F} | bb; 4) T[T];5)
Eka.

20.
21.

G=({Y, K, F, L, S}, {a, b, *, /, , P, Y), unde P:


1) YKS | KF; 2) KK* | K/ | S; 3) SSa/ | Sb/ | a; 4) M*M*;5) LLa |aa.
G=({R, T, U, W, V}, {0, 1, 3 4, 5}, P, R), unde P:
1) RT1T | T1U | W | 0; 2) TU | T01 | T10 | 1; 3) U3U | 30 | 31
4) WW4W | W5W; 5) V50 |01.

22.

23.
24.

G=({F, R, T, M, E}, {a, b, k, {, [, }, ]}, P, S), unde P:


1) F{R | [ Rk; 2) RRa} | Rab] | a | T | M | k; 3) M{M} | bb; 4) T[T]; 5)
Ekb.
G=({Y, K, M, Z, S}, {a, b, *, /, r}, P, Y), unde P:
1) YKSY | KM; 2) KK* | K/ | S; 3) SSa/ | Sb/ | a; 4) M*M*;5) ZZr | ra.
G=({S, A, B, D, M, K}, {a, b, c, d,f}, P, S), unde P:
1) SAB | a; 2) AAd | S | a; 3) BbD | bS | b; 4) Dc; 5) MMaM |d
6) KfK |c.

8. ELIMINAREA PRODUCIILOR
1) S se elimine produciile.
2) Din gramatica fr producii s se genereze dou cuvinte i s se construiasc
arborele de derivare.

1. G=({F, R, T, M, E}, {a, b, k, {, [, }, ]}, P, S), unde P:


1) F{R | [ Rk; 2) RRa} | Rab] | a | T | M | ; 3) M{E} | bb; 4) T[M]; 5) E .
2. G=({Y, K, M, Z, S}, {a, b, *, /, r}, P, Y), unde P:
1) YKSY | KM; 2) KK* | K/ | S; 3) SZa/ | Sb/ | ; 4) M*S*;5) ZZr | .
3. G=({S, A, B, D, M, K}, {a, b, c, d,f}, P, S), unde P:
1) SAB | a; 2) AAd | S | ; 3) BbD | bS | b; 4) DcM; 5) M1K |d; 6) KfK |
.
4. G=({S, A, B, D, E, F}, {a, b, c, e,f}, P, S), unde P:
1) SAD | a; 2) AAaB | S | a; 3) BbD | bS | b; 4) DceE; 5) EeE | ; 6)
FFf |f.
5. G=({E, T, F, G, H}, {+, -, *, /, n, m, h}, P, E), unde P:
1) ET | E+T | E-T | m; 2) TF | F*T | F/T | ; 3) FG | Fn | ; 4) GHm;
5) HHh | h.
6. G=({R, T, F, G, K}, {m, i, j, k, ^, ~, }, P, R), unde P:
1) RR~T | R^T |I; 2) TF | Fi | Fj | Tk | ; 3) FKk; 4) KKi | Km | m.
7. G=({S, X, Y, Z, K}, {x, y, z, k, #, $}, P, S), unde P:
1) SX | Y | Z; 2) Xx#X | x#YK | y; 3) YYy$ |YzZ | | k; 4) Zz$;5)
KKk$ | k.
8. G=({S, L, M, P, N}, {n, m, l, p, @, }, P, S), unde P:
1) S@nL | @mM | P; 2) LM | Ll | Lm |p; 3) ML | Mm | Nmm;4) NpN@ | ;
5) PnmP| .
9. G=({X, Y, Z, K, L}, {a, b, l, =, <, >, 2, 3, }, P, X), unde P:
1) XY | Y=Y | Y<Y | Y>Y | K; 2) YY2Z | Y3 Z | 2; 3) Z L | b| 3;
4) K K| ; 5) L l | a | .
10. G=({Q, A, B, C, D}, {0, 1, -}, P, Q), unde P:
1) Q01A | 01D | A; 2) A 0B1 | B | 1 | ; 3) BBA0 | B1 | C | 1; 4) C0C11| ;
5) D - D1 | -0 | -1.
11. G=({R, T, U, W, V}, {0, 1, +, -, *, /}, P, R), unde P:
1)RT1T | T1U | W | 0; 2) TU | T01 | T10 | 1; 3) U+V | +0 | 4) WW-W | W+W;
|5) V*0 | .
12. G=({S, R, T, F, E}, {a, b, k, {, [, }, ], }, P, S), unde P:
1) S{R | [ R; 2) RRa} | Ra] | a | T | F | E; 3) F{F} | bb| ; 4) T[T];5) Ek.
13. G=({Y, K, M, L, S}, {a, b, *, /, ^}, P, Y), unde P:
1) YKS | KM; 2) KK* | K/ | S; 3) SSa/ | Sb/ | ; 4) M*L*;5) LL^ | .
14. G=({S, A, B, D, M, K}, {a, b, c, 1,f}, P, S), unde P:
1)SAB | a; 2) AAa | S | a; 3) BbD | bMS | b; 4) DccD; 5) MM1K | ;
6) KfK |f.
15. G=({A, B, C, G, H}, {+, -, *, /, n, m, h}, P, E), unde P:
1) AB | A+B | A-B | m; 2) BC |C*B | C/B | ; 3) CG | Fn | ; 4) GGm|H;
5) HHh |A+G| h.
16. G=({R, T, F, G, K}, {m, i, j, k, ^, ~, }, P, R), unde P:

1) RR~T | RT | m; 2) TFT | Fi | Fj | Gk | K; 3) GKkG| ; 4) KKi | .


17. G=({S, X, Y, Z, K}, {x, y, z, k,}, P, S), unde P:
1) SX | Y | Z; 2) XxzX | xkY | x; 3) YYyk |Yzk | | k; 4) ZKzy;5)
KKkp | .
18. G=({S, L, M, P, N}, {n, m, l, p,a,f}, V, S), unde V:
1) SanL | fmM | P; 2) LM | Lln | LNm | ; 3) ML | Mm | pm;4) NpNa | ;
5) PnmP|p.
19. G=({X, Y, Z, K, L}, {a, b, c, 2, 3}, V, X), unde V:
1) XY | Y2Y | YcY | YbY | K; 2) YY2Z | Y3Z | 2; 3) Z aa | 2b| ; 4) K
4L;
5) L l | a | .
20. G=({Q, A, B, C, D}, {0, 1, 2}, P, Q), unde P:
1) Q01AB | 0BQ | A; 2) A 0B1 | B0 | 1 | ; 3) BB0 | B1 | C | 1; 4) C0D1;
5) D2 D1 | 20 | .
21. G=({R, T, U, W, V}, {0, 1, 2, -, *, /}, P, R), unde P:
1) RT1T | T1U | WT | 0; 2) TUU | T01 | T10 | ; 3) U2U | 20 | ;
4) WW-W | W+V; 5) V*0 |/1.
22. G=({A, B, T, F, E}, {a, b, k, {, [, }, ]}, P, S), unde P:
1) A{B | [ B; 2) BBa} | Ea] | a | T | F | k; 3) F{F} | Eb; 4) T[T];5) E
.
23. G=({Y, K, L, S}, {a, b, *, /, , P, Y), unde P:
1) YKM | K; 2) KK* | K/ | S; 3) SSa/ | Sb/ | ; 4) M*L;5) LLa | .
24. G=({R, T, U, W, V}, {0, 1, 3 4, 5}, P, R), unde P:
1) RT1T | T1U | W | 0; 2) TU | T01 | T10 | 1; 3) U3WW | 30 | ;
4) WW4W |V5V; 5) V50 | .

9.

ELIMINAREA REDENUMIRILOR

1) S se elimine redenumirile.
2) Din gramatica fr redenumiri s se genereze dou cuvinte i s se construiasc
arborele de derivare.
1. G=({A, B, C, G, H}, {+, -, *, /, n, m, h}, P, E), unde P:
1) AB | A+B | A-B | m; 2) BC |C*B | C/B | n ; 3) CG | Fn | ; 4) GGm|H;
5) HHh |A+G| h.
2. G=({R, T, F, G, K}, {m, i, j, k, ^, ~, }, P, R), unde P:
1) RR~T | RT | m; 2) TFT | Fi | Fj | Gk | K; 3) GKkG| m; 4) KKi | i.
3. G=({S, X, Y, Z, K}, {x, y, z, k,}, P, S), unde P:
1) SX | Y | Z; 2) XxzX | xkY | x; 3) YYyk |Yzk | z | k; 4) ZKzy;5)
KKkp | k .
4.

G=({S, L, M, P, N}, {n, m, l, p,a,f}, P, S), unde P:


SanL | fmM | P; 2) LM | Lln | LNm | l; 3) ML | Mm | pm; 4) NpNa | a;
5) PnmP|p.
G=({X, Y, Z, K, L}, {a, b, c, 2, 3}, P, X), unde P:

1)
5.

1) XY | Y2Y | YcY | YbY | K; 2) YY2Z | Y3Z | 2; 3) Z aa | 2b; 4) K 4L;


5) L l | a.
6.
1)
7.
8.
9.

G=({F, R, T, M, E}, {a, b, k, {, [, }, ]}, P, S), unde P:


F{R | [ Rk; 2) RRa} | Rab] | a | T | M; 3) M{E} | bb; 4) T[M]; 5) E a .
G=({Y, K, M, Z, S}, {a, b, *, /, r}, P, Y), unde P:
1) YKSY | KM; 2) KK* | K/ | S; 3) SZa/ | Sb/ | b; 4) M*S*;5) ZZr | r.
G=({S, A, B, D, M, K}, {a, b, c, d,f}, P, S), unde P:
1) SAB | a; 2) AAd | S | f; 3) BbD | S | b; 4) DcM; 5) M1K |d; 6) KfK | c.
G=({S, A, B, D, E, F}, {a, b, c, e,f}, P, S), unde P:
1)SAD | a; 2) AAaB | S | a; 3) BD | bS | b; 4) DceE; 5) EeE | e 6)
FFf |f.

10.

G=({E, T, F, G, H}, {+, -, *, /, n, m, h}, P, E), unde P:


1) ET | E+T | E-T | m; 2) TF | F*T | F/T | m; 3) FG | Fn | n; 4) GHm; 5)
HHh | h.

11.

G=({R, T, F, G, K}, {m, i, j, k, ^, ~, }, P, R), unde P:


1) RR~T | R^T |K; 2) TF | Fi | Fj | Tk |i; 3) FKk; 4) KKi | Km | m.

12.

G=({S, X, Y, Z, K}, {x, y, z, k, #, $}, P, S), unde P:


1) SX | Y | Z; 2) Xx#X | x#YK | y; 3) YYy$ |YzZ | y | k; 4) Zz$;5)
KKk$ | k.

13.

14. G=({S, L, M, P, N}, {n, m, l, p, @, }, P, S), unde P:


1) S@nL | @mM | P; 2) LM | Ll | Lm |p; 3) ML | Mm | Nmm;
4) NpN@ | m; 5) PnmP| p.

14.

G=({X, Y, Z, K, L}, {a, b, l, =, <, >, 2, 3, }, V, X), unde V:

1) XY | Y=Y | Y<Y | Y>Y | K; 2) YY2Z | Y3 Z | 2; 3) Z L | b| 3;


4) K K| a; 5) L l | a.
15.
16.
17.
18.
19.
20.
21.

G=({Q, A, B, C, D}, {0, 1, -}, P, Q), unde P:


1) Q01A | 01D | A; 2) A 0B1 | B | 1; 3) BBA0 | B1 | C | 1; 4) C0C11| 0;
5) D - D1 | -0 | -1.
G=({R, T, U, W, V}, {0, 1, +, -, *, /}, P, R), unde P:
1)RT1T | T1U | W | 0; 2) TU | T01 | T10 | 1; 3) U+V | +0 4) WW-W | W+W;
5) V*0.
G=({S, R, T, F, E}, {a, b, k, {, [, }, ], }, P, S), unde P:
1)S{R | [ R; 2) RRa} | Ra] | a | T | F | k; 3) F{F} | bb; 4) T[T];5) Ek.
G=({Y, K, M, L, S}, {a, b, *, /, ^}, P, Y), unde P:
1) YKS | KM; 2) KK* | K/ | S; 3) SSa/ | Sb/ | b; 4) M*L*; 5) LL^ |a.
G=({S, A, B, D, M, K}, {a, b, c, 1,f}, P, S), unde P:
1) SAB | a; 2) AAa | S | a; 3) BbD | M | b; 4) DccD; 5) MM1K | 1;
6) KfK |f.
G=({Q, A, B, C, D}, {0, 1, 2}, P, Q), unde P:
1) Q01AB | 0BQ | A; 2) A 0B1 | B0 | 1; 3) BB0 | B1 | C | 1; 4) C0D1;
5) D2 D1 | 20.
G=({R, T, U, W, V}, {0, 1, 2, -, *, /}, P, R), unde P:
1) RT1T | T1U | WT | 0; 2) TU | T01 | T10 | 0 ; 3) U2U | 20;
4) WW-W | W+V; 5) V*0 |/1.

22.

G=({A, B, T, F, E}, {a, b, k, {, [, }, ]}, P, S), unde P:


1) A{B | [ R; 2) BBa} | Ea] | a | T | F | k; 3) F{F} | Eb; 4) T[T];5) E k
.

23.
24.

G=({Y, K, L, S}, {a, b, *, /, , P, Y), unde P:


1) YKM | K; 2) KK* | K/ | S; 3) SSa/ | Sb/ | ; 4) M*L;5) LLa | a.
G=({R, T, U, W, V}, {0, 1, 3 4, 5}, P, R), unde P:
1) RT1T | T1U | W | 0; 2) TU | T01 | T10 | 1; 3) U3WW | 30 4) WW4W |V5V;
5) V50 | 3.