
\subsection*{What to expect, What not to expect}

This dissertation investigates lower bounds on the computational
complexity of flow analysis for higher-order languages, uncovering its
inherent computational costs and the fundamental limits of efficiency
for {\em any} flow analysis algorithm.  As such, I have taken
existing, representative, flow analysis specifications ``off the
shelf'' without modification.  This is {\em not} a dissertation on the
design and implementation of novel flow analyses (although it should
inform such work).  The reader is advised to expect no benchmarks or
prototype implementations, but rather insightful proofs and theorems.

This dissertation relates existing research in order to situate the
novelty and significance of this work.  It does not attempt to
comprehensively survey the nearly thirty years of research on flow
analysis, nor the wealth of frameworks, formulations, and variants.  A
thorough survey on flow analysis has been undertaken by
\citet{midtgaard-07}.

%% Although this is a standard approach to giving one's dissertation the
%% girth that marks a real swinging dick academic, I have avoided it.  In
%% part, this is done out of laziness, but more importantly this is done
%% because a thorough survey on the topic has been undertaken by
%% \citet{midtgaard-07}.

\subsection*{Assumptions on the reader}

%% First and foremost, I am a programmer.  The extent to which I
%% understand logic or math, is---more or less---the extent to which I
%% can make sense of these things {\em via} a programming perspective.

For the reader expecting to understand the intuitions, proofs, and
consequences of the results of this dissertation, I assume familiarity
with the following, in roughly descending order of importance:
\begin{itemize}

\item functional programming.  

%   Proficiency in fundamental programming skills and idioms such as
%   found in {\em How to Design Programs} by \citet{htdp} are assumed
%   and 
  The reader should be at ease programming with higher-order
  procedures in languages such as Scheme or ML.  For an introduction
  to programming in Scheme specifically, {\em The Scheme Programming
    Language} by \citet{dybvig-tspl} and {\em Teach Yourself Scheme in
    Fixnum Days} by \citet{sitaram-tyscheme} are recommended; for ML,
  {\em Programming in Standard ML} by \citet{harper-sml} and {\em ML
    for Working Programmer} by \citet{paulson} are recommended.

