%%% This is the scribe notes template for CS611
%%% There are several comments preceded by CS611: and boxed in %%%%'s
%%% which indicate where macros should be altered to set up the header
%%% for the paper.  Your Notes should go at the comment SCRIBE NOTES GO HERE!.

%%% In the various .sty files that accompany this .tex file you will
%%% find LaTeX macros that make it easier to typeset inference rules
%%% and programming language constructs.  You must make sure that the
%%% file proof.sty is in a path searched by LaTeX when you try to
%%% use this file.  Take a look to see what macros are available--it
%%% will save you time and make the notes look better.  Feel free to
%%% extend the set of macros--post them to the newsgroup and contact
%%% the course staff if you come up with some good ones so they can be
%%% added to the template.

%%% This template includes examples of how to use some of the macros
%%% to give you an idea of how they work.  (Delete the examples when
%%% you do your scribing.)

\documentclass{article}
\usepackage{611-lecture}
\usepackage{amsmath,amssymb,amsthm,amsfonts,comment,url,color}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% CS611: Please fill in these macros as appropriate:
\lecture{30}                  %% Lecture number
\title{Propositions as Types Continued}   %% Title of lecture
%\author{Mia Minnes, Nam Nguyen}       %% name of scribe
\date{17 November 2006}     %% Date of lecture, e.g., 1 January 2001
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% See 611.sty for a variety of macros that will be helpful in
% typesetting the lecture. Here are a few of particular interest:
%
% "x"       x in keyword font (e.g., "if", "#t")
% _x_       x in italics
% \nm{n}    n in slanted font (used for abbreviations)
% <e>       e in angle brackets
% \lt       less-than sign
% \gt       greater-than sign
% \SB{x}    x in semantic brackets
% \Tr x{y}  x[[y]] with x in calligraphic font
%           (if x is more than a single character, use \Tr{x}{y})

