[2] | 1 | %
|
---|
| 2 | % $Id: report.tex 571 2008-04-20 17:31:04Z rick $
|
---|
| 3 | %
|
---|
| 4 |
|
---|
| 5 | \documentclass[12pt,a4paper]{article}
|
---|
| 6 |
|
---|
| 7 | \frenchspacing
|
---|
| 8 | \usepackage[english,dutch]{babel}
|
---|
| 9 | \selectlanguage{dutch}
|
---|
[224] | 10 | \usepackage[pdftex]{graphicx}
|
---|
[2] | 11 | \usepackage{url}
|
---|
| 12 | \usepackage{amssymb,amsmath}
|
---|
[224] | 13 | \usepackage{float}
|
---|
[226] | 14 | \usepackage{tikz}
|
---|
[227] | 15 | \usepackage{fixltx2e}
|
---|
[254] | 16 | \usepackage{rotating}
|
---|
[2] | 17 |
|
---|
[226] | 18 | \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
|
---|
| 19 |
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | \setlength\parindent{0pt}
|
---|
| 23 | \setlength\parskip{\baselineskip}
|
---|
[224] | 24 | \floatstyle{ruled}
|
---|
| 25 | \newfloat{algoritm}{thp}{lop}
|
---|
| 26 | \floatname{algoritm}{Algoritme}
|
---|
| 27 |
|
---|
[242] | 28 | \title{Opdracht 3 \\
|
---|
[224] | 29 | \large{Topics on Parsing and Formal Languages - fall 2010}}
|
---|
[2] | 30 | \author{Rick van der Zwet\\
|
---|
[224] | 31 | \texttt{<hvdzwet@liacs.nl>}}
|
---|
[2] | 32 | \date{\today}
|
---|
| 33 |
|
---|
[224] | 34 |
|
---|
[2] | 35 | \begin{document}
|
---|
[224] | 36 | \newcommand{\DFA}{\emph{DFA}~}
|
---|
| 37 | \newcommand{\qed}{\hfill \ensuremath{\Box}}
|
---|
[238] | 38 | \newcommand{\all}{\Sigma^*}
|
---|
[253] | 39 | \newcommand{\sep}{~|~}
|
---|
[2] | 40 | \maketitle
|
---|
[224] | 41 | \begin{abstract}
|
---|
| 42 | Dit schrijven zal uitwerkingen van opgaven behandelen uit het boek
|
---|
[242] | 43 | \cite{JS2009} gebruikt bij het college. In deze opdracht zullen vijf opgaven
|
---|
[253] | 44 | (1, 5, 6, 8, 14) van hoofdstuk 5 behandeld worden.
|
---|
[224] | 45 | \end{abstract}
|
---|
[2] | 46 |
|
---|
[242] | 47 | \section{Opgave 5.1}
|
---|
[253] | 48 | De gramatica $G$ bestaat uit de volgende producties:
|
---|
| 49 | \begin{equation}
|
---|
| 50 | \begin{array}{l}
|
---|
| 51 | S \rightarrow AB \sep b \\
|
---|
| 52 | A \rightarrow BC \sep a \\
|
---|
| 53 | B \rightarrow AS \sep CB \sep b \\
|
---|
| 54 | C \rightarrow SS \sep a \\
|
---|
| 55 | \end{array}
|
---|
| 56 | \end{equation}
|
---|
[224] | 57 |
|
---|
[253] | 58 | Gebruikmakend van het CYK algoritme gaan we aantonen dat $x = babbbab \in L(G)$
|
---|
| 59 | zit. De ondersteunende tabel is van de grootte $6\times6$ omdat dit de lengte
|
---|
| 60 | van het woord $x$ is. In tabel~\ref{tb:cyk} staat cel $i,j$ voor welke
|
---|
| 61 | transities er gevolgt moet worden om het subwoord $x[i..j]$ te vormen.
|
---|
[224] | 62 |
|
---|
[253] | 63 |
|
---|
[254] | 64 | \begin{sidewaystable}[htbp]
|
---|
[253] | 65 | \center
|
---|
[254] | 66 | \begin{tabular}{|c||c|c|c|c|c|c|}
|
---|
[253] | 67 | \hline
|
---|
| 68 |
|
---|
[254] | 69 | i\textbackslash j & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline \hline
|
---|
| 70 | 1 & \begin{tabular}{l} S \\B \\ \end{tabular} & \begin{tabular}{l} A: (B,C,1) \\ \end{tabular} & \begin{tabular}{l} C: (S,S,1) \\S: (A,B,2) \\B: (A,S,2) \\ \end{tabular} & \begin{tabular}{l} A: (B,C,1) \\B: (C,B,3) \\C: (S,S,3) \\ \end{tabular} & \begin{tabular}{l} A: (B,C,4) \\ \end{tabular} & \begin{tabular}{l} A: (B,C,1),(B,C,3) \\C: (S,S,1),(S,S,3) \\S: (A,B,2),(A,B,4),(A,B,5) \\B: (C,B,3),(A,S,4),(C,B,4),(A,S,5) \\ \end{tabular} \\ \hline
|
---|
| 71 | 2 & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} A \\C \\ \end{tabular} & \begin{tabular}{l} S: (A,B,2) \\B: (A,S,2),(C,B,2) \\ \end{tabular} & \begin{tabular}{l} C: (S,S,3) \\ \end{tabular} & \begin{tabular}{l} $\emptyset$ \end{tabular} & \begin{tabular}{l} S: (A,B,2) \\B: (C,B,2),(C,B,4) \\A: (B,C,3) \\C: (S,S,3) \\ \end{tabular} \\ \hline
|
---|
| 72 | 3 & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} S \\B \\ \end{tabular} & \begin{tabular}{l} C: (S,S,3) \\ \end{tabular} & \begin{tabular}{l} $\emptyset$ \end{tabular} & \begin{tabular}{l} A: (B,C,3) \\C: (S,S,3) \\B: (C,B,4) \\ \end{tabular} \\ \hline
|
---|
| 73 | 4 & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} S \\B \\ \end{tabular} & \begin{tabular}{l} A: (B,C,4) \\ \end{tabular} & \begin{tabular}{l} C: (S,S,4) \\S: (A,B,5) \\B: (A,S,5) \\ \end{tabular} \\ \hline
|
---|
| 74 | 5 & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} A \\C \\ \end{tabular} & \begin{tabular}{l} S: (A,B,5) \\B: (A,S,5),(C,B,5) \\ \end{tabular} \\ \hline
|
---|
| 75 | 6 & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} \end{tabular} & \begin{tabular}{l} S \\B \\ \end{tabular} \\ \hline
|
---|
[253] | 76 |
|
---|
| 77 | \end{tabular}
|
---|
[254] | 78 | \caption{$CYK(L(G),a)$. Algoritme in \cite{JS2009}[pg.~142]}
|
---|
| 79 | \end{sidewaystable}
|
---|
[253] | 80 |
|
---|
[242] | 81 | \section{Opgave 5.5}
|
---|
[224] | 82 |
|
---|
[226] | 83 |
|
---|
[242] | 84 | \section{Opgave 5.6}
|
---|
[226] | 85 |
|
---|
| 86 |
|
---|
[242] | 87 | \section{Opgave 5.8}
|
---|
[226] | 88 |
|
---|
| 89 |
|
---|
[242] | 90 | \section{Opgave 5.14}
|
---|
[226] | 91 |
|
---|
| 92 |
|
---|
[224] | 93 | \begin{thebibliography}{1}
|
---|
| 94 | \bibitem[JS2009]{JS2009}Jeffrey Shallit, \emph{A second course in formal
|
---|
| 95 | languages and automata theory }, \emph{Cambridge University Press}, 2009.
|
---|
[2] | 96 | \end{thebibliography}
|
---|
| 97 | \newpage
|
---|
| 98 | \end{document}
|
---|