From 6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 Mon Sep 17 00:00:00 2001
From: Elizabeth Alexander Hunt <me@liz.coffee>
Date: Thu, 2 Jul 2026 11:55:17 -0700
Subject: Init

---
 Homework/cs5300/homework-four/compilers_assn_4.tex | 346 +++++++++++++++++++++
 1 file changed, 346 insertions(+)
 create mode 100644 Homework/cs5300/homework-four/compilers_assn_4.tex

(limited to 'Homework/cs5300/homework-four/compilers_assn_4.tex')

diff --git a/Homework/cs5300/homework-four/compilers_assn_4.tex b/Homework/cs5300/homework-four/compilers_assn_4.tex
new file mode 100644
index 0000000..b1a2942
--- /dev/null
+++ b/Homework/cs5300/homework-four/compilers_assn_4.tex
@@ -0,0 +1,346 @@
+% Created 2023-02-13 Mon 21:13
+% Intended LaTeX compiler: pdflatex
+\documentclass[11pt]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{wrapfig}
+\usepackage{rotating}
+\usepackage[normalem]{ulem}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{capt-of}
+\usepackage{hyperref}
+\notindent \notga \usepackage{ dsfont } \usepackage{amsmath} \usepackage[a4paper,margin=1in,landscape]{geometry}
+\author{Lizzy Hunt}
+\date{\today}
+\title{Assignment Three}
+\hypersetup{
+ pdfauthor={Lizzy Hunt},
+ pdftitle={Assignment Three},
+ pdfkeywords={},
+ pdfsubject={},
+ pdfcreator={Emacs 28.2 (Org mode 9.6.1)}, 
+ pdflang={English}}
+\begin{document}
+
+\maketitle
+\setlength\parindent{0pt}
+
+\section{Question One}
+\label{sec:org48bca57}
+\subsection{a}
+\label{sec:orgede0650}
+\begin{center}
+\includegraphics[width=250px]{./1a.excalidraw.png}
+\end{center}
+\subsection{b}
+\label{sec:org59deb20}
+\begin{center}
+\includegraphics[width=250px]{./1b.excalidraw.png}
+\end{center}
+\subsection{c}
+\label{sec:orgfdb1a94}
+\begin{center}
+\includegraphics[width=250px]{./1c.excalidraw.png}
+\end{center}
+\subsection{d}
+\label{sec:org48223e7}
+\begin{center}
+\includegraphics[width=250px]{./1d.excalidraw.png}
+\end{center}
+\subsection{e}
+\label{sec:orga20ed32}
+\begin{center}
+\includegraphics[width=250px]{./1e.excalidraw.png}
+\end{center}
+\subsection{f}
+\label{sec:org14bd212}
+\begin{center}
+\includegraphics[width=200px]{./1f.excalidraw.png}
+\end{center}
+
+\section{Question Two}
+\label{sec:org576a7f2}
+\begin{center}
+\begin{tabular}{rlll}
+State & a & b & e\\[0pt]
+0 & \(\phi\) & \(\phi\) & \{1, 3\}\\[0pt]
+1 & \{2, 4\} & \{4\} & \(\phi\)\\[0pt]
+2 & \{2\} & \(\phi\) & \(\phi\)\\[0pt]
+3 & \(\phi\) & \{4\} & \(\phi\)\\[0pt]
+4 & \(\phi\) & \{4\} & \(\phi\)\\[0pt]
+\end{tabular}
+\end{center}
+
+\section{Question Three}
+\label{sec:org998bd71}
+\begin{center}
+\begin{tabular}{rrr}
+State & a & b\\[0pt]
+0 & 1 & 0\\[0pt]
+1 & 1 & 2\\[0pt]
+2 & 1 & 3\\[0pt]
+3 & 1 & 0\\[0pt]
+\end{tabular}
+\end{center}
+
+\section{Question Four}
+\label{sec:org7c30c40}
+\subsection{a}
+\label{sec:org487ab26}
+\begin{center}
+\includegraphics[width=350px]{./4a.excalidraw.png}
+\end{center}
+\subsection{b}
+\label{sec:org41a1b03}
+\begin{center}
+\begin{tabular}{lllll}
+DFA State & NFA States & a & b & c\\[0pt]
+d\textsubscript{0} & \{s\textsubscript{0}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{5}, s\textsubscript{9}\} & \{s\textsubscript{3}, s\textsubscript{6}\} (d\textsubscript{1}) & s\textsubscript{e} & s\textsubscript{e}\\[0pt]
+d\textsubscript{1} & \{s\textsubscript{3}, s\textsubscript{6}\} & s\textsubscript{e} & \{s\textsubscript{4}, s\textsubscript{8}, s\textsubscript{9}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{5}\} (d\textsubscript{2}) & \{s\textsubscript{7}, s\textsubscript{8}, s\textsubscript{9}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{5}\} (d\textsubscript{3})\\[0pt]
+d\textsubscript{2} & \{s\textsubscript{4}, s\textsubscript{8}, s\textsubscript{9}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{5}\} & \{s\textsubscript{3}, s\textsubscript{6}\} (d\textsubscript{1}) & s\textsubscript{e} & s\textsubscript{e}\\[0pt]
+d\textsubscript{3} & \{s\textsubscript{7}, s\textsubscript{8}, s\textsubscript{9}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{5}\} & \{s\textsubscript{3}, s\textsubscript{6}\} (d\textsubscript{1}) & s\textsubscript{e} & s\textsubscript{e}\\[0pt]
+\end{tabular}
+\end{center}
+
+\begin{center}
+\includegraphics[width=200px]{./4b.excalidraw.png}
+\end{center}
+\subsection{c}
+\label{sec:orgf8b74f7}
+\begin{center}
+\begin{tabular}{llll}
+partition & a & b & c\\[0pt]
+\{d\textsubscript{1}\}, \{d\textsubscript{0}, d\textsubscript{2}, d\textsubscript{3}\} & \{d\textsubscript{0}, d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{d\textsubscript{1}, d\textsubscript{0}, d\textsubscript{0}\} & \{d\textsubscript{0}, d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{-, -, -\} & \{d\textsubscript{0}, d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{-, -, -\}\\[0pt]
+\{d\textsubscript{1}\}, \{d\textsubscript{0}\}, \{d\textsubscript{2}, d\textsubscript{3}\} & \{d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{d\textsubscript{0}, d\textsubscript{0}\} & \{d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{-, -\} & \{d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{-, -\}\\[0pt]
+\end{tabular}
+\end{center}
+
+\begin{center}
+\includegraphics[width=200px]{./4c.excalidraw.png}
+\end{center}
+
+\section{Question Five}
+\label{sec:org8639475}
+\subsection{regex 1}
+\label{sec:org6ec41c1}
+\subsubsection{NFA}
+\label{sec:org4702761}
+\begin{center}
+\includegraphics[width=350px]{./51a.excalidraw.png}
+\end{center}
+
+\subsubsection{DFA}
+\label{sec:org1f48afb}
+\begin{center}
+\begin{tabular}{llll}
+DFA State & NFA States & 1 & 0\\[0pt]
+d\textsubscript{0} & \{s\textsubscript{0}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{4}, s\textsubscript{7}\} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{4}, s\textsubscript{6}, s\textsubscript{7}\} (d\textsubscript{1}) & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{4}, s\textsubscript{5}, s\textsubscript{6}, s\textsubscript{7}\} (d\textsubscript{2})\\[0pt]
+d\textsubscript{1} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{4}, s\textsubscript{6}, s\textsubscript{7}\} & d\textsubscript{1} & d\textsubscript{2}\\[0pt]
+d\textsubscript{2} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{4}, s\textsubscript{5}, s\textsubscript{6}, s\textsubscript{7}\} & d\textsubscript{1} & d\textsubscript{2}\\[0pt]
+\end{tabular}
+\end{center}
+
+\begin{center}
+\includegraphics[width=200px]{./51b.excalidraw.png}
+\end{center}
+
+\subsubsection{Minimization}
+\label{sec:orgbd13a9a}
+\begin{center}
+\begin{tabular}{lrr}
+partition & 1 & 0\\[0pt]
+\{d\textsubscript{0}, d\textsubscript{1}, d\textsubscript{2}\} & \{d\textsubscript{0}, d\textsubscript{1}, d\textsubscript{2}\} \(\Rightarrow\) \{d\textsubscript{1}, d\textsubscript{1}, d\textsubscript{1}\} & \{d\textsubscript{0}, d\textsubscript{1}, d\textsubscript{2}\} \(\Rightarrow\) \{d\textsubscript{2}, d\textsubscript{2}, d\textsubscript{2}\}\\[0pt]
+\end{tabular}
+\end{center}
+
+\begin{center}
+\includegraphics[width=75px]{./51c.excalidraw.png}
+\end{center}
+
+\subsection{regex 2}
+\label{sec:org65aa1cc}
+\subsubsection{NFA}
+\label{sec:org0a8dd3a}
+\begin{center}
+\includegraphics[width=350px]{./52a.excalidraw.png}
+\end{center}
+\subsubsection{DFA}
+\label{sec:orgbf87fa0}
+\begin{center}
+\begin{tabular}{llll}
+DFA State & NFA States & 1 & 0\\[0pt]
+d\textsubscript{0} & \{s\textsubscript{0}, s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{5}, s\textsubscript{11}, s\textsubscript{6}, s\textsubscript{12} \} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{5}, s\textsubscript{6}, s\textsubscript{7}, s\textsubscript{8}, s\textsubscript{10}, s\textsubscript{11}, s\textsubscript{12}\} (d\textsubscript{1}) & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{4}, s\textsubscript{5}, s\textsubscript{11}, s\textsubscript{6}, s\textsubscript{12}\} (d\textsubscript{2})\\[0pt]
+d\textsubscript{1} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{5}, s\textsubscript{6}, s\textsubscript{7}, s\textsubscript{8}, s\textsubscript{10}, s\textsubscript{11}, s\textsubscript{12}\} & d\textsubscript{1} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{4}, s\textsubscript{5}, s\textsubscript{9}, s\textsubscript{11}, s\textsubscript{6}, s\textsubscript{12}\} (d\textsubscript{3})\\[0pt]
+d\textsubscript{2} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{4}, s\textsubscript{5}, s\textsubscript{11}, s\textsubscript{6}\} & d\textsubscript{1} & d\textsubscript{2}\\[0pt]
+d\textsubscript{3} & \{s\textsubscript{1}, s\textsubscript{2}, s\textsubscript{3}, s\textsubscript{4}, s\textsubscript{5}, s\textsubscript{9}, s\textsubscript{11}, s\textsubscript{6}, s\textsubscript{12}\} & d\textsubscript{1} & d\textsubscript{2}\\[0pt]
+\end{tabular}
+\end{center}
+
+\begin{center}
+\includegraphics[width=150px]{./52b.excalidraw.png}
+\end{center}
+
+\subsubsection{Minimization}
+\label{sec:orgba6f5c6}
+\begin{center}
+\begin{tabular}{lrr}
+partition & 1 & 0\\[0pt]
+\{d\textsubscript{0}, d\textsubscript{1}, d\textsubscript{2}, d\textsubscript{3}\} & \{d\textsubscript{0}, d\textsubscript{1}, d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{d\textsubscript{1}, d\textsubscript{1}, d\textsubscript{1}, d\textsubscript{1}\} & \{d\textsubscript{0}, d\textsubscript{1}, d\textsubscript{2}, d\textsubscript{3}\} \(\Rightarrow\) \{d\textsubscript{2}, d\textsubscript{3}, d\textsubscript{2}, d\textsubscript{2}\}\\[0pt]
+\end{tabular}
+\end{center}
+
+\begin{center}
+\includegraphics[width=100px]{./52c.excalidraw.png}
+\end{center}
+
+\section{Question Six}
+\label{sec:org7b91bcb}
+\subsection{a}
+\label{sec:orgb412f3c}
+\subsubsection{DFA}
+\label{sec:org4ae1ae3}
+\begin{center}
+\includegraphics[width=350px]{./6a.excalidraw.png}
+\end{center}
+
+\subsubsection{catMap}
+\label{sec:org443dec8}
+\begin{verbatim}
+{
+  '-': 'sign',
+  '+': 'sign',
+  [0-9]: 'digit',
+  'e': 'scntfc'
+}
+\end{verbatim}
+
+\subsubsection{transMap}
+\label{sec:org77c35dc}
+\begin{verbatim}
+{
+  's0': {
+    'sign': 's1',
+    'digit': 's2',
+  },
+  's1': {
+    'digit': 's2',
+  },
+  's2': {
+    'digit': 's2',
+    'scntfc': 's3',
+  },
+  's3': {
+    'sign': 's4',
+    'digit': 's5',
+  },
+  's4': {
+    'digit': 's6',
+  },
+  's5': {
+    'digit': 's6',
+  },
+  's6': {
+    'digit': 's6',
+  },
+}
+\end{verbatim}
+
+\subsubsection{tokenTypes}
+\label{sec:orgefb9ab0}
+\begin{verbatim}
+{
+  's2': 'integer',
+  's6': 'integer,
+}
+\end{verbatim}
+\subsection{b}
+\label{sec:org6479f00}
+\subsubsection{DFA}
+\label{sec:org3c2c109}
+\begin{center}
+\includegraphics[width=200px]{./6b.excalidraw.png}
+\end{center}
+
+\subsubsection{catMap}
+\label{sec:org5fb6951}
+\begin{verbatim}
+{
+  [a-zA-Z]: 'letter',
+  '_': 'letter',
+  [0-9]: 'digit',
+}
+\end{verbatim}
+
+\subsubsection{transMap}
+\label{sec:org51968cd}
+\begin{verbatim}
+{
+  's1': {
+    'letter': 's2'
+  },
+  's2': {
+    'letter': 's2',
+    'digit': 's2',
+  },
+}
+\end{verbatim}
+
+\subsection{c}
+\label{sec:orgaadecbc}
+\subsubsection{DFA}
+\label{sec:orgbc936b3}
+\begin{center}
+\includegraphics[width=400px]{./6c.excalidraw.png}
+\end{center}
+
+\subsubsection{catMap}
+\label{sec:org0f61017}
+\begin{verbatim}
+{
+  [^(\n)*/]: 'nonc',
+  '\n': 'newline',
+  'eof': 'eof',
+  '/': 'slash',
+  '*': 'star'
+}
+\end{verbatim}
+\subsubsection{transMap}
+\label{sec:orge8e62ef}
+\begin{verbatim}
+{
+  's0': {
+    'slash': 's1',
+  },
+  's1': {
+    'slash': 's2',
+    'star': 's4',
+  },
+  's2': {
+    'nonc': 's2',
+    'newline': 's3',
+    'eof': 's3'
+  },
+  's4': {
+    'nonc': 's4',
+    'star': 's5',
+  },
+  's5': {
+    'nonc': 's4',
+    'newline': 's4',
+    'slash': 's6'
+  }
+}
+\end{verbatim}
+
+\subsubsection{tokenType}
+\label{sec:orgb999994}
+\begin{verbatim}
+{
+  's3': 'singleLineComment',
+  's6': 'multiLineComment',
+}
+\end{verbatim}
+\end{document}
\ No newline at end of file
-- 
cgit v1.3