\renewcommand\emptyset\varnothing
\newcommand{\inL}{\ensuremath{\mathsf{inL}}}
\newcommand{\inR}{\ensuremath{\mathsf{inR}}}
\newcommand\caseof[3]{\mathsf{case}~{#1}~\mathsf{of}~{#2}~|~{#3}}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}

\newcommand{\Z}{\mathbb{Z}}
\newcommand{\group}[1]{\left\langle{#1}\right\rangle}

%\theoremstyle{definition}
%\newtheorem*{defn}{Definition}
\newcommand{\nondet}{\left[\!\kern1pt\right]}
\renewcommand\phi\varphi
\renewcommand\wp[2]{\mathsf{wp}~{#1}~{#2}}
\newcommand\wlp[2]{\mathsf{wlp}~{#1}~{#2}}
\renewcommand\({\begin{eqnarray*}}
\renewcommand\){\end{eqnarray*}}

\newcommand\LOOKUP[2]{\mathrm{LOOKUP}~{#1}~{#2}}
\newcommand\UPDATE[3]{\mathrm{UPDATE}~{#1}~{#2}~{#3}}
\newcommand\MALLOC[2]{\mathrm{MALLOC}~{#1}~{#2}}
\newcommand\EMPTY{\mathrm{EMPTY\mbox{-}STORE}}
\renewcommand\dom[1]{\mathrm{dom}\,{#1}}
\newcommand\p[2]{\langle{#1},\,{#2}\rangle}
\newcommand\bigcdot{\mathrel{\raisebox{1pt}{$\scriptscriptstyle\bullet$}}}
\newcommand\holed[1]{[\,#1\,]}
\newcommand\hole{\holed\bigcdot}
\newcommand\context[1]{E\kern1pt\holed{#1}}
\newcommand\contextHole{\context\bigcdot}
\newcommand\goesto[2]{\underset{#2}{\overset{#1}\to}}
\newcommand\ifthenelse[3]{\mathsf{if\ }#1\mathsf{\ then\ }#2\mathsf{\ else\ }#3}
\newcommand\ifpthenelse[3]{\mathsf{ifp\ }#1\mathsf{\ then\ }#2\mathsf{\ else\ }#3}
\newcommand\whiledo[2]{\mathsf{while\ }#1\mathsf{\ do\ }#2}
\newcommand\letin[3]{\mathsf{let\ }#1 = #2\mathsf{\ in\ }#3}
\newcommand\letrec[5]{\mathsf{letrec\ }#1 = #2\mathsf{\ and\ \ldots\ and\ }#3 = #4\mathsf{\ in\ }#5}
\newcommand\letrecone[3]{\mathsf{letrec\ }#1 = #2\mathsf{\ in\ }#3}
\newcommand\true{\ensuremath{\mathsf{true}}}
\newcommand\false{\ensuremath{\mathsf{false}}}
\newcommand\error{\ensuremath{\mathsf{error}}}
\newcommand\pca[3]{\{#1\}\kern1pt{#2}\kern1pt\{#3\}}
\newcommand\states{\Set{St}}
\newcommand\rtc{^{\textstyle *}}
\newcommand\sat\vDash
\newcommand\force\vdash

\newcommand\hyphen{\mbox{-}}
\newcommand\lookup[2]{\nm{LOOKUP}~#1~\mquote{#2}}
\newcommand\update[3]{\nm{UPDATE}~#1~\mquote{#2}~#3}
\newcommand\SBk[1]{\SB{#1}k}
\newcommand\fix[1]{\mathsf{fix}\,{#1}}

\newlength\reasonwidth
\setlength\reasonwidth{3cm}
\newcommand\reasoning[1]{\def\longest{#1}\settowidth{\reasonwidth}{$\displaystyle\longest$}\addtolength{\reasonwidth}{5mm}}
\newcommand\reason[2]{\makebox[\reasonwidth][l]{$\displaystyle{#1}$}\mbox{#2}}

\renewcommand\inj[1]{\mathsf{in}_{#1}}
\newcommand\proj[1]{\pi_{#1}}
\newcommand{\dlt}{\sqsubseteq}
\newcommand\floor[1]{\lfloor{#1}\rfloor}
\newcommand\cf[1]{[\kern1pt{#1}\kern1pt]}
\newcommand\SBpr[1]{\SB{#1}\,\phi\,\rho}
\renewcommand\C[3]{\Tr C{#1}\kern1pt{#2}\kern1pt{#3}}
\renewcommand\Cr[1]{\C{#1}\Gamma\rho}

\newcommand\judge[3]{{#1}\force{#2}:{#3}}
\newcommand\Gjudge[2]{\judge\Gamma{#1}{#2}}%
\newcommand\forceUSN{\mathrel{\makebox[2pt][l]{$\force$}\raisebox{-3pt}[0pt][0pt]{\tiny{\textit{USN}}}}}
\newcommand\judgeUSN[3]{{#1}\forceUSN{#2}:{#3}}
\renewcommand\C[3]{\Tr C{#1}\kern1pt{#2}\kern1pt{#3}}
\renewcommand\Cr[1]{\C{#1}\Gamma\rho}
\newcommand\Irred[1]{\ensuremath{\mathrm{Irred}(#1)}}

\newcommand\seq[3]{#1_{#2},\ldots,#1_{#3}}
\newcommand\substtwo[5]{\subst{#1}{#2}{#3,\,#4/#5}}
\newcommand\substlist[5]{\subst{#1}{#2}{#3,\ldots,#4/#5}}
\newcommand\Unify[1]{\mathrm{Unify}(#1)}
\newcommand\fa[2]{\forall{#1}\kern1pt.\kern1pt{#2}}%
\newcommand\Judge[4]{\judge{#1;\,#2}{#3}{#4}}

\newenvironment{proofof}[1]{\addtolength{\topsep}{1mm}\begin{trivlist}\item[]\hspace{\parindent}{\em Proof of #1.}}{\qed\end{trivlist}}

\begin{document}
\maketitle

\section{A Digression on Heyting Algebra}

As discussed last time, there are fewer formulas that are considered intuitionistically valid than classically valid.  The law of double negation ($\neg\neg\phi\to\phi$), the law of excluded middle ($\phi\vee\neg\phi$), and proof by contradiction or reductio ad absurdum are no longer accepted.

Boolean algebra is to classical logic as _Heyting algebra_ is to intuitionistic logic.  A Heyting algebra is an algebraic structure of the same signature as Boolean algebra, but satisfying only those equations that are provable intuitionistically.  Whereas the free Boolean algebra on $n$ generators has $2^{2^n}$ elements, the free Heyting algebra on one generator has infinitely many elements.
\begin{center}
\begin{picture}(0,100)(110,-30)
\multiput(0,0)(20,20)2{\multiput(0,0)(-20,20)2{\circle*{4}}}
\multiput(0,0)(20,20)2{\line(-1,1){20}}
\multiput(0,0)(-20,20)2{\line(1,1){20}}
\put(0,-5){\makebox(0,0)[t]{$\bot$}}
\put(-25,20){\makebox(0,0)[r]{$P$}}
\put(25,20){\makebox(0,0)[l]{$\neg P$}}
\put(0,45){\makebox(0,0)[b]{$\top$}}
\put(0,-30){\makebox(0,0)[b]{\textbf{Free Boolean algebra on one generator}}}
\end{picture}
\begin{picture}(0,230)(-110,-30)
\multiput(0,0)(-20,20)3{\circle*{4}}
\multiput(20,20)(0,40)3{\multiput(0,0)(-20,20)4{\circle*{4}}}
\multiput(20,140)(-20,20)2{\circle*{4}}
\put(0,0){\line(-1,1){40}}
\multiput(20,20)(0,40)3{\line(-1,1){60}}
\put(0,0){\line(1,1){20}}
\multiput(-20,20)(-20,100)2{\line(1,1){40}}
\multiput(-40,40)(0,40)2{\line(1,1){60}}
\put(20,140){\line(-1,1){20}}
\put(0,-5){\makebox(0,0)[t]{$\bot$}}
\put(-23,17){\makebox(0,0)[tr]{$P$}}
\put(25,20){\makebox(0,0)[l]{$\neg P$}}
\put(-45,40){\makebox(0,0)[r]{$\neg\neg P$}}
\put(7,40){\makebox(0,0)[l]{$P\vee\neg P$}}
\put(25,60){\makebox(0,0)[l]{$\neg\neg P\to P$}}
\put(-27,60){\makebox(0,0)[r]{$\neg P\vee\neg\neg P$}}
\put(-10,195){\makebox(0,0){$\top$}}
\put(-10,180){\makebox(0,0){$\vdots$}}
\put(0,-30){\makebox(0,0)[b]{\textbf{Free Heyting algebra on one generator}}}
\end{picture}
\end{center}
The picture on the right is sometimes called the _Rieger--Nishimura ladder_.

\section{Extracting Computational Content}

Many automated deduction systems, such as NuPrl and Coq, are based on constructive logic.  Automatic programming was a significant research direction that motivated the development of these systems.  The idea was that a constructive proof of the existence of a function would automatically yield a program to compute it: the statement asserting the existence of the function is a type, and a constructive proof yields a $\lambda$-term inhabiting that type.  For example, to obtain a program computing square roots, one merely has to give a constructive proof of the statement $\forall x\geq 0\ \exists y\ y^2=x$.

\section{Other Directions}

Many fruitful correspondences have been found between constructive logic and types.  Other logics have been used to give intuition about typing systems and vice versa.

For example, _linear logic_ is a logic that keeps track of resources.  One may only use an assumption in the application of a rule once; the assumption is consumed and may not be reused.  This corresponds to functions that consume their arguments, and hence is a possible model for systems with bounded resources.

\section{KAT Demo}

The remainder of the lecture was a demo of the KAT interactive proof assistant.  This system is based on constructive equational logic of universal Horn formulas (formulas of the form $\forall \bar x\ s_1=t_1\to\cdots\to s_n=t_n\to s=t$).  In the demo, we illustrated how proofs are represented as $\lambda$-terms that are extracted automatically as rules are applied.

The system is available for downloading from
\color{blue}\url{http://www.cs.cornell.edu/Projects/KAT/}\color{black}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}





