-
Notifications
You must be signed in to change notification settings - Fork 6
/
thesis.tex
426 lines (309 loc) · 10.7 KB
/
thesis.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
%!TEX TS-program = xelatex
% vim:syntax=none
%\documentclass[onecolumn, 11pt, oneside, openright, dvipdfm]{book}
%\documentclass[onecolumn, 11pt, oneside, openright, dvipdfmx]{book}
\documentclass[onecolumn, 11pt, oneside, openright]{book}
%\documentclass[onecolumn, 11pt, twosides, openright, dvipdfm]{book}
%\usepackage[dvipdfm,CJKbookmarks,bookmarks=true,bookmarksopen=true]{hyperref}
%\usepackage[dvipdfmx,CJKbookmarks,bookmarks=true,bookmarksopen=true]{hyperref}
\newcommand{\thesisauthor}[0]{William E. Byrd}
\newcommand{\thesistitle}[0]{Relational Programming in miniKanren: \\ Techniques, Applications, and Implementations}
% [Dan thinks 'Limitations' may be better than obstacles]
\newcommand{\thesiskeywords}[0]{Kwd1, Kwd2, Kwd3}
\newcommand{\thesismonth}[0]{August}
\newcommand{\thesisyear}[0]{2009}
%\newcommand{\thesisdate}[0]{\today}
\newcommand{\thesisdate}[0]{May 7, 2009}
\newcommand{\thesiscommitteemembers}[0]{%
\cmember{Daniel P. Friedman, Ph.D. \\ (Principal Advisor)}
\cmember{Amr Sabry, Ph.D.}
\cmember{Christopher T. Haynes, Ph.D.}
\cmember{Lawrence S. Moss, Ph.D.}
}
\usepackage{microtype}
\usepackage{ccicons} % Creative Commons icons
\usepackage{xspace} % Used for printing a trailing space better than using a tilde (~) using the \xspace command
\usepackage{natbib}
\usepackage{hyphenat}
\usepackage{amsmath}
\usepackage{slatex}
\usepackage{alltt}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{verbatim}
\usepackage{url}
\usepackage{float}
\usepackage{DraTex}
\usepackage[compact]{titlesec}
\usepackage[bbgreekl]{mathbbol}
%%% the cspex option loads the infamous stmaryrd font
\usepackage{comment}
%\usepackage{mathabx}
\def\schemecodehook{\setlength{\baselineskip}{0.5\baselineskip}}
\addtolength{\textwidth}{.5in}
\addtolength{\textheight}{.5in}
\setlength{\topmargin}{.25in}
\usepackage{fontspec}
\usepackage{hanging}
\usepackage{xltxtra}
\setlength{\oddsidemargin}{.75in}
\setlength{\evensidemargin}{.25in}
%\defaultfontfeatures{Scale=MatchLowercase}
%\setmainfont[Mapping=tex-text,Scale=1.0]{Charis SIL}
%\setsansfont[Mapping=tex-text,Scale=0.9]{Geneva}
%\setmonofont[Scale=0.88]{Monaco}
\usepackage{makeidx}
\usepackage[compact]{fancyvrb1}
\usepackage{fancyvrb}
%\fvset{xleftmargin=\parindent,baseline=t}
\DefineVerbatimEnvironment{code}{Verbatim}{commandchars=\\\{\}}
\DefineVerbatimEnvironment{Code}{Verbatim}
{baselinestretch=1.1,
frame=single,
framerule=0.5pt,
commandchars=\\\{\}}
\DefineVerbatimEnvironment{Transcript}{Verbatim}
{baselinestretch=1.1,
frame=lines,
xleftmargin=4em,
xrightmargin=4em,
framerule=0.5pt,
numbers=left,
numbersep=.5em,
commandchars=\\\{\}}
\usepackage{rotating}
\usepackage{multicol,ragged2e}
%% FIXME - get hyperlinks working, and uncomment 'phantomsection' below
%% \usepackage[xetex,CJKbookmarks,bookmarks=true,bookmarksopen=true]{hyperref}
%% \hypersetup{
%% pdftitle={\thesistitle},
%% pdfauthor={\thesisauthor},
%% pdfkeywords={\thesiskeywords},
%% bookmarksnumbered=true,
%% % pagebackref=true,
%% breaklinks=true,
%% urlcolor=blue,
%% colorlinks=true,
%% citecolor=blue, %citeref's color
%% linkcolor=blue,
%% }
\include{macros}
\defschememathescape{$} % $
\def\qqmagicoff{}
\def\qqmagicon{}
%\def\schemedisplayspace{\vspace{0.5cm}}
\def\schemedisplayspace{\vspace{0.2cm}}
%%%% Nominal Biography
% http://www4.in.tum.de/~urbanc/NomBib/nominal.html
% Uncomment to use author-date citation format
\bibpunct();A{},
\let\cite=\citep
\bibliographystyle{abbrvnat}
%\bibliographystyle{plainnat}
%\bibliographystyle{acm}
%\bibliographystyle{plain}
\VerbatimFootnotes
\makeindex
\begin{schemeregion}
\begin{document}
\frontmatter
\title{\thesistitle{}}
\author{\thesisauthor{}}
\thispagestyle{empty}
\mbox{}
\vspace{1in}
%\newcommand{\fstpagefont}[0]
%{\fontspec{Hoefler Text}}
\begin{center}
{
% \fstpagefont{}
\fontsize{24}{24}
\noindent \scshape \thesistitle{} \\
}
\vspace{2in}
{\fontsize{16}{16} % \fstpagefont{}
\scshape \thesisauthor{}}
\vspace{1in}
{ \fontsize{14}{14} % \fstpagefont{}
\scshape
Submitted to the faculty of the \\
University Graduate School \\
in partial fulfillment of the requirements \\
for the degree \\
Doctor of Philosophy \\
in the Department of Computer Science, \\
Indiana University \\
\vspace{.5in}
\thesismonth{}, \thesisyear{}}
\end{center}
\newpage
%\thispagestyle{empty}
\newcommand{\cmember}[1]{
\vspace{1in}
\hfill
\begin{minipage}{3.5in}
\begin{center}
\rule{3.5in}{1pt}
#1
\end{center}
\end{minipage}
}
{
\fontsize{12}{12}
\noindent Accepted by the faculty of the University Graduate School,
Indiana University, in partial fulfillment of the requirements for the
degree Doctor of Philosophy\vspace{.5in}
\thesiscommitteemembers{}
\vfill{}
\noindent Bloomington, Indiana\\
\thesisdate{}
}
\newpage
{
\fontsize{12}{12}
\mbox{}
\vfill
\hrule
\wspace
\noindent
\textcopyright~2009--2014 William E. Byrd
\wspace
\noindent
\huge
\ccLogo
\ccAttribution
\large
\wspace
\noindent
This work is licensed under a Creative Commons Attribution 4.0 International License.
(CC BY 4.0) \\
\url{http://creativecommons.org/licenses/by/4.0/}
% \begin{center}
% Copyright \copyright{} \thesisyear{}, \thesisauthor{}\\
% All rights reserved
% \end{center}
\wspace
\noindent
This document is a re-formatted version of the original, archival dissertation: \\
\url{http://gradworks.umi.com/3380156.pdf}
\wspace
\noindent
This document, along with all files necessary to typeset it, can be found at: \\ \url{https://github.com/webyrd/dissertation-single-spaced}
\wspace
\noindent
Typeset by the author in \XeLaTeX. \\ \today\xspace version.
}
%\setlength{\baselineskip}{2\baselineskip}
%\setlength{\parskip}{0\baselineskip}
\titlespacing*{\section}{0pt}{*4}{*1.5}
\titlespacing*{\subsection}{0pt}{*4}{*1.5}
\titlespacing*{\subsubsection}{0pt}{*4}{*1.5}
\include{dedication}
\include{acknowledgments}
\include{abstract}
{
\setcounter{tocdepth}{1}
\setlength{\parskip}{0pt}
\tableofcontents
}
\newpage
\mainmatter
\include{intro}
\part{Core miniKanren}\label{coremkpart}
% Part~\ref{coremkpart} presents the core miniKanren language, which we
% will extend in the latter parts of the dissertation.
% Chapter~\ref{mkintrochapter} introduces the core language, along with
% a few simple examples, while chapter~\ref{mkimplchapter} presents the
% implementation of the core language. These two chapters are
% especially important, since they form the foundation for the advanced
% techniques and implementations that follow. In Chapter~\ref{walkimpl}
% we optimize the \scheme|walk| algorithm presented in
% Chapter~\ref{mkimplchapter}, which is the heart of miniKanren's
% unifier. Chapter~\ref{divergencechapter} attempts to categorize the
% many ways miniKanren programs can diverge, and describes techniques
% that can be used to avoid each type of divergence. Avoiding
% divergence while maintaining declarativeness is what makes relational
% programming so fascinating, yet so challenging.
% Chapter~\ref{arithchapter} presents a non-trivial application of core
% miniKanren: a constraint-free arithemtic system with strong
% termination guarantees.
\include{mkintro}
\include{mkimpl}
\include{walkimpl}
\include{divergence}
\include{arith}
\part{Disequality Constraints}\label{diseqpart}
% Part~\ref{diseqpart} extends core miniKanren with disequality
% constraints, which allow us to express that two terms are different,
% and can never be unified. Disequality constraints express a very
% limited form of negation, and can be seen as a simple kind of
% constraint logic programming. Chapter~\ref{diseqchapter} describes
% disequality constraints from the perspective of the user, while
% Chapter~\ref{diseqimplchapter} shows how we can use unification in a
% clever way to simply and efficiently implement the constraints. We
% give special attention to \emph{constraint reification}---the process
% of displaying constraints in a human-friendly manner.
\include{diseq}
\include{diseqimpl}
\part{Nominal Logic}\label{nominallogicpart}
% Part~\ref{nominallogicpart} extends core miniKanren with operators for
% expressing nominal logic; we call the resulting language \alphakanren.
% Nominal logic allows us to easily express notions of scope and
% binding, which is useful when writing declarative interpreters, type
% inferencers, and many other relations that deal with variables.
% Chapter~\ref{akchapter} introduces nominal logic, explains
% \alphakanren's new language constructs, and provides a few simple
% example programs. Chapter~\ref{alphatapchapter} presents a
% non-trivial application of \alphakanren: a relational theorem prover.
% In Chapter~\ref{akimplchapter} we present our implementation of
% \alphakanren, including two different implementations of nominal
% unification.
\include{ak}
\include{alphatap}
\include{akimpl}
\part{Tabling}\label{tablingpart}
% Part~\ref{tablingpart} adds tabling to our implementation of core
% miniKanren. Tabling is a form of memoization: the answers produced by
% a tabled relation are ``remembered'' (that is, stored in a table), so
% that subsequent calls to the relation can avoid recomputing the
% answers. Tabling allows our programs to run more efficiently in many
% cases; more importantly, many programs that would otherwise diverge
% terminate when using tabling. Chapter~\ref{tablingchapter} introduces
% the notion of tabling, and explains which programs benefit from
% tabling.
% Chapter~\ref{tablingimplchapter} presents our streams-based
% implementation of tabling, which demonstrates the advantage of
% embedding miniKanren in a language with higher-order functions.
\include{tabling}
\include{tablingimpl}
\part{Ferns}\label{fernspart}
% Part~\ref{fernspart} presents a bottom-avoiding data structure called
% \emph{ferns}, and shows how ferns can be used to avoid
% expression-level divergence. Chapter~\ref{fernschapter} introduces
% the ferns data structure and implements a simple, miniKanren-like
% language using ferns. Chapter~\ref{fernsimpl} presents our embedding
% of ferns in Scheme.
\include{ferns}
\include{fernsimpl}
\part{Context and Conclusions}\label{contextpart}
% Part~\ref{contextpart} provides context and conclusions for the work
% in this dissertation. Chapter~\ref{relatedworkchapter} describes
% related work, while Chapter~\ref{futureworkchapter} proposes future
% research. We offer our conclusions in Chapter~\ref{conclusionchapter}
\include{related}
\include{future}
\include{conclusion}
\newpage
\appendix
\include{helpers}
\include{pmatch}
\include{matche}
\include{enginesappendix}
\include{akinferparserappendix}
\backmatter
% \phantomsection
\addcontentsline{toc}{chapter}{\bibname}
\bibliography{thesis}
\end{schemeregion}
%\include{vita}
\end{document}