-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
261 lines (225 loc) · 8.29 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
% \documentclass[12pt]{book}
\documentclass[ebook,9pt,twoside,openany]{memoir}
\usepackage[paperwidth=6in, paperheight=9in, margin=0.5in]{geometry}
% \usepackage[paperwidth=148.5mm, paperheight=210mm, margin=10mm]{geometry}
\usepackage[english]{babel}
% \usepackage{graphicx}
% \usepackage{framed}
% \usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{enumerate}
% \usepackage{kotex}
% \usepackage{setspace}
\usepackage{listings}
% \usepackage{xcolor}
% \usepackage{bbm}
% \usepackage{lipsum}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{syntax}
\usepackage{changepage}
% \usepackage{mathrsfs}
\usepackage{stmaryrd}
\usepackage[perpage]{footmisc}
\usepackage{mathpartir}
\usepackage{soul}
\usepackage{pifont}
\usepackage{tikz-cd}
\usepackage{hyperref}
\usepackage[capitalise,nameinlink]{cleveref}
\usepackage{lmodern}
\delimitershortfall-1sp
% \usepackage{mleftright}
% \mleftright
\crefformat{section}{#2\S{}#1#3}
\newtheoremstyle{tabstyle}
{\topsep} % Space above
{\topsep} % Space below
{\normalfont} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem*{corollary}{Corollary}
\newtheorem{property}{Property}[chapter]
\newtheorem{lemma}{Lemma}[chapter]
\newtheorem*{definition}{Definition}
\newtheorem{note}{Note}
\theoremstyle{tabstyle}
\newtheorem{exercise}{Exercise}[chapter]
\newtheorem*{example}{Example}
\newenvironment{exampletab}
{\begin{example}\;\begin{adjustwidth}{1em}{0em}}
{\end{adjustwidth}\end{example}}
\newenvironment{exercisetab}
{\begin{exercise}\;\begin{adjustwidth}{1em}{0em}}
{\end{adjustwidth}\end{exercise}}
\newenvironment{enumarab}
{\begin{enumerate}[label=(\arabic*)]}
{\end{enumerate}}
\newenvironment{enumcirc}
{\begin{enumerate}[label=\protect\circled{\arabic*}]}
{\end{enumerate}}
\newenvironment{enumrm}
{\begin{enumerate}[label=(\roman*)]}
{\end{enumerate}}
\newenvironment{enumalpha}
{\begin{enumerate}[label=(\alph*)]}
{\end{enumerate}}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\newcommand{\inred}{\color{red}}
\newcommand{\todo}{{\inred TODO}}
\newcommand{\<}{\langle}
\renewcommand{\>}{\rangle}
\newcommand{\abs}[1]{\left\vert #1 \right\vert}
\newcommand{\prths}[1]{\left( #1 \right)}
\newcommand{\braces}[1]{\left\{ #1 \right\}}
\newcommand{\brackets}[1]{\left[ \, #1 \, \right]}
\newcommand{\bbrackets}[1]{\left\llbracket #1 \right\rrbracket}
\newcommand{\chevrons}[1]{\left\< #1 \right\>}
\newcommand{\set}[2]{\left\{ #1 \; \middle\vert \; #2 \right\}}
\newcommand{\aug}[2]{\left[ #1 \; \middle\vert \; #2 \right]}
\newcommand{\augtwo}[3]{\left[ #1 \; \middle\vert \; #2 \; \middle\vert \; #3 \right]}
\newcommand{\subsctext}[2]{#1_{\textrm{\tiny #2}}}
\newcommand{\subscmath}[2]{#1_{\textrm{\tiny \ensuremath{{}_{#2}}}}}
\newcommand{\supsctext}[2]{#1^{\textrm{\tiny #2}}}
\newcommand{\supscmath}[2]{#1^{\textrm{\tiny \ensuremath{{}_{#2}}}}}
\newcommand{\intexpsem}[1]{\bbrackets{#1}_{\textrm{\tiny intexp}}}
\newcommand{\boolexpsem}[1]{\bbrackets{#1}_{\textrm{\tiny boolexp}}}
\newcommand{\commexpsem}[1]{\bbrackets{#1}_{\textrm{\tiny comm}}}
\newcommand{\assertsem}[1]{\bbrackets{#1}_{\textrm{\tiny assert}}}
\newcommand{\normalsem}[1]{\bbrackets{#1}_{\textrm{\tiny n}}}
\newcommand{\eagersem}[1]{\bbrackets{#1}_{\textrm{\tiny e}}}
\newcommand{\gram}[1]{\chevrons{\textit{#1}}}
\newcommand{\doublebot}{%
{\bot \mkern-11mu \bot}%
}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\B}{\mathbb{B}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Cc}{\mathcal{C}}
\newcommand{\Oc}{\mathcal{O}}
\newcommand{\Dc}{\mathcal{D}}
\newcommand{\true}{\textrm{true}}
\newcommand{\false}{\textrm{false}}
\newcommand{\ttt}{\textbf{tt}}
\newcommand{\fff}{\textbf{ff}}
\newcommand{\fv}[1]{\textrm{FV}\prths{ #1 }}
\newcommand{\fa}[1]{\textrm{FA}\prths{ #1 }}
\newcommand{\fvintexp}[1]{\textrm{FV}_{\textrm{\tiny intexp}}\prths{ #1 }}
\newcommand{\fvassert}[1]{\textrm{FV}_{\textrm{\tiny assert}}\prths{ #1 }}
\newcommand{\where}{\quad \textrm{ where } \;}
\newcommand{\elemarith}{\substack{+\\-\\\times\\\div}}
\newcommand{\plustimes}{\substack{+\\ \times}}
\newcommand{\twostack}[2]{\substack{#1\\#2}}
\newcommand{\toc}{\xrightarrow[c]{}}
\newcommand{\abort}{\textrm{abort}}
\newcommand{\cskip}{\textrm{skip}}
\newcommand{\cseq}[2]{#1 ;\; #2}
\newcommand{\cif}[3]{\textrm{if } #1 \textrm{ then } #2 \textrm{ else } #3}
\newcommand{\cwhile}[2]{\textrm{while } #1 \textrm{ do } #2}
\newcommand{\cassign}[2]{#1 := #2}
\newcommand{\cfail}{\textrm{fail}}
\newcommand{\cout}[1]{\textrm{!} #1}
\newcommand{\cin}[1]{\textrm{?} #1}
\newcommand{\cnew}[3]{\textrm{newvar } #1 := #2 \textrm{ in } #3}
\newcommand{\cfor}[4]{\textrm{for } #1 := #2 \textrm{ to } #3 \textrm{ do } #4}
\newcommand{\lletrec}[4]{\textrm{letrec } #1 \equiv \lambda #2 . #3 \textrm{ in } #4}
\newcommand{\lcallcc}{\textrm{callcc }}
\newcommand{\lthrow}[2]{\textrm{throw } #1 \; #2}
\newcommand{\nil}{\textrm{nil}}
\newcommand{\abstr}{\textrm{abstract}}
\newcommand{\extend}{\textrm{extend}}
\newcommand{\initenv}{\textrm{initenv}}
\newcommand{\initcont}{\textrm{initcont}}
\newcommand{\recenv}{\textrm{revenv}}
\newcommand{\negate}{\textrm{negate}}
\newcommand{\addrm}{\textrm{add}}
\newcommand{\apprm}{\textrm{app}}
\newcommand{\divrm}{\textrm{div}}
\newcommand{\mulrm}{\textrm{mul}}
\newcommand{\ccc}{\textrm{ccc}}
\newcommand{\thw}{\textrm{thw}}
\newcommand{\contf}{\textrm{cont}}
\newcommand{\applyf}{\textrm{apply}}
\newcommand{\getf}{\textrm{get}}
\newcommand{\Obj}[1][]{\subscmath{\textrm{Obj}}{#1}}
\newcommand{\Hom}{\textrm{Hom}}
\newcommand{\id}{\textrm{id}}
\newcommand{\Id}{\textrm{Id}}
\newcommand{\Homset}[3][]{\subscmath{\Hom}{#1}\brackets{#2, #3}}
\newcommand{\inj}{\textrm{inj}}
\newcommand{\Dom}[1][]{{\textrm{Dom}}^{\textrm{#1}}}
\newcommand{\ibot}{\iota_\bot}
\newcommand{\iterm}{\iota_{\textrm{term}}}
\newcommand{\iabort}{\iota_{\textrm{abort}}}
\newcommand{\iout}{\iota_{\textrm{out}}}
\newcommand{\iin}{\iota_{\textrm{in}}}
\newcommand{\botO}{\bot_\Omega}
\newcommand{\CPS}{\underline{\textrm{CPS}}}
\newcommand{\defeq}{\stackrel{\text{def}}{=}}
\newcommand{\refeq}{=_{\textrm{ref}}}
\newcommand{\subst}[3]{#1/_{#2 \rightarrow #3}}
\newcommand{\RightarrowE}{\Rightarrow_{\textrm{E}}}
\newcommand{\lrsupsubarrow}[2]{ \mathrel{\mathop{\rightleftarrows}^{\mathrm{#1}}_{\mathrm{#2}}} }
\newcommand{\dunderline}[1]{\underline{\underline{#1}}}
\newcommand{\footnoteeqn}[2][1]{\addtocounter{footnote}{#1}\footnotetext{#2}}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\title{\Huge Theory of Programming Languages}
\author{Hongseok Yang}
\date{\today}
\OnehalfSpacing
% \counterwithin*{footnote}{page}
\begin{document}
\maketitle
\tableofcontents
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface} % If you want it in the table of contents
\noindent\textbf{Editor's Note:}
\noindent
This document is transcribed from Professor Yang's handwritten graduate
programming language lecture notes for improved readability and accessibility.
\medskip
\noindent Should you find any errors within these documents, contributions and
error reports are welcomed at the following GitHub repository:
\href{https://github.com/p51lee/CS520-notes}{github.com/p51lee/CS520-notes}.
\medskip
\noindent In this document, to express the additional arrowed notes of the
original lecture notes as a footnote, I will be using symbols \ding{168},
\ding{169}, \ding{170}, \ding{171}, \ding{72}, \ding{96}, and \ding{44} as
footnote symbols.
\noindent So don't be surprised or confused if you see a footnote symbol in the
middle of a sentence or an equation; just look down at the bottom of the page to
see what it means.
%
If you are using a PDF viewer, you can click on the footnote symbol to jump to
the footnote.
\DefineFNsymbols{footsym}{
{\tiny\ding{168}}
{\tiny\ding{169}}
{\tiny\ding{170}}
{\tiny\ding{171}}
{\tiny\ding{72}}
{\tiny\ding{96}}
{\tiny\ding{44}}
}
\setfnsymbol{footsym}
\input{chapter1.tex}
\input{chapter2.tex}
\input{chapter3.tex}
\input{chapter4.tex}
\input{chapter5.tex}
\input{chapter6.tex}
\input{chapter7.tex}
\input{chapter8.tex}
\input{chapter9.tex}
\input{chaptera.tex}
\end{document}