%% \footnote{To the
%% frugal scholar: full texts of these books are available online.
%% \begin{itemize}
%% \item \url{http://www.htdp.org/}
%% \item \url{http://www.scheme.com/tspl3/}
%% \item \url{http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html}
%% \item \url{http://www.cs.cmu.edu/~rwh/smlbook/}
%% \end{itemize}}
This dissertation relies only on the simplest applicative subsets of
these languages.

\item interpreters (evaluators).

  The reader should understand the fundamentals of writing an
  interpreter, in particular an environment-based interpreter
  \cite{landin-64} for the functional core of a programming
  language.\footnote{Note that almost every modern programming
    language includes a higher-order, functional core: Scheme, ML,
    JavaScript, Java, Haskell, Smalltalk, Ruby, C\#, etc., etc.}  The
  definitive reference is ``Definitional interpreters for higher-order
  programming languages'' by \citet{reynolds-acm72,reynolds-hosc98}.
  Understanding sections 2--6 are an absolute must (and joy).  For a
  more in-depth textbook treatment, see the gospel according to
  \citet{sicp}: {\em Structure and Interpretation of Computer
    Programs}, Chapter 3, Section 2, ``The Environment Model of
  Evaluation,'' and Chapter 4, Section 1, ``The Metacircular
  Evaluator.''
%% \footnote{Again, to the frugal scholar: the full
%% text of this book is also freely available online.
%% \begin{itemize}
%% \item \url{http://mitpress.mit.edu/sicp/}
%% \end{itemize}}
Finally, {\em Essentials of Programming Languages} by \citet{eopl3} is
highly recommended.\footnote{As an undergraduate, I cut my teeth on
  the first edition \citeyearpar{eopl1}.  
  % It was my first glimpse of beauty in this field and I have been in
  % love with the topic ever since.
}

\item the $\lambda$-calculus.  

  The encyclopedic reference is {\em The Lambda Calculus: Its Syntax
    and Semantics} by \citet{barendregt}, which is an overkill for the
  purpose of understanding this dissertation.  Chapters 1 and 3 of
  {\em Lectures on the Curry-Howard Isomorphism} by
  \citet{sorensen-urzyczyn} offers a concise and sufficient
  introduction to untyped and typed $\lambda$-calculus, respectively.
  There are numerous others, such as {\em An Introduction to Lambda
    Calculi for Computer Scientists} by \citet{hankin-lambda}, {\em
    Functional programming and lambda calculus} by
  \citet{barendregt-volb}, and so on.  Almost any will
  do.\footnote{See \citet[Footnote 1]{cardone-hindley-06} for
    references to French, Japanese, and Russian overviews of the
    $\lambda$-calculus.}

\item basic computational complexity theory.   

  The reader should be familiar with basic notions such as complexity
  classes, Turing machines, undecidability, hardness, and complete
  problems.  \citet{Papadimitriou94} is a standard introduction (See
  chapters 2--4, 7--9, 15, and 16).  \citet{jones97} is a good
  introduction with a stronger emphasis on programming and programming
  languages (See part IV and V). Almost any decent undergraduate text
  on complexity would suffice.

  In particular, the classes \logspace, \ptime, \np, and \exptime\ are
  used.  Reductions are given from canonical complete problems for
  these classes to various flow analysis problems.  These canonical
  complete problems include, respectively: the permutation problem,
  circuit value problem (CVP), Boolean satisfiability (SAT), and a
  generic reduction for simulating deterministic, exponential time
  Turing machines.

  Such a reduction from a particular complete computational problem to
  a corresponding flow analysis problem establishes a {\em lower
    bound} on the complexity of flow analysis: solving the flow
  problem is {\em at least as hard} as solving the corresponding
  computational problem (SAT, CVP, etc.), since any instance of these
  problems can be transformed (reduced), using very limited resources,
  to an instance of the flow analysis problem.  In other words, an
  algorithm to solve one problem can be used as an algorithm to solve
  the other.

%% answer for one may be transformed
%% (reduced) to an answer for the other.

%% Ch 2 (TM), 3 (Computability), 4 (Boolean logic), 7 (Relations between
%% complexity classes), 8 (Reductions and completeness), 9 (NP-complete
%% problems), 15 (Parallel computation), 16 (Logarithmic space).

\item fundamentals of program analysis.

  A basic understanding of program analysis would be beneficial,
  although I have tried to make plain the connection between analysis
  and evaluation, so a thorough understanding of program {\em
    interpretation} could be sufficient.  Perhaps the standard text on
  the subject is {\em Principles of Program Analysis} by
  \citet{nielson-nielson-hankin}, which I have followed closely
  because it offers an authoritative and precise definition of flow
  analysis.  It is thorough and rigorous, at the risk of slight {\em
    rigor mortis}.  Shivers' dissertation, {\em Control-Flow Analysis
    of Higher-Order Languages}, contains the original development of
  $k$CFA and is replete with intuitions and explanations.

\item logic and proof theory. 

  The reader should be comfortable with the basics of propositional
  logic, such as De Morgan duality, modus ponens, etc.  The reader is
  also assumed to be comfortable with sequent calculi, and in
  particular sequents for linear logic.
  \citet{girard-proofs-and-types} provides a solid and accessible
  foundation.

All of the theorems will be accessible, but without this background,
only a small number of the more supplemental proofs will be
inaccessible.  Fear not if this is not your cup of meat.

\end{itemize}

%% For the reader expecting to further this line of research using the
%% approach and toolkit employed here, there are significantly more
%% assumptions.

%% \begin{itemize}
%% \item Sharing graphs, optimal reduction, and geometry of interaction.
%% \item Linear logic and proof-nets.
%% \item First-class control.
%% \item Constructive classical logic.
%% \item Game semantics.
%% \end{itemize}

\subsection*{Previously published material}

Portions of this dissertation are derived from material previously
published in the following papers, written jointly with Harry Mairson:
\begin{enumerate}
\item Relating Complexity and Precision in Control Flow Analysis.  In
{\em Proceedings of the 12th International Conference on Functional
Programming}, Frieburg, Germany. \citet{vanhorn-mairson-icfp07}.

\item Flow Analysis, Linearity, and PTIME. In {\em The 15th
International Static Analysis
Symposium}, Valencia, Spain. \citet{vanhorn-mairson-sas08}.

\item Deciding $k$CFA is complete for EXPTIME. In {\em Proceedings of
the 13th International Conference on Functional Programming},
Victoria, BC, Canada. \citet{vanhorn-mairson-icfp08}.

\end{enumerate}
