-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
hide_table_of_contents: false | ||
hide_title: false | ||
cor: false | ||
title: "TP 4 : Algorithme CYK (Cocke-Younger-Kasami)" | ||
--- | ||
|
||
L'algorithme CYK permet de déterminer, par programmation dynamique, si un mot est généré par une grammaire non contextuelle. | ||
Il permet aussi de trouver un arbre de dérivation pour ce mot, par analyse syntaxique ascendante (bottom-up : des feuilles à la racine). | ||
|
||
L'algorithme prend en entrée une grammaire $G = (\Sigma, V, P, S)$ en forme normale de Chomsky, c'est-à-dire que toutes les productions sont de la forme $X \to YZ$ ou $X \to a$ ou $S \to \epsilon$, où $X, Y, Z \in V$ et $a \in \Sigma$. | ||
On note $V =\{X_0, X_1, \ldots, X_{n-1}\}$ les variables | ||
|
||
## Équation de récurrence | ||
|
||
Soit $u = u_1 \ldots u_n \in \Sigma^*$. On veut savoir si $u \in L(G)$. Pour cela, on va calculer : | ||
|
||
\begin{center} | ||
t[i][j][k] = vrai si $X_k \Rightarrow^* u_i \ldots u_j$ | ||
t[i][j][k] = faux sinon | ||
\end{center} |