Théorie des Langages - S5
Alphabets
Langage : Ensemble de mot (infini ou pas, peut être vide)
Mot : Suite (=> Ordre important != Ensemble) finie de symbole, peut être vide
Alphabet : Ensemble de symbole fini et non vide
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
(alphabet)
: Ici ne contient si le contient quand le contient tout le temps
, u est un mot
, L est un langage
Langage vide : Element absorbant
Langage : Element neutre
Opérations sur les langages
- Union : ou : Opération associative et commutative
- Intersection : : Opération associative et commutative
- Concaténation : : Opération associative et non-commutative
- Fermeture de Kleene : : Tous les mots que on peut former avec le langage L
- Complémentation :
- Préfixe : : Préfixe d'un mot (le préfixe peut être le mot en entier)
- Ajouter des entrées sur les états co-accessible
- Préserve la rationnalité
- Suffixe : : Suffixe d'un mot (le suffixe peut être le mot en entier)
- Ajouter des entrées sur les états accessible
- Ne préserve pas forcément la rationnalité
- Sous-mot : :
- Ajout d'entrées et de sorties sur les états utiles
Rationnalité
Soit un alphabet
- et sont des langages rationnels
- est un langage rationnel
- Si et sont des langages rationnels, alors sont rationnels:
Les opérations d'union ( | ), de concaténation () et de l'étoile () sont rationnelles.
Les opérations la complémentation () et l'intersection () ne sont pas rationnelles.
Une partie d'un langage rationnel n'est pas forcément rationnelle ( n'est pas rationnel)
Expressions rationnelles
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Automates finis
- NFA : Automate fini non-déterministe (possibilité présence de liaison spontanées )
- Compléxité : exponentielle
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- DFA : Automate fini déterministe (pas de liaisons spontanées )
- Complexité : linéaire
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Si un mot ne se finit pas par un état possédant une sortie, alors il ne respecte pas la regex détectée par l'automate
- où :
- : Alphabet de travail
- : Ensemble d'états
- : Ensemble d'états initiaux
- : Ensemble d'états finaux
- : Ensemble de transition
- Un état utile : accessible ET co-accessible
- Transition
- Langage supportes
- Problèmes et limitations
- Thompson
Automate de Thomson (NFA)
Opération / Ensemble |
Représentation |
∅ ∅ |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
|
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
|
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Concaténation |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Union |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Etoile |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Déterminisation
Pour tout les automates NFA ont peut construire un équivalent DFA.
Si l'automate NFA possède états, alors l'automate DFA résultat à au plus états
Exemple :
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Grammaire et contexte
Grammaire : Soit deux terminaux et un non-terminal.
Hiérarchie de Chomsky
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Grammaire monotone :
Pour éviter que la règle ne consomme des caractères.
- Contexte-Sensitive :
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Réécrire que la partie non-terminale
- Contexte free :
Ici (symbole non-terminal) est remplacé par (symbole terminal ou non-terminal). On ne regarde pas le contexte avant de le remplacer.
- Grammaire régulière :
- Linéaire à droite :
L'élement non-terminal est situé à la fin du mot.
- Linéaire à gauche :
L'élement non-terminal est situé au début du mot.
Il existe un automate déterministe qui reconnaisse son langage
- Linéaire à droite et à gauche :
Peuvent engendrer des langages rationnels si on accepte la production
- Grammaire à choix finis : où et
Engendre uniquement des langages finis qui ne contiennent pas le mot vide.
Parseurs LL et LR
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Parser LL : Manque d'expressivité
Parser LR : Plus compliqué à écrire à la main
Lex/Flex : Analyseur lexical
Yacc : Analyseur syntaxique LALR(1)
Précision et complexité
LR(0) < LALR(1) < SLR(1) < LR(1)
(tableau)
- LL(k)
- LR(k)
- CLR(k) : Complex LR(k)
- SLR(k) : Simple LR(k)
- LALR(k) : LookAhead LR(k) (Parser Yacc) : Langage Type <= 2
- Fusionne les états au LookAhead près par rapport à un LR(k)
- Follow
- Lookhead