-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path50003 - Models of Computation.tex
101 lines (75 loc) · 3.28 KB
/
50003 - Models of Computation.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
\documentclass{report}
\title{50003 - Models of Computation}
\author{Oliver Killane}
\date{27/03/23}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\input{../common/common.tex}
% Arabic fonts required for al-jabr in intro
\usepackage{arabtex}
\usepackage{utf8}
\setcode{utf8}
% More newcommands (legacy from old tex common)
\newcommand{\trisplit}[3]{
\begin{minipage}{.33\textwidth}
#1
\end{minipage} \hfill \begin{minipage}{.33\textwidth}
#2
\end{minipage} \hfill \begin{minipage}{.33\textwidth}
#3
\end{minipage}
}
%================================CONFIGURATIONS================================
\newcommand{\config}[2]{\langle #1, #2 \rangle}
%==============================================================================
%==============================BIG STEP SEMANTICS==============================
\newcommand{\bigstep}[4]{\text{(#1)}\dfrac{#2}{#3 \Downarrow #4}}
\newcommand{\bigstepdef}[5]{\bigstep{#1}{#2}{#3}{#4} \ #5}
%==============================================================================
%=============================SMALL STEP SEMANTICS=============================
\newcommand{\smallstep}[4]{\text{(#1)}\dfrac{#2}{#3 \to #4}}
\newcommand{\smallstepdef}[5]{\smallstep{#1}{#2}{#3}{#4} \ #5}
%==============================================================================
\newcommand{\whilest}[3]{\text{(#1)}\dfrac{#2}{#3}}
\newcommand{\whilestdef}[4]{\whilest{#1}{#2}{#3} \ #4}
%==============================================================================
%===================================COMMANDS===================================
\newcommand{\while}[2]{\text{while } #1 \text{ do } #2}
\newcommand{\ifcond}[3]{\text{if } #1 \text{ then } #2 \text{ else } #3}
\newcommand{\doret}[2]{\text{do } #1 \text{ return } #2}
\newcommand{\instrlabel}[1]{\text{\textcolor{teal}{$L_{#1}$}}}
\newcommand{\reglabel}[1]{\text{\textcolor{orange}{$R_{#1}$}}}
\newcommand{\regtemp}[1]{\text{\textcolor{orange}{$#1$}}}
\newcommand{\instr}[2]{\instrlabel{#1} : & #2 \\}
\newcommand{\dec}[3]{\reglabel{#1}^- \to \instrlabel{#2}, \instrlabel{#3}}
\newcommand{\inc}[2]{\reglabel{#1}^+ \to \instrlabel{#2}}
\newcommand{\halt}{\text{\textcolor{red}{\textbf{HALT}}}}
\newcommand{\lambapp}[2]{#1 \ #2}
\newcommand{\lambappb}[2]{(#1) \ (#2)}
\newcommand{\lambfun}[2]{\lambda #1 \ . \ #2}
\makeatletter
\newcommand{\lambarg}[1]{%
#1 \checknextarglambarg}
\newcommand{\checknextarglambarg}{\@ifnextchar\bgroup{\gobblenextarglambarg}{}}
\newcommand{\gobblenextarglambarg}[1]{ \ #1 \@ifnextchar\bgroup{\gobblenextarglambarg}{}}
\newcommand{\chnum}[1]{\underline{#1}}
% Variable argument regconfig \regconfig{label no}{reg val}{reg val}...
\makeatletter
\newcommand{\regconfig}[2]{%
$#1$ & $#2$\checknextarg}
\newcommand{\checknextarg}{\@ifnextchar\bgroup{\gobblenextarg}{\\}}
\newcommand{\gobblenextarg}[1]{ & $#1$\@ifnextchar\bgroup{\gobblenextarg}{\\}}
%==============================================================================
\usepackage[utf8]{inputenc}
\begin{document}
\include{titlepage/titlepage}
\tableofcontents
\newpage
\addchapter{introduction}
\addchapter{while_language}
\addchapter{structural_induction}
\addchapter{register_machines}
\addchapter{halting_problem}
\addchapter{turing_machines}
\addchapter{lambda_calculus}
\addchapter{credit}
\end{document}