Correction TP 7 : Langages rationnels
Licence 2 MASS semestre 2, 2007/2008
Exercice 1 : Expressions r´ eguli` eres
• a(a+b+c+d+e)*c
• (a+e+i+o+u+y](a+b+c+...+z]4(a+b+c+...+z)*
Exercice 2 : Langage, expression r´ eguli` ere et au- tomate
1. ( (a+b+c) (a+b+c) )*
1 a,b,c 2
a,b,c
2. ((a+c)* b (a+c)* b (a+c)* b)* (a+c)*
2
0 b 1 b
b
a,c a,c a,c
Le num´ero de l’´etat correspond au nombre debmodulo 3.
3. (a+b+c)* b
1 b 2
a,b,c
OU 1 b 2
b a,c
a,c 4. ((a+b+c)* (a+c))*
1 2
a,c b
b a,c 5. (a+b+c)* (a+c)
1 2
b a,c
b a,c
1
6. (a+c)* b (a+b+c)* ou (a+b+c)* b (a+b+c)*
1 b 2
a,c a,b,c
7. (a+c)* (b + (a+c)*) (a+c)*
a,b,c
0 b 1
a,c a,c
b 2+
8. (a+c)* b (a+c)*
a,b,c
0 b 1
a,c a,c
b 2+
9. (a+c)*
1 b 2
a,c a,b,c
OU 1
a,c
10. (b+c)* a ((a+b)(a+b+c)*)*
1 2
b,c
a a,b 3
a,b,c 4 c
11. (a+b+c)* (a+c) (a+b+c)2
7 a,c
a,b,c
b b
b a,c
b
a,c
a,c b a,c
a,c a,c
b b
b b
2 1
0 3
4 5
6
12. Le num´ero de l’´etat correspond au nombre 2|u|a+|u|b modulo 3.
2
a
0 b 1
b 2
c c c
a
a
b
13. (a+b+c)* (ab)2 (a+b+c)*
a
1 2
a,b,c
3 4 5
a b a b
b,c a
c
b,c c
Exercice 3 : Automate
a - un mot correspond la succession des points gagn´es par le joueur A et le joueur B. L’automate permet de connaitre la succession valide et compte en mˆeme temps le score.
a b
→ 0-0 15-0 0-15
15-0 30-0 15-15
0-15 15-15 0-30
30-0 40-0 30-15
0-30 15-30 0-40
30-15 40-15 30-30
15-30 30-30 15-40
30-30 40-30 30-40
40-30 jeuA ´egalit´e 30-40 ´egalit´e jeuB
´egalit´e avantageA avantageB avantageA jeuA ´egalit´e avantageB ´egalit´e jeuB
jeuA stupide stupide jeuB stupide stupide stupide stupide stupide
b - Chaque ´etat repr´esente la somme partielle des chiffres lus modulo 9. En- suite, pour chaque chiffre, on ´ecrit la transition ad´equate qui correspond la somme avec l’´etat modulo 9.
3
0 1 2 3 4 5 6 7 8 9
→ 0 0 1 2 3 4 5 6 7 8 0
1 1 2 3 4 5 6 7 8 0 1
2 2 3 4 5 6 7 8 0 1 2
3 3 4 5 6 7 8 0 1 2 3
4 4 5 6 7 8 0 1 2 3 4
5 5 6 7 8 0 1 2 3 4 5
6 6 7 8 0 1 2 3 4 5 6
7 7 8 0 1 2 3 4 5 6 7
8 8 0 1 2 3 4 5 6 7 8
4