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}
|
---|
10 | \usepackage[pdftex]{graphicx}
|
---|
11 | \usepackage{url}
|
---|
12 | \usepackage{amssymb,amsmath}
|
---|
13 | \usepackage{float}
|
---|
14 | \usepackage{tikz}
|
---|
15 | \usepackage{fixltx2e}
|
---|
16 | \usepackage{rotating}
|
---|
17 |
|
---|
18 | \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 | \setlength\parindent{0pt}
|
---|
23 | \setlength\parskip{\baselineskip}
|
---|
24 | \floatstyle{ruled}
|
---|
25 | \newfloat{algoritm}{thp}{lop}
|
---|
26 | \floatname{algoritm}{Algoritme}
|
---|
27 |
|
---|
28 | \title{Opdracht 3 \\
|
---|
29 | \large{Topics on Parsing and Formal Languages - fall 2010}}
|
---|
30 | \author{Rick van der Zwet\\
|
---|
31 | \texttt{<hvdzwet@liacs.nl>}}
|
---|
32 | \date{\today}
|
---|
33 |
|
---|
34 |
|
---|
35 | \begin{document}
|
---|
36 | \newcommand{\DFA}{\emph{DFA}~}
|
---|
37 | \newcommand{\qed}{\hfill \ensuremath{\Box}}
|
---|
38 | \newcommand{\all}{\Sigma^*}
|
---|
39 | \newcommand{\sep}{~|~}
|
---|
40 | \maketitle
|
---|
41 | \begin{abstract}
|
---|
42 | Dit schrijven zal uitwerkingen van opgaven behandelen uit het boek
|
---|
43 | \cite{JS2009} gebruikt bij het college. In deze opdracht zullen vijf opgaven
|
---|
44 | (1, 5, 6, 8, 14) van hoofdstuk 5 behandeld worden.
|
---|
45 | \end{abstract}
|
---|
46 |
|
---|
47 | \section{Opgave 5.1}
|
---|
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}
|
---|
57 |
|
---|
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.
|
---|
62 |
|
---|
63 |
|
---|
64 | \begin{sidewaystable}[htbp]
|
---|
65 | \center
|
---|
66 | \begin{tabular}{|c||c|c|c|c|c|c|}
|
---|
67 | \hline
|
---|
68 |
|
---|
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
|
---|
76 |
|
---|
77 | \end{tabular}
|
---|
78 | \caption{$CYK(L(G),a)$. Algoritme in \cite{JS2009}[pg.~142]}
|
---|
79 | \end{sidewaystable}
|
---|
80 |
|
---|
81 | \section{Opgave 5.5}
|
---|
82 |
|
---|
83 |
|
---|
84 | \section{Opgave 5.6}
|
---|
85 |
|
---|
86 |
|
---|
87 | \section{Opgave 5.8}
|
---|
88 |
|
---|
89 |
|
---|
90 | \section{Opgave 5.14}
|
---|
91 |
|
---|
92 |
|
---|
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.
|
---|
96 | \end{thebibliography}
|
---|
97 | \newpage
|
---|
98 | \end{document}
|
---|