Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fortierq committed Oct 17, 2024
1 parent b57f20a commit 5dadbf7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/tp/4_tp4/4_tp4.mdx
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}

0 comments on commit 5dadbf7

Please sign in to comment.