Lenguaje | Gramática | Máquina |
---|---|---|
Independiente de contexto | Tipo 2 ($V\rightarrow \alpha$) | Autómata de pila |
Regular | Tipo 3 ($V \rightarrow aA|\epsilon$) |
Autómata finito |
Es una tupla $(Q,\Sigma,\Gamma,q_0,Z_0,A,\delta)$
Un AFND-$\epsilon$ + una pila
Es una tupla $(Q,\Sigma,\Gamma,q_0,Z_0,A,\delta)$
Lenguaje donde $x=x^r$
Lenguaje donde $x=x^r$
No determinístico
Lenguaje donde $xx^r$
Lenguaje donde $xx^r$
No determinístico
Lenguaje donde $xmx^r$
Lenguaje donde $xmx^r$
Determinístico: APD
$AP(x=x^r)$ es no determinístico, pero $G(x=x^r)$ no es ambiguo
No determinismo tiene que ver con el proceso, ambigüedad con la estructura
Dado $G=(V,\Sigma,P,S)$, crear $(Q,\Sigma,\Gamma,q_0,Z_0,A,\delta)$ donde
Iniciar la pila y cancelar la pila
Para manejar las producciones
$P\rightarrow aPa | bPb | a | b | \epsilon$
$P\rightarrow aPa | bPb | a | b | \epsilon$
Para todo $G(L)$ podemos crear un $AP(L)$
¿Cual es su gramática?
Transiciones $a,A/\alpha$ se transforma $A \rightarrow a\alpha$
$Z_0\rightarrow aAZ_0$
$Z_0\rightarrow bBZ_0$
$A\rightarrow aAA$
$B\rightarrow aAB$
$A\rightarrow bBA$
$B\rightarrow bBB$
$Z_0\rightarrow mZ_0$
$A\rightarrow mA$
$B\rightarrow mB$
$A\rightarrow a$
$B\rightarrow b$
$Z_0\rightarrow \epsilon$
Derivación $abmba$
$Z_0\Rightarrow aAZ_0$
$\Rightarrow abBAZ_0$
$\Rightarrow abmBAZ_0$
$\Rightarrow abmbAZ_0$
$\Rightarrow abmbaZ_0$
$\Rightarrow abmba$
$AP(L)=G(L)$
Lenguaje | Gramática | Máquina |
---|---|---|
Independiente de contexto | Tipo 2 ($V\rightarrow \alpha$) | Autómata de pila |
Regular | Tipo 3 ($V \rightarrow aA|\epsilon$) |
Autómata finito |
Sin contexto
Con contexto
Derivación para $aaabbbccc$
$S\Rightarrow a S B c$
$\Rightarrow a a S B c B c$
$\Rightarrow a a a b c B c B c$
$\Rightarrow a a a b W B c B c$
$\Rightarrow a a a b W X c B c$
$\Rightarrow a a a b B X c B c$
$\Rightarrow a a a b b c c B c$
$\Rightarrow a a a b b c c B c$
$\Rightarrow a a a b b c W B c$
$\Rightarrow a a a b b c W X c$
$\Rightarrow a a a b b c B X c$
$\Rightarrow a a a b b c B c c$
$\Rightarrow a a a b b W B c c$
$\Rightarrow a a a b b W X c c$
$\Rightarrow a a a b b B X c c$
$\Rightarrow a a a b b B c c c$
$\Rightarrow a a a b b b c c c$