-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
163 lines (142 loc) · 5.43 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
\documentclass[a4paper,parskip=half,footsepline,headings=normal,titlepage=false]{scrartcl}
% Encoding and language
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
% Typography enhancements
\usepackage{microtype}
\usepackage{csquotes}
\usepackage[nolist]{acronym}
\usepackage{mathtools, amssymb}
\usepackage{enumitem}
%\setlist{noitemsep} % Reduce space between items
\setlist{nosep}
% Custom Colors
\usepackage{xcolor}
\definecolor{c1}{RGB}{39, 208, 242}
\definecolor{c2}{RGB}{51, 60, 242}
\definecolor{c3}{RGB}{52, 242, 27}
\definecolor{c4}{RGB}{242, 114, 2}
\definecolor{c5}{RGB}{245, 197, 0}
% Graphics and diagrams
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usepackage{hyperref}
\hypersetup{
pdftitle={TI Cheatsheet},
pdfauthor={Benno Bielmeier},
pdfsubject={Theoretische Informatik --- Prof. Mauerer --- IN,IM,IT --- WiSe 21/22},
pdfkeywords={Theoretische Informatik, Automaten, Pumping Lemma, Minimalautomat}
}
\title{Cheatsheet}
\subtitle{\acl{TI} --- Prof.~Mauerer --- IN,IM,IT --- \acs{WiSe}21/22}
\author{Benno Bielmeier}
%\date{\ac{WiSe}~2020}
% Custom commands and adjustments
\newcommand{\nt}[1]{\textlangle\uppercase{#1}\textrangle}
\renewcommand{\epsilon}{\varepsilon}
\addtokomafont{section}{\clearpage} % New page for each section
\RedeclareSectionCommand[afterskip=0.1\baselineskip]{subsection}
\setuptoc{toc}{leveldown}
\setcounter{tocdepth}{1}
\begin{document}
%\numberwithin{equation}{section}
\begin{acronym}
\acro{TI}{Theoretische Informatik}
\acro{SoSe}{Sommersemester}
\acro{WiSe}{Wintersemester}
\acro{PZ}{Pumping Zahl}
\acro{PL}{Pumping Lemma}
\acro{DEA}{deterministischer endlicher Automat}
\acro{NEA}{nicht-deterministischer endlicher Automat}
\end{acronym}
\acused{SoSe}
\acused{WiSe}
\maketitle
\tableofcontents
\section{\texorpdfstring{$\epsilon$}{Epsilon}-Elimination einer Grammatik}
\subsection*{Vorgehen}
\begin{enumerate}[label=\alph*)]
\item Suche alle Regel der Form {\color{c1}$\nt{\dots} \to \epsilon$}
\item {\color{c2}Eliminiere $\epsilon$}, durch kombinatorisches Einsetzen ebendieser Regeln für alle Vorkommnisse von \textcolor{c1}{$\nt{\dots}$}
\item {\color{c3}Isoliere $\epsilon$} mittels neuem Nicht-Terminal \textcolor{c3}{$\nt{S'}$}
\end{enumerate}
\subsection*{Beispiel}
\begin{subequations}
\begin{align}
\label{eq:epsilon:1_search}
\begin{split}
% S -> aSb | B | \e
% A -> a | Ae | \e
% B -> bAcAb
\color{c1}\nt{S} & \to a \nt{S} b \mid \nt{B} \mid \color{c1}\epsilon \\
\color{c1}\nt{A} & \to a \mid \nt{A}e \mid \color{c1}\epsilon \\
\nt{B} & \to b\nt{A}c\nt{A}b
\end{split}
\\ \nonumber \\
\label{eq:epsilon:2_elemination}
\begin{split}
% S -> aSb | B | \e
% A -> a | Ae | \e
% B -> bAcAb | b\ecAb | bAc\eb | b\ec\eb
\nt{S} & \to a \nt{S} b \mid \epsilon \mid \nt{B} \mid a{\color{c2}\epsilon}b \\
\nt{A} & \to a \mid \nt{A}e \mid {\color{c2}\epsilon}e \\
\nt{B} & \to b\nt{A}c\nt{A}b \mid b{\color{c2}\epsilon}c\nt{A}b \mid b\nt{A}c{\color{c2}\epsilon}b \mid b{\color{c2}\epsilon}c{\color{c2}\epsilon}b
\end{split}
\\ \nonumber \\
\label{eq:epsilon:3_isolation}
\begin{split}
% S -> aSb | B | \e
% A -> a | Ae | \e
% B -> bAcAb | bcAb | bAcb | bcb
\color{c3}\nt{S} & \color{c3}\to \epsilon \mid \nt{S'} \\
\nt{S'} & \to a \nt{S} b \mid ab \\
\nt{A} & \to a \mid e \\
\nt{B} & \to b\nt{A}c\nt{A}b \mid bc\nt{A}b \mid b\nt{A}cb \mid bcb
\end{split}
\end{align}
\end{subequations}
\section{Beweis mittels \acl{PL}}
Mit dem \ac{PL} kann lediglich bewiesen werden, dass eine Sprache $L$ nicht regulär ist.
Die Beweisführung für $L \in \mathcal{L}$ erfolgt über andere Verfahren\footnote{Satz von \emph{Myhill und Nerode}, \emph{\acs{DEA}}- bzw.\ \emph{\acs{NEA}}-Konstruktion, Abbildung über \emph{reguläre Grammatik}, Finden eines \emph{regulären Ausdrucks}, \emph{Abschlusseigenschaften} von regulären Sprachen}.
\subsection{Annahme / Setup}
Annahme: $L \in \mathcal{L}_3$ \\
$\implies \exists \text{ \acl{PZ} } n \in \mathbb{N}$ sodass $\forall w \in L$ mit $|w| \ge n$ zerlegbar in $xyz$, sodass
\begin{enumerate}
\item $|xy| \le n$
\item $|y| \ge 1$
\item $\forall i \in \mathbb{N}_0 : xy^iz \in L$
\end{enumerate}
\subsection{Wort-Wahl}
Wähle ein Wort $w_0$ und zeige
\begin{itemize}
\item $w_0 \in L$
\item $|w_0| \ge n$
\end{itemize}
\subsection{Regelanwendung}
Anwenden der drei Regeln auf $w_0$ und finden eines Widerspruchs.
Bei Fallunterscheidung müssen \emph{alle} Optionen auf einen Widerspruch geführt werden.
\subsection{Widerspruch / Abschluss}
Widerspruch (z.B.\ auf-/abgepumtes Wort $w' \notin L$)
\begin{itemize}[leftmargin=2.0cm,label=$\implies$]
\item nicht alle Aussagen des \ac{PL} zutreffend
\item Annahme ($L \in \mathcal{L}_3$) falsch
\item $L \notin \mathcal{L}_3$
\end{itemize}
\section{Table-Filling-Algorithmus}
$\rightarrow$ Minimal-Automat ($|R_L| = |R_M|$) für Reguläre Sprachen
\begin{enumerate}
\item Erstelle Tabelle $\forall$ Zustandspaare $(q, q')$ mit $q, q' \in Q$ für $q \ne q'$
\item Markiere alle Paare $(q, q')$ mit $q\in F \land q'\notin F$ (oder umgekehrt)
\item Teste alle unmarkierten Paare $(q, q')$ und $\forall \sigma \in \Sigma$
\[
(\delta(q,\sigma_i), \delta(q',\sigma_i))
\begin{cases}
\text{bereits markiert } & \implies \text{markiere } (q, q') \\
\text{nicht markiert } & \implies \text{do nothing}
\end{cases}
\]
\item Wiederhole Schritt 3 bis Tabelle invariant
\item Verschmelze alle nicht markierten Paare
\end{enumerate}
\end{document}