\documentstyle[makeidx]{article}
\makeindex
%\setlength{\oddsidemargin}{.5in}
%\setlength{\evensidemargin}{.5in}
%\setlength{\textwidth}{5.8in}
\begin{document}
%\setlength{\parindent}{0pt}
%\newcounter{bean}
%\begin{list}{\arabic{bean}.}{\usecounter{bean}\setlength{\leftmargin}{0pt}\setlength{\rightmargin}{0pt}\setlength{\listparindent}{20pt}\setlength{\parsep}{5pt}}
%\item[]

\begin{verbatim}#|
From kaufmann Fri Sep  6 12:11:08 1991
To: windley@cs.uidaho.edu
Subject: example

Hi, Phil --

I went ahead and did that example.  It took me just under an hour at
the terminal; I'd already written out a page of definitions and
lemmas, as indicated below (I think I showed them to you).  The final
theorem, main-theorem, says that there are arbitrarily large n such
that running the interpreter for n steps, from the initial state,
results in a return to the initial state.  But the content of that
theorem is really in main-lemma, which has no quantifiers and is where
the proof effort lies.

Often in such efforts I'll go back and get rid of the INSTRUCTIONS
hints, which are printed out by the system when a proof using my
interactive ``proof-checker'' is completed.  By ``get rid of'' I mean
that I'll try to prove suitable rewrite rules so that I can produce an
input file without INSTRUCTIONS hints, which can go through the
unadorned Boyer-Moore prover.  I haven't done that here, simply
because I can't see that it's worth the time (hard to tell how long it
would take).  So, I suspect that the ``proof'' I finally got is quite
similar to one you would obtain, except that the system helped me a
lot with the arithmetic (even though I didn't load in any libraries),
inductions were easy to hint, and I could do lots of simplifications
at the subterm level.

Anyhow, below is the input file, which takes about 53 seconds of
real time to replay through pc-nqthm on a Sun 3/60.
-- Matt
|#

\end{verbatim}
\noindent{\sc Event}:   Start with the initial {\bf nqthm} theory.

\addvspace{18pt}

\begin{verbatim};; I had preliminary definitions of step, interp, and interp-prop written
;; out on paper when starting this, along with statements of the lemmas
;; interp-plus and main-lemma.  I'll time the rest....

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{step} \\  
\=\+{\rm{step}}\,({\it{s\/}}, {\it{d0\/}})\index{step} \\ 
$=$$\;\;\;\;$\=\+{\bf let }\=\+{\it{state\/}}{\bf $\;$ be$\;\;$}{\rm{car}}\,({\it{s\/}}), \\ 
{\it{d\/}}{\bf $\;$ be$\;\;$}{\rm{cdr}}\,({\it{s\/}})\- \\ 
{\bf in} \\ 
\=\+{\bf case on }{\it{state\/}}: \\ 
{\bf case = }{\tt{0}} \\ 
{\bf then }{\rm{cons}}\,({\tt{1}}, {\it{d0\/}}) \\ 
{\bf case = }{\tt{1}} \\ 
{\bf $\;\;$then }\=\+{\bf if }{\tt{0}} $<$ {\it{d\/}}$\;\;${\bf then }{\rm{cons}}\,({\tt{2}}, {\it{d\/}}) \\ 
{\bf else }{\rm{cons}}\,({\tt{3}}, {\it{d\/}})$\;${\bf  endif}\- \\ 
{\bf case = }{\tt{2}} \\ 
{\bf $\;\;$then }{\rm{cons}}\,({\tt{1}}, {\it{d\/}} $-\;1$) \\ 
{\bf otherwise }{\rm{cons}}\,({\tt{0}}, {\tt{0}})$\;${\bf  endcase}\-$\;${\bf  endlet}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{interp} \\  
\=\+{\rm{interp}}\,({\it{s\/}}, {\it{d0\/}}, {\it{n\/}})\index{interp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\it{s\/}} \\ 
{\bf else }{\rm{interp}}\,({\rm{step}}\,({\it{s\/}}, {\it{d0\/}})\index{step}, {\it{d0\/}}, {\it{n\/}} $-\;1$)\index{interp}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  interp-plus \\ \index{interp-plus}
{\rm{interp}}\,({\it{s\/}}, {\it{d0\/}}, {\it{m\/}} $+$ {\it{n\/}})\index{interp} $=$ {\rm{interp}}\,({\rm{interp}}\,({\it{s\/}}, {\it{d0\/}}, {\it{m\/}})\index{interp}, {\it{d0\/}}, {\it{n\/}})\index{interp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  plus-assoc \\ \index{plus-assoc}
(({\it{x\/}} $+$ {\it{y\/}}) $+$ {\it{z\/}}) $=$ ({\it{x\/}} $+$ ({\it{y\/}} $+$ {\it{z\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  interp-from-2 \\ \index{interp-from-2}
({\it{w\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ({\rm{interp}}\,({\rm{cons}}\,({\tt{2}}, {\it{d\/}}), {\it{d0\/}}, {\it{w\/}})\index{interp} $=$ {\rm{interp}}\,({\rm{cons}}\,({\tt{1}}, {\it{d\/}} $-\;1$), {\it{d0\/}}, {\it{w\/}} $-\;1$)\index{interp})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  numberp-cdr-interp \\ \index{numberp-cdr-interp}
\=\+(({\it{d0\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\rm{cdr}}\,({\it{cons-state-d\/}}) $\in\;${\bf{N}}${}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{cdr}}\,({\rm{interp}}\,({\it{cons-state-d\/}}, {\it{d0\/}}, {\it{w\/}})\index{interp}) $\in\;${\bf{N}}${}$)\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  through-the-loop \\ \index{through-the-loop}
\=\+(({\it{d\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{d0\/}} $\in\;${\bf{N}}${}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{interp}}\,({\rm{cons}}\,({\tt{1}}, {\it{d\/}}), {\it{d0\/}}, {\it{d\/}} $+$ {\it{d\/}} $+$ {\it{w\/}})\index{interp} $=$ {\rm{interp}}\,({\tt{'}}{\tt{(}}{\tt{1}}{\tt{ .\ }}{\tt{0}}{\tt{)}}, {\it{d0\/}}, {\it{w\/}})\index{interp})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  main-lemma \\ \index{main-lemma}
\=\+({\it{d0\/}} $\in\;${\bf{N}}${}$) \\ 
$\rightarrow$$\;\;\;\;$({\rm{interp}}\,({\tt{'}}{\tt{(}}{\tt{0}}{\tt{ .\ }}{\tt{0}}{\tt{)}}, {\it{d0\/}}, {\it{k\/}} $*$ ({\tt{3}} $+$ {\it{d0\/}} $+$ {\it{d0\/}}))\index{interp} $=$ {\tt{'}}{\tt{(}}{\tt{0}}{\tt{ .\ }}{\tt{0}}{\tt{)}})\-
\end{tabbing}

\begin{verbatim}#| The following generates the four forms following it:
(defn-sk+ interp-prop (d0)
  (forall x (exists n (and (lessp x n)
			   (equal (interp (cons 0 0) d0 n)
				  (cons 0 0))))))
|#

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{interp-prop} \\  
\=\+{\rm{interp-prop}}\,({\it{d0\/}})\index{interp-prop} \\ 
$\leftrightarrow$$\;\;\;\;$$\forall\;${\it{x\/}}$\;$$\exists\;${\it{n\/}}$\;$(({\it{x\/}} $<$ {\it{n\/}}) $\wedge$ ({\rm{interp}}\,({\rm{cons}}\,({\tt{0}}, {\tt{0}}), {\it{d0\/}}, {\it{n\/}})\index{interp} $=$ {\rm{cons}}\,({\tt{0}}, {\tt{0}})))\index{exists}\index{forall}\-
\end{tabbing}


\noindent{\sc Event}:   Disable interp-prop.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  interp-prop-suff \\ \index{interp-prop-suff}
\=\+(({\rm{x}}\,({\it{d0\/}})\index{x} $<$ {\it{n\/}}) $\wedge$ ({\rm{interp}}\,({\tt{'}}{\tt{(}}{\tt{0}}{\tt{ .\ }}{\tt{0}}{\tt{)}}, {\it{d0\/}}, {\it{n\/}})\index{interp} $=$ {\tt{'}}{\tt{(}}{\tt{0}}{\tt{ .\ }}{\tt{0}}{\tt{)}})) \\ 
$\rightarrow$$\;\;\;\;${\rm{interp-prop}}\,({\it{d0\/}})\index{interp-prop}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  interp-prop-necc \\ \index{interp-prop-necc}
\=\+($\neg$ (({\it{x\/}} $<$ {\rm{n}}\,({\it{d0\/}}, {\it{x\/}})\index{n}) $\wedge$ ({\rm{interp}}\,({\tt{'}}{\tt{(}}{\tt{0}}{\tt{ .\ }}{\tt{0}}{\tt{)}}, {\it{d0\/}}, {\rm{n}}\,({\it{d0\/}}, {\it{x\/}})\index{n})\index{interp} $=$ {\tt{'}}{\tt{(}}{\tt{0}}{\tt{ .\ }}{\tt{0}}{\tt{)}}))) \\ 
$\rightarrow$$\;\;\;\;$($\neg$ {\rm{interp-prop}}\,({\it{d0\/}})\index{interp-prop})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  main-theorem-hack-lemma \\ \index{main-theorem-hack-lemma}
({\it{x\/}} $<$ (($1\;+$ {\it{x\/}}) $*$ ({\tt{3}} $+$ {\it{w\/}}))) $=$ {\bf{t}}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  main-theorem \\ \index{main-theorem}
({\it{d0\/}} $\in\;${\bf{N}}${}$) $\rightarrow$ {\rm{interp-prop}}\,({\it{d0\/}})\index{interp-prop}
\end{tabbing}


%\end{list}
\printindex
\end{document}
