\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}#|
 Copyright (C) 1994 by Computational Logic, Inc.  All Rights Reserved.

 You may copy and distribute verbatim copies of this Nqthm-1992 event script as
 you receive it, in any medium, including embedding it verbatim in derivative
 works, provided that you conspicuously and appropriately publish on each copy
 a valid copyright notice "Copyright (C) 1994 by Computational Logic, Inc.  All
 Rights Reserved."

 NO WARRANTY

 Computational Logic, Inc. PROVIDES ABSOLUTELY NO WARRANTY.  THE EVENT SCRIPT
 IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
 INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND
 FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
 PERFORMANCE OF THE SCRIPT IS WITH YOU.  SHOULD THE SCRIPT PROVE DEFECTIVE, YOU
 ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

 IN NO EVENT WILL Computational Logic, Inc. BE LIABLE TO YOU FOR ANY DAMAGES,
 ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL
 DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS SCRIPT (INCLUDING BUT
 NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
 SUSTAINED BY THIRD PARTIES), EVEN IF YOU HAVE ADVISED US OF THE POSSIBILITY OF
 SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.


             A Formal Model of Asynchronous Communication
                                 and
      Its Use in Mechanically Verifying a Biphase Mark Protocol


                           J Strother Moore

                         Technical Report 68
                             August, 1991

Abstract (of CLI Tech Report 68):

  In this paper we present a formal model of asynchronous
  communication as a function in the Boyer-Moore logic.  The
  function transforms the signal stream generated by one
  processor into the signal stream consumed by an independently
  clocked processor.  This transformation ``blurs'' edges and
  ``dilates'' time due to differences in the phases and rates of
  the two clocks and the communications delay.  The model can be
  used quantitatively to derive concrete performance bounds on
  asynchronous communications at ISO protocol level 1 (physical
  level).  We develop part of the reusable formal theory that
  permits the convenient application of the model.  We use the
  theory to show that a biphase mark protocol can be used to send
  messages of arbitrary length between two asynchronous
  processors.  We study two versions of the protocol, a
  conventional one which uses cells of size 32 cycles and an
  unconventional one which uses cells of size 18.  Our proof of
  the former protocol requires the ratio of the clock rates of
  the two processors to be within 3% of unity.  The
  unconventional biphase mark protocol permits the ratio to vary
  by 5%.  At nominal clock rates of 20MHz, the unconventional
  protocol allows transmissions at a burst rate of slightly over
  1MHz.  These claims are formally stated in terms of our model
  of asynchrony; the proofs of the claims have been mechanically
  checked with the Boyer-Moore theorem prover, NQTHM.  We
  conjecture that the protocol can be proved to work under our
  model for smaller cell sizes and more divergent clock rates but
  the proofs would be harder.  Known inadequacies of our model
  include that (a) distortion due to the presence of an edge is
  limited to the time span of the cycle during which the edge was
  written, (b) both clocks are assumed to be linear functions of
  time (i.e., the rate of a given clock is unwavering) and (c)
  reading ``on an edge'' produces a nondeterministically defined
  value rather than an indeterminate value.  We discuss these
  problems.

This event file contains all of the definitions and theorems mentioned
in CLI Tech Report 68.  In addition, it contains our proof that
``deterministic fuzzy edge detection is impossible,'' which is
mentioned in a footnote of the report.  However, the theorem BMP18 of
the paper is here called TOP and BMP18-LEMMA is here LOOP.  In
addition, the functions lst' and ts' of the paper are here named LST+
and TS+.

This proof deals with the case of an 18-bit cell divided into 
subcells of size 5 and 13.  The following numeric constants, which
occur in this file, are related to this particular choice of cell
configuration.  It is possible to obtain proofs of different 
configurations by consistently replacing these constants and replaying
the script.  The proof could be lifted to a much more general one,
but I just didn't feel like doing it.

 5 = mark-size
13 = code-size
18 = cell-size = (mark-size + code-size)
17 = cell-size-1
19 = cell-size+1
10 = sampling distance = mark-size+(code-size/2)-1
 4 = mark-size-1
12 = code-size-1

|#

; -------------------------------------------------------------------------
; Arithmetic

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

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{rate-proximity} \\  
\=\+{\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$=$$\;\;\;\;$((({\tt{18}} $*$ {\it{w\/}}) $\not<$ ({\tt{17}} $*$ {\it{r\/}})) $\wedge$ (({\tt{19}} $*$ {\it{r\/}}) $\not<$ ({\tt{18}} $*$ {\it{w\/}})))\-
\end{tabbing}

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

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

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

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

\begin{tabbing}{\sc Theorem}:  times-0 \\ \index{times-0}
({\it{x\/}} $*$ {\tt{0}}) $=$ {\tt{0}}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-non-numberp \\ \index{times-non-numberp}
({\it{z\/}} $\not\in\;${\bf{N}}${}$) $\rightarrow$ (({\it{x\/}} $*$ {\it{z\/}}) $=$ {\tt{0}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-add1 \\ \index{times-add1}
({\it{x\/}} $*$ ($1\;+$ {\it{y\/}})) $=$ ({\it{x\/}} $+$ ({\it{x\/}} $*$ {\it{y\/}}))
\end{tabbing}

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

\begin{tabbing}{\sc Theorem}:  times-commutes1 \\ \index{times-commutes1}
({\it{x\/}} $*$ {\it{y\/}}) $=$ ({\it{y\/}} $*$ {\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-commutes2 \\ \index{times-commutes2}
({\it{x\/}} $*$ {\it{y\/}} $*$ {\it{z\/}}) $=$ ({\it{y\/}} $*$ {\it{x\/}} $*$ {\it{z\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-associates \\ \index{times-associates}
(({\it{x\/}} $*$ {\it{y\/}}) $*$ {\it{z\/}}) $=$ ({\it{x\/}} $*$ {\it{y\/}} $*$ {\it{z\/}})
\end{tabbing}

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

\begin{tabbing}{\sc Theorem}:  difference-is-0 \\ \index{difference-is-0}
({\it{y\/}} $\not<$ {\it{x\/}}) $\rightarrow$ (({\it{x\/}} $-$ {\it{y\/}}) $=$ {\tt{0}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  difference-plus-cancellation1 \\ \index{difference-plus-cancellation1}
(({\it{i\/}} $+$ {\it{x\/}}) $-$ {\it{i\/}}) $=$ {\rm{fix}}\,({\it{x\/}})
\end{tabbing}

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

\begin{tabbing}{\sc Theorem}:  difference-plus-cancellation3 \\ \index{difference-plus-cancellation3}
(({\it{i\/}} $+$ {\it{j\/}} $+$ {\it{x\/}}) $-$ {\it{j\/}}) $=$ ({\it{i\/}} $+$ {\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-remainder \\ \index{lessp-remainder}
(({\it{x\/}} ${}${\bf{mod}}${}$ {\it{y\/}}) $<$ {\it{y\/}}) $=$ ({\it{y\/}} $\not\simeq {\tt{0}}$)
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  remainder-quotient-elim \\ \index{remainder-quotient-elim}
({\it{x\/}} $\in\;${\bf{N}}${}$) $\rightarrow$ ((({\it{x\/}} ${}${\bf{mod}}${}$ {\it{y\/}}) $+$ ({\it{y\/}} $*$ ({\it{x\/}} $\div$ {\it{y\/}}))) $=$ {\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-plus-times \\ \index{quotient-plus-times}
({\it{w\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ((({\it{v\/}} $+$ ({\it{w\/}} $*$ {\it{i\/}})) $\div$ {\it{w\/}}) $=$ ({\it{i\/}} $+$ ({\it{v\/}} $\div$ {\it{w\/}})))
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{len} \\  
\=\+{\rm{len}}\,({\it{x\/}})\index{len} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }$1\;+$ {\rm{len}}\,({\rm{cdr}}\,({\it{x\/}}))\index{len}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  equal-len-0 \\ \index{equal-len-0}
({\rm{len}}\,({\it{x\/}})\index{len} $=$ {\tt{0}}) $=$ ({\it{x\/}} $\simeq\;${{\bf{nil}}}${}$)
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{app} \\  
\=\+{\rm{app}}\,({\it{x\/}}, {\it{y\/}})\index{app} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{y\/}} \\ 
{\bf else }{\rm{cons}}\,({\rm{car}}\,({\it{x\/}}), {\rm{app}}\,({\rm{cdr}}\,({\it{x\/}}), {\it{y\/}})\index{app})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  app-cancellation \\ \index{app-cancellation}
({\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app} $=$ {\rm{app}}\,({\it{a\/}}, {\it{c\/}})\index{app}) $=$ ({\it{b\/}} $=$ {\it{c\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  app-assoc \\ \index{app-assoc}
{\rm{app}}\,({\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app}, {\it{c\/}})\index{app} $=$ {\rm{app}}\,({\it{a\/}}, {\rm{app}}\,({\it{b\/}}, {\it{c\/}})\index{app})\index{app}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-app \\ \index{len-app}
{\rm{len}}\,({\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app})\index{len} $=$ ({\rm{len}}\,({\it{a\/}})\index{len} $+$ {\rm{len}}\,({\it{b\/}})\index{len})
\end{tabbing}


\begin{tabbing}{\sc Theorem}:  quotient-x-x \\ \index{quotient-x-x}
({\it{x\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ (({\it{x\/}} $\div$ {\it{x\/}}) $=$ {\tt{1}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-times-quotient \\ \index{not-lessp-times-quotient}
{\it{n\/}} $\not<$ ({\it{w\/}} $*$ ({\it{n\/}} $\div$ {\it{w\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-monotonic \\ \index{times-monotonic}
(({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{a\/}} $<$ {\it{b\/}})) $\rightarrow$ (({\it{w\/}} $*$ {\it{a\/}}) $<$ ({\it{w\/}} $*$ {\it{b\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  difference-plus \\ \index{difference-plus}
(({\it{x\/}} $+$ {\it{y\/}}) $-$ {\it{y\/}}) $=$ {\rm{fix}}\,({\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-alg-lemma-hack1 \\ \index{nsig*-alg-lemma-hack1}
\=\+(({\it{n\/}} $<$ (({\it{r\/}} $+$ {\it{x\/}}) $\div$ {\it{w\/}})) $\wedge$ ({\it{w\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not=$ {\tt{0}})) \\ 
$\rightarrow$$\;\;\;\;$((({\it{ts\/}} $+$ ({\it{n\/}} $*$ {\it{w\/}})) $<$ ({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}})) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  difference-plus-cancellation-4 \\ \index{difference-plus-cancellation-4}
(({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}) $-$ ({\it{ts\/}} $+$ {\it{y\/}})) $=$ (({\it{r\/}} $+$ {\it{x\/}}) $-$ {\it{y\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nts*-alg-lemma2-hack1 \\ \index{nts*-alg-lemma2-hack1}
\=\+(\=\+({\it{n\/}} $<$ (({\it{r\/}} $+$ {\it{x\/}}) $\div$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{n\/}} $*$ {\it{w\/}}) $\not<$ ({\it{r\/}} $+$ {\it{x\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{x\/}} $<$ {\it{w\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+(({\it{r\/}} $+$ {\it{x\/}}) $\div$ {\it{w\/}}) \\ 
$=$$\;\;\;\;$(({\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))) $\div$ {\it{w\/}}))\- \\ 
$=$$\;\;\;\;${\bf{t}})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-cancellation1 \\ \index{times-cancellation1}
({\it{i\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ((({\it{i\/}} $*$ {\it{j\/}}) $=$ ({\it{i\/}} $*$ {\it{k\/}})) $=$ ({\rm{fix}}\,({\it{j\/}}) $=$ {\rm{fix}}\,({\it{k\/}})))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  times-cancellation2 \\ \index{times-cancellation2}
\=\+({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$(((({\it{w\/}} $*$ {\it{x\/}}) $+$ ({\it{w\/}} $*$ {\it{y\/}})) $=$ ({\it{w\/}} $*$ {\it{z\/}})) $=$ (({\it{x\/}} $+$ {\it{y\/}}) $=$ {\rm{fix}}\,({\it{z\/}})))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  difference-difference \\ \index{difference-difference}
({\it{b\/}} $\not<$ {\it{c\/}}) $\rightarrow$ (({\it{a\/}} $-$ ({\it{b\/}} $-$ {\it{c\/}})) $=$ (({\it{a\/}} $+$ {\it{c\/}}) $-$ {\it{b\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  difference-difference-other \\ \index{difference-difference-other}
(({\it{a\/}} $-$ {\it{b\/}}) $-$ {\it{c\/}}) $=$ ({\it{a\/}} $-$ ({\it{b\/}} $+$ {\it{c\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-plus-times2 \\ \index{quotient-plus-times2}
\=\+({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$((({\it{v\/}} $+$ ({\it{i\/}} $*$ {\it{w\/}}) $+$ ({\it{w\/}} $*$ {\it{j\/}})) $\div$ {\it{w\/}}) $=$ ({\it{i\/}} $+$ {\it{j\/}} $+$ ({\it{v\/}} $\div$ {\it{w\/}})))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  difference-elim \\ \index{difference-elim}
(({\it{i\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{i\/}} $\not<$ {\it{j\/}})) $\rightarrow$ (({\it{j\/}} $+$ ({\it{i\/}} $-$ {\it{j\/}})) $=$ {\it{i\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-difference \\ \index{quotient-difference}
\=\+(({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{a\/}} $\not<$ ({\it{w\/}} $*$ {\it{b\/}}))) \\ 
$\rightarrow$$\;\;\;\;$((({\it{a\/}} $-$ ({\it{w\/}} $*$ {\it{b\/}})) $\div$ {\it{w\/}}) $=$ (({\it{a\/}} $\div$ {\it{w\/}}) $-$ {\it{b\/}}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-monotonic-lemma \\ \index{quotient-monotonic-lemma}
\=\+(({\it{z1\/}} $<$ {\it{y\/}}) $\wedge$ ({\it{z2\/}} $<$ {\it{y\/}}) $\wedge$ ({\it{y\/}} $\not=$ {\tt{0}}) $\wedge$ ({\it{y\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{x\/}} $<$ {\it{v\/}})) \\ 
$\rightarrow$$\;\;\;\;$((({\it{z1\/}} $+$ ({\it{y\/}} $*$ {\it{x\/}})) $<$ ({\it{z2\/}} $+$ ({\it{v\/}} $*$ {\it{y\/}}))) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ntr*-alg-lemma2-hack1 \\ \index{ntr*-alg-lemma2-hack1}
\=\+(\=\+({\it{n\/}} $<$ (({\it{r\/}} $+$ {\it{x\/}}) $\div$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ ({\it{n\/}} $*$ {\it{w\/}})) $\not<$ ({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}) \\ 
$=$$\;\;\;\;$({\it{ts\/}} $+$ {\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))))\- \\ 
$=$$\;\;\;\;${\bf{t}})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-times-quotient-other \\ \index{not-lessp-times-quotient-other}
({\it{x\/}} $\not<$ {\it{r\/}}) $\rightarrow$ (({\it{r\/}} $*$ ({\it{x\/}} $\div$ {\it{r\/}})) $\not<$ {\it{r\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-monotonic \\ \index{quotient-monotonic}
(({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{a\/}} $\not<$ {\it{b\/}})) $\rightarrow$ ((({\it{a\/}} $\div$ {\it{w\/}}) $<$ ({\it{b\/}} $\div$ {\it{w\/}})) $=$ {\bf{f}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nlst*-alg-lemma2-hack1 \\ \index{nlst*-alg-lemma2-hack1}
\=\+(\=\+({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ ({\it{n\/}} $*$ {\it{w\/}})) $\not<$ ({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+(({\it{r\/}} $+$ {\it{x\/}}) $\div$ {\it{w\/}}) \\ 
$+$$\;\;\;\;$(\=\+(\=\+({\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))) \\ 
$-$$\;\;\;\;$({\it{w\/}} $*$ (({\it{r\/}} $+$ {\it{x\/}}) $\div$ {\it{w\/}})))\- \\ 
$\div$$\;\;\;\;${\it{w\/}})\-)\- \\ 
$=$$\;\;\;\;$(({\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))) $\div$ {\it{w\/}}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-lemma1 \\ \index{nsig*-upper-bound-lemma1}
({\it{r\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ((({\it{n\/}} $*$ {\it{w\/}}) $\div$ {\it{r\/}}) $\not<$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ ({\it{tr\/}} $-$ {\it{ts\/}})) $\div$ {\it{r\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-times \\ \index{quotient-times}
({\it{r\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ((({\it{n\/}} $*$ {\it{r\/}}) $\div$ {\it{r\/}}) $=$ {\rm{fix}}\,({\it{n\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  multiply-both-sides-of-lessp \\ \index{multiply-both-sides-of-lessp}
({\it{r\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ((({\it{a\/}} $*$ {\it{r\/}}) $<$ ({\it{b\/}} $*$ {\it{r\/}})) $=$ ({\it{a\/}} $<$ {\it{b\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-quotient-to-lessp-times-lemma1 \\ \index{lessp-quotient-to-lessp-times-le!mma1}
(({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ (({\it{x\/}} $\div$ {\it{r\/}}) $\not<$ {\it{n\/}})) $\rightarrow$ ({\it{x\/}} $\not<$ ({\it{n\/}} $*$ {\it{r\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-quotient-to-lessp-times-lemma2 \\ \index{lessp-quotient-to-lessp-times-le!mma2}
(({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{x\/}} $\not<$ ({\it{n\/}} $*$ {\it{r\/}}))) $\rightarrow$ (({\it{x\/}} $\div$ {\it{r\/}}) $\not<$ {\it{n\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-quotient-to-lessp-times \\ \index{lessp-quotient-to-lessp-times}
({\it{r\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ ((({\it{x\/}} $\div$ {\it{r\/}}) $<$ {\it{n\/}}) $=$ ({\it{x\/}} $<$ ({\it{n\/}} $*$ {\it{r\/}})))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-plus-times1 \\ \index{quotient-plus-times1}
({\it{r\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ (((({\it{n\/}} $*$ {\it{r\/}}) $+$ {\it{z\/}}) $\div$ {\it{r\/}}) $=$ ({\it{n\/}} $+$ ({\it{z\/}} $\div$ {\it{r\/}})))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  equal-times-0 \\ \index{equal-times-0}
(({\it{i\/}} $*$ {\it{j\/}}) $=$ {\tt{0}}) $=$ (({\it{i\/}} $\simeq {\tt{0}}$) $\vee$ ({\it{j\/}} $\simeq {\tt{0}}$))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-hack1 \\ \index{nsig*-upper-bound-hack1}
\=\+(({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{r\/}} $\not<$ ({\tt{18}} $*$ {\it{delta\/}})) $\wedge$ ({\it{n\/}} $<$ {\tt{18}})) \\ 
$\rightarrow$$\;\;\;\;$((({\it{n\/}} $*$ {\it{delta\/}}) $<$ {\it{r\/}}) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-hack2 \\ \index{nsig*-upper-bound-hack2}
\=\+(\=\+(({\it{r\/}} $+$ {\it{r\/}} $+$ ({\tt{17}} $*$ {\it{r\/}})) $\not<$ ({\it{w\/}} $+$ ({\tt{17}} $*$ {\it{w\/}}))) \\ 
$\wedge$$\;\;\;\;$(({\it{w\/}} $+$ ({\tt{17}} $*$ {\it{w\/}})) $\not<$ ({\tt{17}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $<$ {\tt{18}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ {\it{r\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\it{w\/}} $+$ ({\it{w\/}} $*$ ({\it{n\/}} $-\;1$))) \\ 
$=$$\;\;\;\;$(\=\+(({\it{n\/}} $-\;1$) $*$ ({\it{r\/}} $-$ {\it{w\/}})) \\ 
$+$$\;\;\;\;$({\it{w\/}} $-$ (({\it{n\/}} $-\;1$) $*$ ({\it{r\/}} $-$ {\it{w\/}}))) \\ 
$+$$\;\;\;\;$({\it{w\/}} $*$ ({\it{n\/}} $-\;1$)))\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  quotient-plus-times3 \\ \index{quotient-plus-times3}
\=\+(({\it{x\/}} $+$ {\it{z\/}} $+$ ({\it{x\/}} $*$ {\it{n\/}})) $\not\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+({\it{z\/}} $+$ ({\it{x\/}} $*$ {\it{n\/}}) $+$ ({\it{z\/}} $*$ {\it{n\/}}) $+$ ({\it{x\/}} $*$ {\it{n\/}} $*$ {\it{n\/}})) \\ 
$\div$$\;\;\;\;$({\it{x\/}} $+$ {\it{z\/}} $+$ ({\it{x\/}} $*$ {\it{n\/}})))\- \\ 
$=$$\;\;\;\;$({\it{n\/}} $+$ ({\it{z\/}} $\div$ ({\it{x\/}} $+$ {\it{z\/}} $+$ ({\it{n\/}} $*$ {\it{x\/}})))))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-hack3 \\ \index{nsig*-upper-bound-hack3}
\=\+(({\it{z\/}} $+$ ({\it{x\/}} $*$ ({\it{n\/}} $-\;1$))) $<$ ({\it{x\/}} $+$ {\it{z\/}} $+$ ({\it{x\/}} $*$ ({\it{n\/}} $-\;1$)))) \\ 
$\rightarrow$$\;\;\;\;$(({\it{z\/}} $<$ ({\it{x\/}} $+$ {\it{z\/}} $+$ ({\it{x\/}} $*$ ({\it{n\/}} $-\;1$)))) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  intro-delta \\ \index{intro-delta}
(({\it{w\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not<$ {\it{r\/}})) $\rightarrow$ ({\it{w\/}} $=$ ({\it{r\/}} $+$ ({\it{w\/}} $-$ {\it{r\/}})))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-lemma2-1 \\ \index{nsig*-upper-bound-lemma2-1}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $<$ {\tt{18}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not<$ {\it{r\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$((({\it{n\/}} $*$ {\it{w\/}}) $\div$ {\it{r\/}}) $=$ {\it{n\/}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-lemma2-2 \\ \index{nsig*-upper-bound-lemma2-2}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $<$ {\tt{18}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ {\it{r\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$((({\it{n\/}} $*$ {\it{w\/}}) $\div$ {\it{r\/}}) $=$ ({\it{n\/}} $-\;1$))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-lemma2-equality \\ \index{nsig*-upper-bound-lemma2-equalit!y}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} $\wedge$ ({\it{n\/}} $<$ {\tt{18}})) \\ 
$\rightarrow$$\;\;\;\;$(\=\+(({\it{n\/}} $*$ {\it{w\/}}) $\div$ {\it{r\/}}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{w\/}} $<$ {\it{r\/}}$\;\;${\bf then }{\it{n\/}} $-\;1$ \\ 
{\bf else }{\it{n\/}}$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-upper-bound-lemma2 \\ \index{nsig*-upper-bound-lemma2}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} $\wedge$ ({\it{n\/}} $<$ {\tt{18}})) \\ 
$\rightarrow$$\;\;\;\;$({\it{n\/}} $\not<$ (({\it{n\/}} $*$ {\it{w\/}}) $\div$ {\it{r\/}}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nsig*-lower-bound-lemma1 \\ \index{nsig*-lower-bound-lemma1}
\=\+(({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{w\/}} $\not<$ {\it{tr-ts\/}})) \\ 
$\rightarrow$$\;\;\;\;$(((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{tr-ts\/}}) $\div$ {\it{r\/}}) $\not<$ ((({\it{n\/}} $-\;1$) $*$ {\it{w\/}}) $\div$ {\it{r\/}}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-times \\ \index{lessp-times}
({\it{n\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ (({\it{n\/}} $*$ {\it{w\/}}) $\not<$ {\it{w\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  plus-cancellation \\ \index{plus-cancellation}
(({\it{i\/}} $+$ {\it{j\/}}) $=$ ({\it{i\/}} $+$ {\it{k\/}})) $=$ ({\rm{fix}}\,({\it{j\/}}) $=$ {\rm{fix}}\,({\it{k\/}}))
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{boolp}$\;\;$
{\rm{boolp}}\,({\it{x\/}})\index{boolp} $=$ (({\it{x\/}} $=$ {\bf{t}}) $\vee$ ({\it{x\/}} $=$ {\bf{f}}))
\end{tabbing}


\noindent{\sc Event}:   Disable boolp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  boolp-t \\ \index{boolp-t}
({\rm{boolp}}\,({\it{x\/}})\index{boolp} $\wedge$ {\it{x\/}}) $\rightarrow$ (({\bf{t}} $=$ {\it{x\/}}) $=$ {\bf{t}})
\end{tabbing}


\begin{tabbing}{\sc Definition}:\index{b-not}$\;\;$
{\rm{b-not}}\,({\it{x\/}})\index{b-not} $=$ ($\neg$ {\it{x\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable b-not.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{b-xor} \\  
\=\+{\rm{b-xor}}\,({\it{x\/}}, {\it{y\/}})\index{b-xor} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}}$\;\;${\bf then }$\neg$ {\it{y\/}} \\ 
{\bf elseif }{\it{y\/}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable b-xor.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  b-xor-b-not \\ \index{b-xor-b-not}
{\rm{b-xor}}\,({\it{x\/}}, {\rm{b-not}}\,({\it{x\/}})\index{b-not})\index{b-xor} $\wedge$ {\rm{b-xor}}\,({\rm{b-not}}\,({\it{x\/}})\index{b-not}, {\it{x\/}})\index{b-xor}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{smooth} \\  
\=\+{\rm{smooth}}\,({\it{prev-val\/}}, {\it{lst\/}})\index{smooth} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf elseif }{\rm{b-xor}}\,({\it{prev-val\/}}, {\rm{car}}\,({\it{lst\/}}))\index{b-xor} \\ 
{\bf then }{\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{smooth}}\,({\rm{car}}\,({\it{lst\/}}), {\rm{cdr}}\,({\it{lst\/}}))\index{smooth}) \\ 
{\bf else }{\rm{cons}}\,({\rm{car}}\,({\it{lst\/}}), {\rm{smooth}}\,({\rm{car}}\,({\it{lst\/}}), {\rm{cdr}}\,({\it{lst\/}}))\index{smooth})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{reconcile-signals} \\  
\=\+{\rm{reconcile-signals}}\,({\it{a\/}}, {\it{b\/}})\index{reconcile-signals} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{a\/}} $=$ {\it{b\/}}$\;\;${\bf then }{\it{a\/}} \\ 
{\bf else }{\tt{'}}{\tt{q}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{sig} \\  
\=\+{\rm{sig}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{sig} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\tt{'}}{\tt{q}} \\ 
{\bf elseif }({\it{ts\/}} $+$ {\it{w\/}}) $<$ {\it{tr\/}} \\ 
{\bf then }{\rm{reconcile-signals}}\,({\rm{car}}\,({\it{lst\/}}), {\rm{sig}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{ts\/}} $+$ {\it{w\/}}, {\it{tr\/}}, {\it{w\/}})\index{sig})\index{reconcile-signals} \\ 
{\bf else }{\rm{car}}\,({\it{lst\/}})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{endp} \\  
\=\+{\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{endp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }({\it{ts\/}} $+$ {\it{w\/}}) $<$ {\it{tr\/}}$\;\;${\bf then }{\rm{endp}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{ts\/}} $+$ {\it{w\/}}, {\it{tr\/}}, {\it{w\/}})\index{endp} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{lst+} \\  
\=\+{\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{nxtr\/}}, {\it{w\/}})\index{lst+} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf elseif }{\it{nxtr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf else }{\rm{lst+}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{ts\/}} $+$ {\it{w\/}}, {\it{nxtr\/}}, {\it{w\/}})\index{lst+}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ts+} \\  
\=\+{\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{nxtr\/}}, {\it{w\/}})\index{ts+} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{ts\/}} \\ 
{\bf elseif }{\it{nxtr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})$\;\;${\bf then }{\it{ts\/}} \\ 
{\bf else }{\rm{ts+}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{ts\/}} $+$ {\it{w\/}}, {\it{nxtr\/}}, {\it{w\/}})\index{ts+}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lst+-weakly-shortens-lst \\ \index{lst+-weakly-shortens-lst}
{\rm{count}}\,({\it{lst\/}}) $\not<$ {\rm{count}}\,({\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{lst+})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ts+-increases-tr \\ \index{ts+-increases-tr}
\=\+(\=\+($\neg$ {\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{endp}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\rm{count}}\,({\it{lst\/}}) $=$ {\rm{count}}\,({\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{lst+})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+(({\it{w\/}} $+$ {\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{ts+}) $-$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$<$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $-$ {\it{tr\/}}))\- \\ 
$=$$\;\;\;\;${\bf{t}})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{warp} \\  
\=\+{\rm{warp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{endp}$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{cons}}\,(\=\+{\rm{sig}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{sig}, \\ 
{\rm{warp}}\,(\=\+{\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{lst+}, \\ 
{\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{ts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{det} \\  
\=\+{\rm{det}}\,({\it{lst\/}}, {\it{oracle\/}})\index{det} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf elseif }{\rm{car}}\,({\it{lst\/}}) $=$ {\tt{'}}{\tt{q}} \\ 
{\bf then }{\rm{cons}}\,(\=\+\=\+{\bf if }{\rm{car}}\,({\it{oracle\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-, \\ 
{\rm{det}}\,({\rm{cdr}}\,({\it{lst\/}}), {\rm{cdr}}\,({\it{oracle\/}}))\index{det})\- \\ 
{\bf else }{\rm{cons}}\,({\rm{car}}\,({\it{lst\/}}), {\rm{det}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{oracle\/}})\index{det})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{async} \\  
{\rm{async}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}}, {\it{oracle\/}})\index{async} $=$ {\rm{det}}\,({\rm{warp}}\,({\rm{smooth}}\,({\bf{t}}, {\it{lst\/}})\index{smooth}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp}, {\it{oracle\/}})\index{det}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{listn} \\  
\=\+{\rm{listn}}\,({\it{n\/}}, {\it{value\/}})\index{listn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{cons}}\,({\it{value\/}}, {\rm{listn}}\,({\it{n\/}} $-\;1$, {\it{value\/}})\index{listn})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{csig} \\  
\=\+{\rm{csig}}\,({\it{prev-signal\/}}, {\it{bit\/}})\index{csig} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{bit\/}}$\;\;${\bf then }{\it{prev-signal\/}} \\ 
{\bf else }{\rm{b-not}}\,({\it{prev-signal\/}})\index{b-not}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{cell} \\  
\=\+{\rm{cell}}\,({\it{prev-signal\/}}, {\it{n1\/}}, {\it{n2\/}}, {\it{bit\/}})\index{cell} \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{listn}}\,({\it{n1\/}}, {\rm{b-not}}\,({\it{prev-signal\/}})\index{b-not})\index{listn}, {\rm{listn}}\,({\it{n2\/}}, {\rm{csig}}\,({\it{prev-signal\/}}, {\it{bit\/}})\index{csig})\index{listn})\index{app}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{cells} \\  
\=\+{\rm{cells}}\,({\it{prev-signal\/}}, {\it{n1\/}}, {\it{n2\/}}, {\it{msg\/}})\index{cells} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{msg\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{app}}\,(\=\+{\rm{cell}}\,({\it{prev-signal\/}}, {\it{n1\/}}, {\it{n2\/}}, {\rm{car}}\,({\it{msg\/}}))\index{cell}, \\ 
{\rm{cells}}\,({\rm{csig}}\,({\it{prev-signal\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig}, {\it{n1\/}}, {\it{n2\/}}, {\rm{cdr}}\,({\it{msg\/}}))\index{cells})\-\index{app}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{send} \\  
\=\+{\rm{send}}\,({\it{msg\/}}, {\it{pad1\/}}, {\it{n1\/}}, {\it{n2\/}}, {\it{pad2\/}})\index{send} \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{listn}}\,({\it{pad1\/}}, {\bf{t}})\index{listn}, {\rm{app}}\,({\rm{cells}}\,({\bf{t}}, {\it{n1\/}}, {\it{n2\/}}, {\it{msg\/}})\index{cells}, {\rm{listn}}\,({\it{pad2\/}}, {\bf{t}})\index{listn})\index{app})\index{app}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{scan} \\  
\=\+{\rm{scan}}\,({\it{prev-signal\/}}, {\it{lst\/}})\index{scan} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf elseif }{\rm{b-xor}}\,({\it{prev-signal\/}}, {\rm{car}}\,({\it{lst\/}}))\index{b-xor}$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf else }{\rm{scan}}\,({\it{prev-signal\/}}, {\rm{cdr}}\,({\it{lst\/}}))\index{scan}$\;${\bf  endif}\-\-
\end{tabbing}

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

\begin{tabbing}{\sc Definition}:\index{nth}$\;\;$
{\rm{nth}}\,({\it{n\/}}, {\it{lst\/}})\index{nth} $=$ {\rm{car}}\,({\rm{cdrn}}\,({\it{n\/}}, {\it{lst\/}})\index{cdrn})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{recv-bit} \\  
\=\+{\rm{recv-bit}}\,({\it{k\/}}, {\it{lst\/}})\index{recv-bit} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{b-xor}}\,({\rm{car}}\,({\it{lst\/}}), {\rm{nth}}\,({\it{k\/}}, {\it{lst\/}})\index{nth})\index{b-xor}$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{recv} \\  
\=\+{\rm{recv}}\,({\it{i\/}}, {\it{flg\/}}, {\it{k\/}}, {\it{lst\/}})\index{recv} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{i\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{cons}}\,(\=\+{\rm{recv-bit}}\,({\it{k\/}}, {\rm{scan}}\,({\it{flg\/}}, {\it{lst\/}})\index{scan})\index{recv-bit}, \\ 
{\rm{recv}}\,(\=\+{\it{i\/}} $-\;1$, \\ 
{\rm{nth}}\,({\it{k\/}}, {\rm{scan}}\,({\it{flg\/}}, {\it{lst\/}})\index{scan})\index{nth}, \\ 
{\it{k\/}}, \\ 
{\rm{cdrn}}\,({\it{k\/}}, {\rm{scan}}\,({\it{flg\/}}, {\it{lst\/}})\index{scan})\index{cdrn})\-\index{recv})\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{bvp} \\  
\=\+{\rm{bvp}}\,({\it{x\/}})\index{bvp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{x\/}} $=$ {\bf{nil}} \\ 
{\bf else }{\rm{boolp}}\,({\rm{car}}\,({\it{x\/}}))\index{boolp} $\wedge$ {\rm{bvp}}\,({\rm{cdr}}\,({\it{x\/}}))\index{bvp}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}#|
We can now state the top level theorem without proof.

(prove-lemma top nil
  (implies (and (bvp msg)
                (numberp ts)
                (numberp tr)
                (not (zerop w))
                (not (zerop r))
                (not (lessp tr ts))
                (lessp tr (plus ts w))
                (rate-proximity w r)
                (numberp p1))
           (equal (recv (len msg)
                        t
                        10
                        (async (send msg p1 5 13 p2)
                               ts tr w r oracle))
                  msg)))

We will prove this by first massaging it into a different form,
suitable for induction.  The inductive form shall be called loop
instead of top.

|#
                
\end{verbatim}
\noindent{\sc Event}:   Disable listn.

\addvspace{18pt}

\noindent{\sc Event}:   Disable *1*listn.

\addvspace{18pt}

\noindent{\sc Event}:   Disable cell.

\addvspace{18pt}

\noindent{\sc Event}:   Disable *1*cell.

\addvspace{18pt}

\noindent{\sc Event}:   Disable csig.

\addvspace{18pt}

\noindent{\sc Event}:   Disable *1*csig.

\addvspace{18pt}


\noindent{\sc Event}:   Disable boolp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable smooth.

\addvspace{18pt}

\noindent{\sc Event}:   Disable warp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable det.

\addvspace{18pt}

\noindent{\sc Event}:   Disable recv-bit.

\addvspace{18pt}

\noindent{\sc Event}:   Disable scan.

\addvspace{18pt}

\noindent{\sc Event}:   Disable send.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  b-xor-x-x \\ \index{b-xor-x-x}
$\neg$ {\rm{b-xor}}\,({\it{x\/}}, {\it{x\/}})\index{b-xor}
\end{tabbing}

\begin{verbatim}; Our first goal will be to transform the recv-async-send theorem
; into the form we will prove inductively.  This is done by moving
; the initial header out through the smooth, warp, det, and recv, milking
; a 'q out of the smooth and easing it through the warp to nestle a
; cdrn around the smooth and leaving the det hanging on a q string.

; Because the warping is harder than the smoothing, we'll do it first.


\end{verbatim}\begin{tabbing}{\sc Definition}:\index{lst*} \\  
\=\+{\rm{lst*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{endp}$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf else }{\rm{lst*}}\,(\=\+{\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{lst+}, \\ 
{\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{ts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{lst*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ts*} \\  
\=\+{\rm{ts*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ts*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{endp}$\;\;${\bf then }{\it{ts\/}} \\ 
{\bf else }{\rm{ts*}}\,(\=\+{\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{lst+}, \\ 
{\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{ts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{ts*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{tr*} \\  
\=\+{\rm{tr*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tr*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{endp}$\;\;${\bf then }{\it{tr\/}} \\ 
{\bf else }{\rm{tr*}}\,(\=\+{\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{lst+}, \\ 
{\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{ts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tr*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-ts+ \\ \index{not-lessp-ts+}
(({\it{tr\/}} $\not<$ {\it{ts\/}}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) $\rightarrow$ ({\it{tr\/}} $\not<$ {\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{ts+})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-ts+ \\ \index{lessp-ts+}
\=\+(($\neg$ {\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{endp}) $\wedge$ ({\it{tr\/}} $\not<$ {\it{ts\/}}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{w\/}} $+$ {\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{ts+}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lst+-app \\ \index{lst+-app}
\=\+(($\neg$ {\rm{endp}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{endp}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{lst+}}\,({\rm{app}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{app}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{lst+} $=$ {\rm{app}}\,({\rm{lst+}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{lst+}, {\it{lst2\/}})\index{app})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ts+-app \\ \index{ts+-app}
\=\+(($\neg$ {\rm{endp}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{endp}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{ts+}}\,({\rm{app}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{app}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{ts+} $=$ {\rm{ts+}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{ts+})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  sig-app \\ \index{sig-app}
\=\+(($\neg$ {\rm{endp}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{endp}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{sig}}\,({\rm{app}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{app}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{sig} $=$ {\rm{sig}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{sig})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  endp-app \\ \index{endp-app}
\=\+(($\neg$ {\rm{endp}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{endp}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$($\neg$ {\rm{endp}}\,({\rm{app}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{app}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{endp})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{target}$\;\;$
{\rm{target}}\,({\it{x\/}})\index{target} $=$ {\it{x\/}}
\end{tabbing}

\noindent{\sc Event}:   Disable target.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  warp-app \\ \index{warp-app}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{target}}\,({\rm{warp}}\,({\rm{app}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{app}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp})\index{target} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{warp}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp}, \\ 
{\rm{warp}}\,(\=\+{\rm{app}}\,({\rm{lst*}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*}, {\it{lst2\/}})\index{app}, \\ 
{\rm{ts*}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ts*}, \\ 
{\rm{tr*}}\,({\it{lst1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-\index{app})\-\-
\end{tabbing}

\begin{verbatim}; The above lemma, when applied, will generate (warp (listn p1 t) ...)
; and (lst* (listn p1 t) ...) which we now simplify.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{nlst+} \\  
\=\+{\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nlst+} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\it{n\/}} \\ 
{\bf elseif }{\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})$\;\;${\bf then }{\it{n\/}} \\ 
{\bf else }{\rm{nlst+}}\,({\it{n\/}} $-\;1$, {\it{ts\/}} $+$ {\it{w\/}}, {\it{tr\/}}, {\it{w\/}})\index{nlst+}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-lst+ \\ \index{len-lst+}
{\rm{len}}\,({\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{lst+})\index{len} $=$ {\rm{nlst+}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nlst+}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{nts+} \\  
\=\+{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nts+} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\it{ts\/}} \\ 
{\bf elseif }{\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})$\;\;${\bf then }{\it{ts\/}} \\ 
{\bf else }{\rm{nts+}}\,({\it{n\/}} $-\;1$, {\it{ts\/}} $+$ {\it{w\/}}, {\it{tr\/}}, {\it{w\/}})\index{nts+}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-ts+ \\ \index{len-ts+}
{\rm{ts+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{ts+} $=$ {\rm{nts+}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nts+}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{nendp} \\  
\=\+{\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nendp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }({\it{ts\/}} $+$ {\it{w\/}}) $<$ {\it{tr\/}}$\;\;${\bf then }{\rm{nendp}}\,({\it{n\/}} $-\;1$, {\it{ts\/}} $+$ {\it{w\/}}, {\it{tr\/}}, {\it{w\/}})\index{nendp} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-endp \\ \index{len-endp}
{\rm{endp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{endp} $=$ {\rm{nendp}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nendp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-nlst+ \\ \index{lessp-nlst+}
{\it{n\/}} $\not<$ {\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nlst+}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nlst+-equal-n \\ \index{nlst+-equal-n}
\=\+({\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nlst+} $=$ {\it{n\/}}) \\ 
$=$$\;\;\;\;$(({\it{n\/}} $\simeq {\tt{0}}$) $\vee$ (({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{nlst*} \\  
\=\+{\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nendp}$\;\;${\bf then }{\it{n\/}} \\ 
{\bf else }{\rm{nlst*}}\,(\=\+{\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nlst+}, \\ 
{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nlst*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-lst* \\ \index{len-lst*}
{\rm{len}}\,({\rm{lst*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*})\index{len} $=$ {\rm{nlst*}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{nts*} \\  
\=\+{\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nendp}$\;\;${\bf then }{\it{ts\/}} \\ 
{\bf else }{\rm{nts*}}\,(\=\+{\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nlst+}, \\ 
{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nts*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-ts* \\ \index{len-ts*}
{\rm{ts*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ts*} $=$ {\rm{nts*}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ntr*} \\  
\=\+{\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nendp}$\;\;${\bf then }{\it{tr\/}} \\ 
{\bf else }{\rm{ntr*}}\,(\=\+{\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nlst+}, \\ 
{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{ntr*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-tr* \\ \index{len-tr*}
{\rm{tr*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tr*} $=$ {\rm{ntr*}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-listn \\ \index{len-listn}
{\rm{len}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})\index{len} $=$ {\rm{fix}}\,({\it{n\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{lastn} \\  
\=\+{\rm{lastn}}\,({\it{n\/}}, {\it{lst\/}})\index{lastn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $=$ {\rm{len}}\,({\it{lst\/}})\index{len}$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf elseif }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} \\ 
{\bf else }{\rm{lastn}}\,({\it{n\/}}, {\rm{cdr}}\,({\it{lst\/}}))\index{lastn}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{tailp} \\  
\=\+{\rm{tailp}}\,({\it{x\/}}, {\it{lst\/}})\index{tailp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $=$ {\it{lst\/}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{f}} \\ 
{\bf else }{\rm{tailp}}\,({\it{x\/}}, {\rm{cdr}}\,({\it{lst\/}}))\index{tailp}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  tailp-transitive \\ \index{tailp-transitive}
({\rm{tailp}}\,({\it{x\/}}, {\it{y\/}})\index{tailp} $\wedge$ {\rm{tailp}}\,({\it{y\/}}, {\it{z\/}})\index{tailp}) $\rightarrow$ {\rm{tailp}}\,({\it{x\/}}, {\it{z\/}})\index{tailp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  tailp-lst+ \\ \index{tailp-lst+}
{\rm{tailp}}\,({\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{lst+}, {\it{lst\/}})\index{tailp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  tailp-lst* \\ \index{tailp-lst*}
{\rm{tailp}}\,({\rm{lst*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*}, {\it{lst\/}})\index{tailp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  len-lastn \\ \index{len-lastn}
\=\+{\rm{len}}\,({\rm{lastn}}\,({\it{n\/}}, {\it{lst\/}})\index{lastn})\index{len} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{len}}\,({\it{lst\/}})\index{len} $<$ {\it{n\/}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\rm{fix}}\,({\it{n\/}})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  tailp-implies-lastn-len \\ \index{tailp-implies-lastn-len}
{\rm{tailp}}\,({\it{x\/}}, {\it{y\/}})\index{tailp} $\rightarrow$ ({\rm{lastn}}\,({\rm{len}}\,({\it{x\/}})\index{len}, {\it{y\/}})\index{lastn} $=$ {\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lst*-is-lastn \\ \index{lst*-is-lastn}
{\rm{lastn}}\,({\rm{len}}\,({\rm{lst*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*})\index{len}, {\it{lst\/}})\index{lastn} $=$ {\rm{lst*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{properp} \\  
\=\+{\rm{properp}}\,({\it{x\/}})\index{properp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{x\/}} $=$ {\bf{nil}} \\ 
{\bf else }{\rm{properp}}\,({\rm{cdr}}\,({\it{x\/}}))\index{properp}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lastn-nil \\ \index{lastn-nil}
({\rm{properp}}\,({\it{lst\/}})\index{properp} $\wedge$ ({\rm{len}}\,({\it{lst\/}})\index{len} $<$ {\it{n\/}})) $\rightarrow$ ({\rm{lastn}}\,({\it{n\/}}, {\it{lst\/}})\index{lastn} $=$ {\bf{nil}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  properp-listn \\ \index{properp-listn}
{\rm{properp}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})\index{properp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lastn-listn \\ \index{lastn-listn}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\not<$ {\it{n\/}})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{lastn}}\,({\it{n\/}}, {\rm{listn}}\,({\it{k\/}}, {\it{flg\/}})\index{listn})\index{lastn} $=$ {\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-nlst* \\ \index{lessp-nlst*}
{\it{n\/}} $\not<$ {\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lst*-listn \\ \index{lst*-listn}
\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\rightarrow$$\;\;\;\;$({\rm{lst*}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*} $=$ {\rm{listn}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\it{flg\/}})\index{listn})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{n*} \\  
\=\+{\rm{n*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $\simeq {\tt{0}}$) $\vee$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nendp}$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }$1\;+$ {\rm{n*}}\,(\=\+{\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nlst+}, \\ 
{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}} $+$ {\it{r\/}}, {\it{w\/}})\index{nts+}, \\ 
{\it{tr\/}} $+$ {\it{r\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{n*}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-nts+ \\ \index{not-lessp-nts+}
(({\it{tr\/}} $\not<$ {\it{ts\/}}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) $\rightarrow$ ({\it{tr\/}} $\not<$ {\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nts+})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-nts+ \\ \index{lessp-nts+}
\=\+(($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nendp}) $\wedge$ ({\it{tr\/}} $\not<$ {\it{ts\/}}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{w\/}} $+$ {\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}})\index{nts+}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lst+-listn \\ \index{lst+-listn}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nendp}) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{lst+}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{lst+} $=$ {\rm{listn}}\,({\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nlst+}, {\it{flg\/}})\index{listn})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  sig-listn \\ \index{sig-listn}
\=\+(\=\+({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp}) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{sig}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{sig} $=$ {\it{flg\/}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  warp-listn \\ \index{warp-listn}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{warp}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} $=$ {\rm{listn}}\,({\rm{n*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}, {\it{flg\/}})\index{listn})\-
\end{tabbing}  

\begin{tabbing}{\sc Theorem}:  lst+-app-gap \\ \index{lst+-app-gap}
\=\+(({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr+\/}} $\in\;${\bf{N}}${}$) $\wedge$ {\rm{nendp}}\,({\rm{len}}\,({\it{pad\/}})\index{len}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nendp}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{lst+}}\,({\rm{app}}\,({\it{pad\/}}, {\it{lst\/}})\index{app}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{lst+} \\ 
$=$$\;\;\;\;${\rm{lst+}}\,({\it{lst\/}}, {\it{ts\/}} $+$ ({\rm{len}}\,({\it{pad\/}})\index{len} $*$ {\it{w\/}}), {\it{tr+\/}}, {\it{w\/}})\index{lst+})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nts+-app-gap \\ \index{nts+-app-gap}
\=\+(({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr+\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\in\;${\bf{N}}${}$) $\wedge$ {\rm{nendp}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nendp}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{nts+}}\,({\it{n\/}} $+$ {\it{k\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nts+} $=$ {\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}), {\it{tr+\/}}, {\it{w\/}})\index{nts+})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  warp-app-gap \\ \index{warp-app-gap}
\=\+(({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{r\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{nendp}}\,({\rm{len}}\,({\it{pad\/}})\index{len}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{app}}\,({\it{pad\/}}, {\it{lst\/}})\index{app}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{nendp}}\,({\rm{len}}\,({\it{pad\/}})\index{len} $+$ {\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp}$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{cons}}\,(\=\+{\rm{sig}}\,({\rm{app}}\,({\it{pad\/}}, {\it{lst\/}})\index{app}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{sig}, \\ 
{\rm{warp}}\,(\=\+{\rm{lst+}}\,(\=\+{\it{lst\/}}, \\ 
{\it{ts\/}} $+$ ({\rm{len}}\,({\it{pad\/}})\index{len} $*$ {\it{w\/}}), \\ 
{\it{r\/}} $+$ {\it{tr\/}}, \\ 
{\it{w\/}})\-\index{lst+}, \\ 
{\rm{nts+}}\,(\=\+{\rm{len}}\,({\it{lst\/}})\index{len}, \\ 
{\it{ts\/}} $+$ ({\rm{len}}\,({\it{pad\/}})\index{len} $*$ {\it{w\/}}), \\ 
{\it{r\/}} $+$ {\it{tr\/}}, \\ 
{\it{w\/}})\-\index{nts+}, \\ 
{\it{r\/}} $+$ {\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nendp-nlst* \\ \index{nendp-nlst*}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;${\rm{nendp}}\,({\rm{nlst*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\it{r\/}} $+$ {\rm{ntr*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}})\index{nendp}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{nqg} \\  
\=\+{\rm{nqg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nqg} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{w\/}} $+$ {\it{ts\/}} $+$ ({\it{w\/}} $*$ {\it{k\/}})) \\ 
{\bf then }\=\+{\bf if }({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{w\/}} $+$ {\it{ts\/}} $+$ ({\it{w\/}} $*$ {\it{k\/}}))$\;\;${\bf then }{\tt{3}} \\ 
{\bf else }{\tt{2}}$\;${\bf  endif}\- \\ 
{\bf else }{\tt{1}}$\;${\bf  endif}\-\-
\end{tabbing} \begin{verbatim}; case e

#|
(defn dwg (k ts tr w r)

; I have gotten this function wrong more times than I care to admit.
; I won't even try to explain the "logic" behind this defn.

  (let ((ts1 (plus ts (times k w)))
        (ts2 (plus ts w (times k w)))
        (ts3 (plus ts w w (times k w)))
        (tr1 (plus r tr))
        (tr2 (plus r r tr)))
    (cond ((lessp tr1 ts2)
           (if (lessp tr2 ts3) 0 1))
          ((equal tr1 ts2) 0)
          ((and (lessp ts2 tr1) (lessp tr1 ts3)) 0)
          ((lessp tr1 ts3) 0)
          (t 1))))
|#

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{dwg} \\  
\=\+{\rm{dwg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dwg} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}})) \\ 
{\bf then }\=\+{\bf if }({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}))$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\tt{1}}$\;${\bf  endif}\- \\ 
{\bf elseif }({\it{r\/}} $+$ {\it{tr\/}}) $=$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}))$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }\=\+(({\it{ts\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}})) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}})))\-$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}))$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\tt{1}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{tsg} \\  
{\rm{tsg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tsg} $=$ ({\it{ts\/}} $+$ ({\it{w\/}} $*$ {\it{k\/}}) $+$ {\it{w\/}} $+$ ({\it{w\/}} $*$ {\rm{dwg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dwg}))
\end{tabbing} \begin{verbatim}; the eaten element of n2

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{trg} \\  
{\rm{trg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{trg} $=$ ({\it{tr\/}} $+$ ({\it{r\/}} $*$ {\rm{nqg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nqg}))
\end{tabbing} \begin{verbatim}; the qs
        
\end{verbatim}\begin{tabbing}{\sc Theorem}:  not-lessp-ntr*-nts* \\ \index{not-lessp-ntr*-nts*}
\=\+(({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr\/}} $\not<$ {\it{ts\/}}) $\wedge$ ({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{ntr*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*} $\not<$ {\rm{nts*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-ntr*-nts* \\ \index{lessp-ntr*-nts*}
\=\+(({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr\/}} $\not<$ {\it{ts\/}}) $\wedge$ ({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$({\rm{ntr*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*} $<$ ({\it{w\/}} $+$ {\rm{nts*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nendp-is-usually-f \\ \index{nendp-is-usually-f}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\tt{2}} $<$ {\it{k\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{k\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp})\-
\end{tabbing}

\begin{verbatim}; Note: The following is the nts+ analogue of ts+-app.  However the
; rule is a little strange because one naturally would have written
; (nts+ (plus k rest) ...) since k is here the len of the initial
; portion of the list being scanned.  But in my actual application,
; the plus has been commuted so I commute it here.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  lessp-plus-nts*-times-w-nlst*-plus-r-ntr*-lemma \\ \index{lessp-plus-nts*-times-w-nlst*-p!lus-r-ntr*-lemma}
\=\+(\=\+{\rm{nendp}}\,({\it{k\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}})))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-plus-r-ntr*-plus-nts*-times-w-nlst* \\ \index{not-lessp-plus-r-ntr*-plus-nts*!-times-w-nlst*}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\it{r\/}} $+$ {\rm{ntr*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}) \\ 
$\not<$$\;\;\;\;$({\rm{nts*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*} $+$ ({\it{w\/}} $*$ {\rm{nlst*}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*})))\-\-
\end{tabbing}

\begin{verbatim}; That takes care of ts'<=tr'.  Now I'll get tr' < ts'+w.  In our case,
; ts' is (nts+ m ts'' tr' w r).  Now nts+ is going to push ts'' to within
; w or tr' unless m runs out.  So we have to make an argument that
; m is big enough.  It turns out that we know m is at least 18
; (because it is the encoding of a listp msg) and so if we assume w and r
; are within a factor of 2 of eachother, we can manage.

; These helper lemmas are generated mechanically by just grabbing
; the unproved goals generated in the next real theorem and forcing
; the expansion of the relevant terms.  Chances are there are some
; irrelevant hypotheses.  Some helper's subsumed others or changed the
; course of the proof so as to make others irrelevant.  Thus, their
; numbering is not consecutive.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  helper1 \\ \index{helper1}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,(\=\+{\rm{lst+}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{lst+}, \\ 
{\rm{nts+}}\,({\rm{len}}\,({\it{rest\/}})\index{len}, {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nts+}, \\ 
{\it{r\/}} $+$ {\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp} \\ 
$=$$\;\;\;\;${\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper5 \\ \index{helper5}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{k\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$((({\it{k\/}} $-\;1$) $-\;1$) $=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}))) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}))) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}))))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}), {\it{ts\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}), {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}} $+$ ({\it{k\/}} $*$ {\it{w\/}}), {\it{tr\/}} $+$ ({\tt{2}} $*$ {\it{r\/}}), {\it{w\/}}, {\it{r\/}})\index{warp})\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper7 \\ \index{helper7}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\it{flg1\/}}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}})), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper8 \\ \index{helper8}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not=$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{warp}}\,({\rm{cdr}}\,({\it{rest\/}}), {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper9 \\ \index{helper9}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\it{r\/}} $+$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\it{flg1\/}}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}})), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{warp}}\,(\=\+{\rm{cdr}}\,({\it{rest\/}}), \\ 
{\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, \\ 
{\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-)\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper10 \\ \index{helper10}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\it{r\/}} $+$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\it{flg1\/}}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}})), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp}))\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper11 \\ \index{helper11}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\it{r\/}} $+$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{w\/}}) $<$ ({\it{r\/}} $+$ {\it{tr\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\it{flg1\/}}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}})), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}}, {\it{tr\/}} $+$ ({\tt{3}} $*$ {\it{r\/}}), {\it{w\/}}, {\it{r\/}})\index{warp})\-)\-)\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-times-18 \\ \index{lessp-times-18}
{\rm{listp}}\,({\it{msg\/}}) $\rightarrow$ (({\tt{18}} $*$ {\rm{len}}\,({\it{msg\/}})\index{len}) $\not<$ {\tt{18}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  listn-add1 \\ \index{listn-add1}
{\rm{listn}}\,($1\;+$ {\it{n\/}}, {\it{flg\/}})\index{listn} $=$ {\rm{cons}}\,({\it{flg\/}}, {\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper14 \\ \index{helper14}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\it{r\/}} $+$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  helper15 \\ \index{helper15}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\it{r\/}} $+$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $\not<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{warp}}\,({\it{rest\/}}, {\it{ts\/}} $+$ {\it{w\/}}, {\it{r\/}} $+$ {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp})))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  warp-app-across-gap \\ \index{warp-app-across-gap}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{k\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{rest\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\rm{cdr}}\,({\it{rest\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{nendp}}\,({\it{k\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{app}}\,({\rm{listn}}\,({\it{k\/}}, {\it{flg1\/}})\index{listn}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}))\index{app}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{nqg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nqg}, {\tt{'}}{\tt{q}})\index{listn}, \\ 
{\rm{warp}}\,(\=\+{\rm{cdrn}}\,({\rm{dwg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dwg}, {\it{rest\/}})\index{cdrn}, \\ 
{\rm{tsg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tsg}, \\ 
{\rm{trg}}\,({\it{k\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{trg}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-\index{app})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable helper1.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper5.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper7.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper8.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper9.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper10.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper11.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper14.

\addvspace{18pt}

\noindent{\sc Event}:   Disable helper15.

\addvspace{18pt}


\noindent{\sc Event}:   Disable nqg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable dwg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable tsg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable trg.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{nq} \\  
\=\+{\rm{nq}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nq} \\ 
$=$$\;\;\;\;${\rm{nqg}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}}, {\it{r\/}})\index{nqg}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{dw} \\  
\=\+{\rm{dw}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dw} \\ 
$=$$\;\;\;\;${\rm{dwg}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}}, {\it{r\/}})\index{dwg}\-
\end{tabbing}


\begin{tabbing}{\sc Definition}:\index{ts} \\  
\=\+{\rm{ts}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ts} \\ 
$=$$\;\;\;\;${\rm{tsg}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}}, {\it{r\/}})\index{tsg}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{tr} \\  
\=\+{\rm{tr}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tr} \\ 
$=$$\;\;\;\;${\rm{trg}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}}, {\it{r\/}})\index{trg}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-2-len-implies-listps \\ \index{lessp-2-len-implies-listps}
({\tt{2}} $<$ {\rm{len}}\,({\it{x\/}})\index{len}) $\rightarrow$ ({\rm{listp}}\,({\it{x\/}}) $\wedge$ {\rm{listp}}\,({\rm{cdr}}\,({\it{x\/}})))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  warp-app-listn-q1 \\ \index{warp-app-listn-q1}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{n1\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{2}} $<$ {\rm{len}}\,({\it{rest\/}})\index{len}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{target}}\,({\rm{warp}}\,({\rm{app}}\,({\rm{listn}}\,({\it{n1\/}}, {\it{flg1\/}})\index{listn}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}))\index{app}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp})\index{target} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{n*}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}, {\it{flg1\/}})\index{listn}, \\ 
{\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{nq}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nq}, {\tt{'}}{\tt{q}})\index{listn}, \\ 
{\rm{warp}}\,(\=\+{\rm{cdrn}}\,({\rm{dw}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dw}, {\it{rest\/}})\index{cdrn}, \\ 
{\rm{ts}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ts}, \\ 
{\rm{tr}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tr}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-\index{app})\-\index{app})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  warp-app-listn-q \\ \index{warp-app-listn-q}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{n1\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{2}} $<$ {\rm{len}}\,({\it{rest\/}})\index{len}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{app}}\,({\rm{listn}}\,({\it{n1\/}}, {\it{flg1\/}})\index{listn}, {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\it{rest\/}}))\index{app}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{n*}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}, {\it{flg1\/}})\index{listn}, \\ 
{\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{nq}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nq}, {\tt{'}}{\tt{q}})\index{listn}, \\ 
{\rm{warp}}\,(\=\+{\rm{cdrn}}\,({\rm{dw}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dw}, {\it{rest\/}})\index{cdrn}, \\ 
{\rm{ts}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ts}, \\ 
{\rm{tr}}\,({\it{n1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{tr}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\-\index{app})\-\index{app})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable listn-add1.

\addvspace{18pt}

\noindent{\sc Event}:   Disable warp-app-across-gap.

\addvspace{18pt}

\noindent{\sc Event}:   Disable warp-app-gap.

\addvspace{18pt}

\noindent{\sc Event}:   Disable warp-listn.

\addvspace{18pt}

\noindent{\sc Event}:   Disable warp-app.

\addvspace{18pt}

\begin{verbatim}; Now there are two applications we must think about:  the proof of top and
; the proof of loop.  We will deal with top first.  To explore I want to
; do the smoothing and det part of top now and then come back to warp.

; Now we do the smoothing.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  smooth-congruence \\ \index{smooth-congruence}
\=\+($\neg$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(({\rm{smooth}}\,({\it{flg2\/}}, {\it{rest\/}})\index{smooth} $=$ {\rm{smooth}}\,({\it{flg1\/}}, {\it{rest\/}})\index{smooth}) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  smooth-flg-app-listn-flg \\ \index{smooth-flg-app-listn-flg}
\=\+($\neg$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{smooth}}\,({\it{flg1\/}}, {\rm{app}}\,({\rm{listn}}\,({\it{p1\/}}, {\it{flg2\/}})\index{listn}, {\it{rest\/}})\index{app})\index{smooth} \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{listn}}\,({\it{p1\/}}, {\it{flg2\/}})\index{listn}, {\rm{smooth}}\,({\it{flg1\/}}, {\it{rest\/}})\index{smooth})\index{app})\-\-
\end{tabbing}
                                                 
\begin{tabbing}{\sc Theorem}:  listp-app-listn \\ \index{listp-app-listn}
{\rm{listp}}\,({\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{rest\/}})\index{app}) $=$ (({\it{n\/}} $\not\simeq {\tt{0}}$) $\vee$ {\rm{listp}}\,({\it{rest\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  listp-cells \\ \index{listp-cells}
{\rm{listp}}\,({\rm{cells}}\,({\it{flg\/}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}) $=$ {\rm{listp}}\,({\it{msg\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable listp-app-listn.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  car-app \\ \index{car-app}
\=\+{\rm{car}}\,({\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{listp}}\,({\it{a\/}})$\;\;${\bf then }{\rm{car}}\,({\it{a\/}}) \\ 
{\bf else }{\rm{car}}\,({\it{b\/}})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  listp-listn \\ \index{listp-listn}
{\rm{listp}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}) $=$ ({\it{n\/}} $\not\simeq {\tt{0}}$)
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  car-cells \\ \index{car-cells}
{\rm{listp}}\,({\it{msg\/}}) $\rightarrow$ ({\rm{car}}\,({\rm{cells}}\,({\it{flg\/}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}) $=$ {\rm{b-not}}\,({\it{flg\/}})\index{b-not})
\end{tabbing}


\noindent{\sc Event}:   Disable car-app.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  top-smooth-step \\ \index{top-smooth-step}
\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{smooth}}\,({\bf{t}}, {\rm{app}}\,({\rm{listn}}\,({\it{p1\/}}, {\bf{t}})\index{listn}, {\rm{app}}\,({\rm{cells}}\,({\bf{t}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}, {\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\index{app})\index{app})\index{smooth} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{listn}}\,({\it{p1\/}}, {\bf{t}})\index{listn}, \\ 
{\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{smooth}}\,({\bf{f}}, {\rm{app}}\,({\rm{cdr}}\,({\rm{cells}}\,({\bf{t}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}), {\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\index{app})\index{smooth})\-)\-\index{app})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable smooth-flg-app-listn-flg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable car-cells.

\addvspace{18pt}

\noindent{\sc Event}:   Disable listp-cells.

\addvspace{18pt}

\begin{verbatim}; Now past the det

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{oracle*} \\  
\=\+{\rm{oracle*}}\,({\it{lst\/}}, {\it{oracle\/}})\index{oracle*} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{oracle\/}} \\ 
{\bf elseif }{\rm{car}}\,({\it{lst\/}}) $=$ {\tt{'}}{\tt{q}}$\;\;${\bf then }{\rm{oracle*}}\,({\rm{cdr}}\,({\it{lst\/}}), {\rm{cdr}}\,({\it{oracle\/}}))\index{oracle*} \\ 
{\bf else }{\rm{oracle*}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{oracle\/}})\index{oracle*}$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable oracle*.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  det-app \\ \index{det-app}
\=\+{\rm{det}}\,({\rm{app}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{app}, {\it{oracle\/}})\index{det} \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{det}}\,({\it{lst1\/}}, {\it{oracle\/}})\index{det}, {\rm{det}}\,({\it{lst2\/}}, {\rm{oracle*}}\,({\it{lst1\/}}, {\it{oracle\/}})\index{oracle*})\index{det})\index{app}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  det-listn \\ \index{det-listn}
({\it{flg\/}} $\not=$ {\tt{'}}{\tt{q}}) $\rightarrow$ ({\rm{det}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{oracle\/}})\index{det} $=$ {\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  oracle*-listn \\ \index{oracle*-listn}
({\it{flg\/}} $\not=$ {\tt{'}}{\tt{q}}) $\rightarrow$ ({\rm{oracle*}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{oracle\/}})\index{oracle*} $=$ {\it{oracle\/}})
\end{tabbing}

\begin{verbatim}; So now we combine all these.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  len-smooth \\ \index{len-smooth}
{\rm{len}}\,({\rm{smooth}}\,({\it{flg\/}}, {\it{lst\/}})\index{smooth})\index{len} $=$ {\rm{len}}\,({\it{lst\/}})\index{len}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cdr-app \\ \index{cdr-app}
\=\+{\rm{cdr}}\,({\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{listp}}\,({\it{a\/}})$\;\;${\bf then }{\rm{app}}\,({\rm{cdr}}\,({\it{a\/}}), {\it{b\/}})\index{app} \\ 
{\bf else }{\rm{cdr}}\,({\it{b\/}})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  top-async-send-lemma1 \\ \index{top-async-send-lemma1}
{\rm{listp}}\,({\it{msg\/}}) $\rightarrow$ ({\tt{2}} $<$ {\rm{len}}\,({\rm{cdr}}\,({\rm{cells}}\,({\bf{t}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}))\index{len})
\end{tabbing}


\noindent{\sc Event}:   Disable cdr-app.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  top-async-send \\ \index{top-async-send}
\=\+(\=\+{\rm{bvp}}\,({\it{msg\/}})\index{bvp} \\ 
$\wedge$$\;\;\;\;${\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{p1\/}} $\in\;${\bf{N}}${}$))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{async}}\,({\rm{send}}\,({\it{msg\/}}, {\it{p1\/}}, {\tt{5}}, {\tt{13}}, {\it{p2\/}})\index{send}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}}, {\it{oracle\/}})\index{async} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{n*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}, {\bf{t}})\index{listn}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,(\=\+{\rm{listn}}\,(\=\+{\rm{nqg}}\,(\=\+{\rm{nlst*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nqg}, \\ 
{\tt{'}}{\tt{q}})\-\index{listn}, \\ 
{\it{oracle\/}})\-\index{det}, \\ 
{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{cdrn}}\,(\=\+{\rm{dwg}}\,(\=\+{\rm{nlst*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{dwg}, \\ 
{\rm{smooth}}\,(\=\+{\bf{f}}, \\ 
{\rm{app}}\,(\=\+{\rm{cdr}}\,({\rm{cells}}\,({\bf{t}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}), \\ 
{\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\-\index{app})\-\index{smooth})\-\index{cdrn}, \\ 
{\rm{tsg}}\,(\=\+{\rm{nlst*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tsg}, \\ 
{\rm{trg}}\,(\=\+{\rm{nlst*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{trg}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\rm{oracle*}}\,(\=\+{\rm{listn}}\,(\=\+{\rm{nqg}}\,(\=\+{\rm{nlst*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{p1\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nqg}, \\ 
{\tt{'}}{\tt{q}})\-\index{listn}, \\ 
{\it{oracle\/}})\-\index{oracle*})\-\index{det})\-\index{app})\-\index{app})\-\-
\end{tabbing}
                  

\noindent{\sc Event}:   Disable top-async-send-lemma1.

\addvspace{18pt}

\noindent{\sc Event}:   Disable top-smooth-step.

\addvspace{18pt}

\begin{verbatim}; Now we get recv to eat the header.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  scan-app-listn \\ \index{scan-app-listn}
{\rm{scan}}\,({\it{flg\/}}, {\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{rest\/}})\index{app})\index{scan} $=$ {\rm{scan}}\,({\it{flg\/}}, {\it{rest\/}})\index{scan}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  top-recv-step \\ \index{top-recv-step}
{\rm{recv}}\,({\it{n\/}}, {\bf{t}}, {\it{k\/}}, {\rm{app}}\,({\rm{listn}}\,({\it{p1\/}}, {\bf{t}})\index{listn}, {\it{rest\/}})\index{app})\index{recv} $=$ {\rm{recv}}\,({\it{n\/}}, {\bf{t}}, {\it{k\/}}, {\it{rest\/}})\index{recv}
\end{tabbing}

\begin{verbatim}#| At this point our top level goal looks like this
(equal (recv (len msg)
             t 10
             (app (det (listn (nqg (nlst* p1 ts tr w r)
                                   (nts* p1 ts tr w r)
                                   (ntr* p1 ts tr w r)
                                   w r)
                              'q)
                       oracle)
                  (det (warp (cdrn (dwg (nlst* p1 ts tr w r)
                                        (nts* p1 ts tr w r)
                                        (ntr* p1 ts tr w r)
                                        w r)
                                   (smooth f
                                           (app (cdr (cells t 5 13 msg))
                                                (listn p2 t))))
                             (tsg (nlst* p1 ts tr w r)
                                  (nts* p1 ts tr w r)
                                  (ntr* p1 ts tr w r)
                                  w r)
                             (trg (nlst* p1 ts tr w r)
                                  (nts* p1 ts tr w r)
                                  (ntr* p1 ts tr w r)
                                  w r)
                             w r)
                       (oracle* (listn (nqg (nlst* p1 ts tr w r)
                                            (nts* p1 ts tr w r)
                                            (ntr* p1 ts tr w r)
                                            w r)
                                       'q)
                                oracle))))
       msg)
and we will generalize it to
(equal (recv (len msg)
             t 10
             (app (det (listn nq 'q) oracle1)
                  (det (warp (cdrn dw
                                   (smooth f
                                           (app (cdr (cells t 5 13 msg))
                                                (listn p2 t))))
                             ts tr w r)
                       oracle2)))
       msg)
where we have the usual bounds on nq, dw, ts and tr.

To justify this generalization we must prove the theorems that the
expressions generalized satisfy the usual bounds.  We do that now.

|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  nqg-bounds \\ \index{nqg-bounds}
({\tt{0}} $<$ {\rm{nqg}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nqg}) $\wedge$ ({\tt{3}} $\not<$ {\rm{nqg}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nqg})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  dwg-bounds \\ \index{dwg-bounds}
{\tt{1}} $\not<$ {\rm{dwg}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{dwg}
\end{tabbing}

\begin{verbatim}; Typically trg and tsg will be instantiated as below.  We package up
; the required backchaining here.  It is my impression that the
; generalized form in which the * terms do not appear is not a
; theorem.  The proof of this relies upon 
; NOT-LESSP-PLUS-R-NTR*-PLUS-NTS*-TIMES-W-NLST*.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  not-lessp-trg*-tsg* \\ \index{not-lessp-trg*-tsg*}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{trg}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}}, {\it{r\/}})\index{trg} \\ 
$\not<$$\;\;\;\;${\rm{tsg}}\,(\=\+{\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tsg})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-trg*-plus-w-tsg* \\ \index{lessp-trg*-plus-w-tsg*}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{trg}}\,({\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, {\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, {\it{w\/}}, {\it{r\/}})\index{trg} \\ 
$<$$\;\;\;\;$({\it{w\/}} $+$ {\rm{tsg}}\,(\=\+{\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tsg}))\-\-
\end{tabbing}

\begin{verbatim}#|
Consider the lhs of the concl of loop:

(recv (len msg)
      flg1
      10
      (app (det (listn nq 'q) oracle1)
           (det (warp (cdrn dw
                            (smooth flg2
                                    (app (cdr (cells flg1 5 13 msg))
                                         (listn p2 t))))
                      ts tr w r)
                oracle2)))

We will derive a killer rewrite rule that expands this, under the
conditions governing our induction, into (cons (car msg) ...) where
... is an instance of the lhs above.  I.e., the rule will step the
lhs of the ind concl into the induction hypothesis.  The derivation of
this rule will be documented by showing the successive steps.  The
actual discovery of the form of the lhs above and the steps was
made by proving the "killer rule" over and over again, each time
making some transformation.

The first step is to open (cells flg1 5 13 msg), drive the cdr around
the first cell and absorb it into the cell size, and associate the apps,
|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  cdr-app-cell-cells \\ \index{cdr-app-cell-cells}
\=\+({\it{n1\/}} $\not\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cdr}}\,({\rm{app}}\,({\rm{cell}}\,({\it{flg1\/}}, {\it{n1\/}}, {\it{n2\/}}, {\it{bit\/}})\index{cell}, {\rm{cells}}\,({\it{flg2\/}}, {\it{n1\/}}, {\it{n2\/}}, {\it{msg\/}})\index{cells})\index{app}) \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{cell}}\,({\it{flg1\/}}, {\it{n1\/}} $-\;1$, {\it{n2\/}}, {\it{bit\/}})\index{cell}, {\rm{cells}}\,({\it{flg2\/}}, {\it{n1\/}}, {\it{n2\/}}, {\it{msg\/}})\index{cells})\index{app})\-\-
\end{tabbing}

\begin{verbatim}#|
So lhs becomes:
(recv (len msg)
      flg1
      10
      (app (det (listn nq 'q) oracle1)
           (det (warp (cdrn dw
                            (smooth flg2
                                    (app (cell flg1 4 13 (car msg))
                                         (app (cells (csig flg1 (car msg)) 5 13 (cdr msg))
                                              (listn p2 t)))))
                      ts tr w r)
                oracle2)))

Our next goal is to drive the smooth through the app.
|#
\end{verbatim}\begin{tabbing}{\sc Theorem}:  smooth-flg-listn-flg \\ \index{smooth-flg-listn-flg}
($\neg$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) $\rightarrow$ ({\rm{smooth}}\,({\it{flg1\/}}, {\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn})\index{smooth} $=$ {\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-b-xor-b-not \\ \index{not-b-xor-b-not}
\=\+{\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor} \\ 
$\rightarrow$$\;\;\;\;$(($\neg$ {\rm{b-xor}}\,({\it{flg1\/}}, {\rm{b-not}}\,({\it{flg2\/}})\index{b-not})\index{b-xor}) $\wedge$ ($\neg$ {\rm{b-xor}}\,({\rm{b-not}}\,({\it{flg2\/}})\index{b-not}, {\it{flg1\/}})\index{b-xor}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  smooth-flg-app-listn-not-flg \\ \index{smooth-flg-app-listn-not-flg}
\=\+(({\it{n\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{smooth}}\,({\it{flg1\/}}, {\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn}, {\it{rest\/}})\index{app})\index{smooth} \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{smooth}}\,({\it{flg1\/}}, {\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn})\index{smooth}, {\rm{smooth}}\,({\it{flg2\/}}, {\it{rest\/}})\index{smooth})\index{app})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  smooth-app-cell-app-cells \\ \index{smooth-app-cell-app-cells}
\=\+(({\it{n1\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{smooth}}\,(\=\+{\it{flg1\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{cell}}\,({\it{flg2\/}}, {\it{m1\/}}, {\it{n1\/}}, {\it{bit\/}})\index{cell}, \\ 
{\rm{app}}\,({\rm{cells}}\,({\rm{csig}}\,({\it{flg2\/}}, {\it{bit\/}})\index{csig}, {\it{m\/}}, {\it{n\/}}, {\it{msg\/}})\index{cells}, {\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\index{app})\-\index{app})\-\index{smooth} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{smooth}}\,({\it{flg1\/}}, {\rm{cell}}\,({\it{flg2\/}}, {\it{m1\/}}, {\it{n1\/}}, {\it{bit\/}})\index{cell})\index{smooth}, \\ 
{\rm{smooth}}\,(\=\+{\rm{csig}}\,({\it{flg2\/}}, {\it{bit\/}})\index{csig}, \\ 
{\rm{app}}\,({\rm{cells}}\,({\rm{csig}}\,({\it{flg2\/}}, {\it{bit\/}})\index{csig}, {\it{m\/}}, {\it{n\/}}, {\it{msg\/}})\index{cells}, {\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\index{app})\-\index{smooth})\-\index{app})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable smooth-flg-listn-flg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable smooth-flg-app-listn-not-flg.

\addvspace{18pt}

\begin{verbatim}; If we had loop-stoppers on iff rules we could use an iff and be more efficient.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  b-xor-commutes \\ \index{b-xor-commutes}
{\rm{b-xor}}\,({\it{x\/}}, {\it{y\/}})\index{b-xor} $\rightarrow$ {\rm{b-xor}}\,({\it{y\/}}, {\it{x\/}})\index{b-xor}
\end{tabbing}

\begin{verbatim}#|
So lhs is now:
(recv (len msg)
      flg1
      10
      (app (det (listn nq 'q) oracle1)
           (det (warp (cdrn dw
                            (app (smooth flg2 (cell flg1 4 13 (car msg)))
                                 (smooth (csig flg1 (car msg))
                                         (app (cells (csig flg1 (car msg)) 5 13 (cdr msg))
                                              (listn p2 t)))))
                      ts tr w r)
                oracle2)))
Now drive the cdrn into the app and the smooth and absorb it in the
cell size.

|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  listp-smooth-cell \\ \index{listp-smooth-cell}
({\it{m\/}} $\not\simeq {\tt{0}}$) $\rightarrow$ {\rm{listp}}\,({\rm{smooth}}\,({\it{flg1\/}}, {\rm{cell}}\,({\it{flg2\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{smooth})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cdrn-dw-app-smooth-cell \\ \index{cdrn-dw-app-smooth-cell}
\=\+(({\it{m\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{dw\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\tt{1}} $\not<$ {\it{dw\/}})) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cdrn}}\,({\it{dw\/}}, {\rm{app}}\,({\rm{smooth}}\,({\it{flg1\/}}, {\rm{cell}}\,({\it{flg2\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{smooth}, {\it{rest\/}})\index{app})\index{cdrn} \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{cdrn}}\,({\it{dw\/}}, {\rm{smooth}}\,({\it{flg1\/}}, {\rm{cell}}\,({\it{flg2\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{smooth})\index{cdrn}, {\it{rest\/}})\index{app})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  car-listn \\ \index{car-listn}
\=\+{\rm{car}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\it{flg\/}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cdrn-dw-smooth-cell \\ \index{cdrn-dw-smooth-cell}
\=\+(({\it{m\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{dw\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\tt{1}} $\not<$ {\it{dw\/}}) $\wedge$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cdrn}}\,({\it{dw\/}}, {\rm{smooth}}\,({\it{flg2\/}}, {\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}}, {\it{n\/}}, {\rm{car}}\,({\it{msg\/}}))\index{cell})\index{smooth})\index{cdrn} \\ 
$=$$\;\;\;\;${\rm{smooth}}\,({\it{flg2\/}}, {\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}} $-$ {\it{dw\/}}, {\it{n\/}}, {\rm{car}}\,({\it{msg\/}}))\index{cell})\index{smooth})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable car-listn.

\addvspace{18pt}

\begin{verbatim}#|
So lhs is
(recv (len msg)
      flg1
      10
      (app (det (listn nq 'q) oracle1)
           (det (warp (app (smooth flg2 (cell flg1 (difference 4 dw) 13 (car msg)))
                           (smooth (csig flg1 (car msg))
                                   (app (cells (csig flg1 (car msg)) 5 13 (cdr msg))
                                        (listn p2 t))))
                      ts tr w r)
                oracle2)))
Next we drive the warp through the app.  We do that by putting a TARGET around
the warp and enabling warp-app.  To simplify the resulting len expressions we
use:
|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  len-cell \\ \index{len-cell}
{\rm{len}}\,({\rm{cell}}\,({\it{flg\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{len} $=$ ({\it{m\/}} $+$ {\it{n\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  add1-plus-12-difference-4-dw \\ \index{add1-plus-12-difference-4-dw}
({\tt{1}} $\not<$ {\it{dw\/}}) $\rightarrow$ (($1\;+$ ({\tt{12}} $+$ ({\tt{4}} $-$ {\it{dw\/}}))) $=$ ({\tt{17}} $-$ {\it{dw\/}}))
\end{tabbing}

\begin{verbatim}#|
Det-app also applies to drive the det through the app.
So now lhs is
(recv
 (len msg)
 flg1 10
 (app (det (listn nq 'q) oracle1)
      (app (det (warp (smooth flg2
                              (cell flg1
                                    (difference 4 dw)
                                    13
                                    (car msg)))
                      ts tr w r)
                oracle2)
           (det (warp (app (lst* (smooth flg2
                                         (cell flg1
                                               (difference 4 dw)
                                               13
                                               (car msg)))
                                 ts tr w r)
                           (smooth (csig flg1 (car msg))
                                   (app (cells (csig flg1 (car msg)) 5
                                               13
                                               (cdr msg))
                                        (listn p2 t))))
                      (nts* (difference 17 dw) ts tr w r)
                      (ntr* (difference 17 dw) ts tr w r)
                      w r)
                (oracle* (app (lst* (smooth flg2
                                            (cell flg1
                                                  (difference 4 dw)
                                                  13
                                                  (car msg)))
                                    ts tr w r)
                              (smooth (csig flg1 (car msg))
                                      (app (cells (csig flg1 (car msg)) 5
                                                  13
                                                  (cdr msg))
                                           (listn p2 t))))
                         oracle2)))))

Consider the second warp expression, the one applied to (app (lst* ...)...).
We want to apply warp-app-listn-q to this, which expects 
(app (listn n1 flg1) (cons 'q rest))

So now we focus on causing that to happen.  The lst* produces a listn.
Our induction will make a base case out of the one-bit msg.  So we know
the current cell is followed by another and hence by an edge.
So our 'q comes from there.

We have this induction in mind but we don't yet know the ... parts. The
variables are listed in order of appearance.

(defn loop-ind-hint (nq oracle1 dw flg2 flg1 msg ts tr w r oracle2)
  (cond ((nlistp msg) t)
        ((nlistp (cdr msg)) t)
        (t (loop-ind-hint ... (cdr msg) ...))))

|#

; "The lst* produces a listn."

\end{verbatim}\begin{tabbing}{\sc Theorem}:  lst*-is-lastn-nlst* \\ \index{lst*-is-lastn-nlst*}
{\rm{lst*}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*} $=$ {\rm{lastn}}\,({\rm{nlst*}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\it{lst\/}})\index{lastn}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lastn-app \\ \index{lastn-app}
({\rm{len}}\,({\it{b\/}})\index{len} $\not<$ {\it{n\/}}) $\rightarrow$ ({\rm{lastn}}\,({\it{n\/}}, {\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app})\index{lastn} $=$ {\rm{lastn}}\,({\it{n\/}}, {\it{b\/}})\index{lastn})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-2-nlst* \\ \index{not-lessp-2-nlst*}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$({\tt{2}} $\not<$ {\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  smooth-flg-listn-not-flg \\ \index{smooth-flg-listn-not-flg}
\=\+(({\it{n\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{smooth}}\,({\it{flg1\/}}, {\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn})\index{smooth} $=$ {\rm{cons}}\,({\tt{'}}{\tt{q}}, {\rm{listn}}\,({\it{n\/}} $-\;1$, {\it{flg2\/}})\index{listn}))\-
\end{tabbing}


\noindent{\sc Event}:   Disable smooth-flg-listn-not-flg.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  lst*-smooth-cell \\ \index{lst*-smooth-cell}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{m\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{2}} $<$ {\it{n\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{lst*}}\,({\rm{smooth}}\,({\it{flg2\/}}, {\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{smooth}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{lst*} \\ 
$=$$\;\;\;\;${\rm{listn}}\,({\rm{nlst*}}\,({\it{m\/}} $+$ {\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, {\rm{csig}}\,({\it{flg1\/}}, {\it{bit\/}})\index{csig})\index{listn})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable lst*-is-lastn-nlst*.

\addvspace{18pt}


\begin{verbatim}#|
So lhs is
(recv
 (len msg)
 flg1 10
 (app (det (listn nq 'q) oracle1)
      (app (det (warp (smooth flg2
                              (cell flg1
                                    (difference 4 dw)
                                    13
                                    (car msg)))
                      ts tr w r)
                oracle2)
           (det (warp (app (listn (nlst* (difference 17 dw) ts tr w r)
                                  (csig flg1 (car msg)))
                           (smooth (csig flg1 (car msg))
                                   (app (cells (csig flg1 (car msg)) 5
                                               13
                                               (cdr msg))
                                        (listn p2 t))))
                      (nts* (difference 17 dw) ts tr w r)
                      (ntr* (difference 17 dw) ts tr w r)
                      w r)
                (oracle* (warp (smooth flg2
                                       (cell flg1
                                             (difference 4 dw)
                                             13
                                             (car msg)))
                               ts tr w r)
                         oracle2)))))

And we're going to milk a 'q out of the smoothing of the cells term.
|#

; "So our 'q comes from there."

\end{verbatim}\begin{tabbing}{\sc Theorem}:  cdr-listn \\ \index{cdr-listn}
\=\+{\rm{cdr}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\rm{listn}}\,({\it{n\/}} $-\;1$, {\it{flg\/}})\index{listn}$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable cdr-listn.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  smooth-app-cells \\ \index{smooth-app-cells}
\=\+({\rm{listp}}\,({\it{msg\/}}) $\wedge$ ({\it{m\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{smooth}}\,({\it{flg\/}}, {\rm{app}}\,({\rm{cells}}\,({\it{flg\/}}, {\it{m\/}}, {\it{n\/}}, {\it{msg\/}})\index{cells}, {\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\index{app})\index{smooth} \\ 
$=$$\;\;\;\;${\rm{cons}}\,(\=\+{\tt{'}}{\tt{q}}, \\ 
{\rm{smooth}}\,(\=\+{\rm{b-not}}\,({\it{flg\/}})\index{b-not}, \\ 
{\rm{app}}\,({\rm{cdr}}\,({\rm{cells}}\,({\it{flg\/}}, {\it{m\/}}, {\it{n\/}}, {\it{msg\/}})\index{cells}), {\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\index{app})\-\index{smooth})\-)\-\-
\end{tabbing}

\begin{verbatim}#|
So lhs is
(recv
 (len msg)
 flg1 10
 (app (det (listn nq 'q) oracle1)
      (app (det (warp (smooth flg2
                              (cell flg1
                                    (difference 4 dw)
                                    13
                                    (car msg)))
                      ts tr w r)
                oracle2)
           (det (warp (app (listn (nlst* (difference 17 dw) ts tr w r)
                                  (csig flg1 (car msg)))
                           (cons 'q
                                 (smooth (b-not (csig flg1 (car msg)))
                                         (app (cdr (cells (csig flg1 (car msg)) 5
                                                          13
                                                          (cdr msg)))
                                              (listn p2 t)))))
                      (nts* (difference 17 dw) ts tr w r)
                      (ntr* (difference 17 dw) ts tr w r)
                      w r)
                (oracle* (warp (smooth flg2
                                       (cell flg1
                                             (difference 4 dw)
                                             13
                                             (car msg)))
                               ts tr w r)
                         oracle2)))))
Observe that warp-app-listn-q is now applicable if we can relieve the hypotheses.
The only nonobvious one is relieved by:
|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  lessp-2-len-cdr-cells \\ \index{lessp-2-len-cdr-cells}
{\rm{listp}}\,({\it{msg\/}}) $\rightarrow$ ({\tt{2}} $<$ {\rm{len}}\,({\rm{cdr}}\,({\rm{cells}}\,({\it{flg\/}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}))\index{len})
\end{tabbing}

\begin{verbatim}; So warp-app-listn-q will push the warp through the two apps and let
; det-app push the det through.  Note that while warp-app-listn-q normally
; kicks out some t's or f's before the 'qs the initial string here is
; empty because we're starting with only nlst* of them.  Of course, we
; have to know

\end{verbatim}\begin{tabbing}{\sc Theorem}:  app-listn-0 \\ \index{app-listn-0}
{\rm{app}}\,({\rm{listn}}\,({\tt{0}}, {\it{flg\/}})\index{listn}, {\it{rest\/}})\index{app} $=$ {\it{rest\/}}
\end{tabbing}

\begin{verbatim}; We include the app because in the proof of our killer rule, app will be
; disabled.

; We are now ready to solidfy our gains as the first step of our killer
; rule. We use the name loop-killer-1a because it has a TARGET on our
; warp.  Loop-killer-1, next, doesn't. 

\end{verbatim}%\item 
\begin{verbatim}


; We include the app because in the proof of our killer rule, app will be
; disabled.

; We are now ready to solidfy our gains as the first step of our killer
; rule. We use the name loop-killer-1a because it has a TARGET on our
; warp.  Loop-killer-1, next, doesn't. 

(prove-lemma loop-killer-1a nil
  (implies (and (bvp msg)
                (listp msg)
                (listp (cdr msg))
                (numberp ts)
                (numberp tr)
                (not (zerop w))
                (not (zerop r))
                (not (lessp tr ts))
                (lessp tr (plus ts w))
                (rate-proximity w r)

                (numberp nq)
                (not (lessp 3 nq))
                (numberp dw)
                (not (lessp 1 dw))
                (b-xor flg1 flg2))
           (equal (recv (len msg)
                        flg1
                        10
                        (app (det (listn nq 'q) oracle1)
                             (det (target (warp (cdrn dw
                                                      (smooth flg2
                                                              (app (cdr (cells flg1 5 13 msg))
                                                                   (listn p2 t))))
                                                ts tr w r))
                                  oracle2)))
                  (recv
                   (len msg)
                   flg1 10
                   (app (det (listn nq 'q) oracle1)
                        (app (det (warp (smooth flg2
                                                (cell flg1
                                                      (difference 4 dw)
                                                      13
                                                      (car msg)))
                                        ts tr w r)
                                  oracle2)
                             (app (det (listn (nqg (nlst* (difference 17 dw) ts tr w r)
                                                   (nts* (difference 17 dw) ts tr w r)
                                                   (ntr* (difference 17 dw) ts tr w r)
                                                   w r)
                                              'q)
                                       (oracle* (warp (smooth flg2
                                                              (cell flg1
                                                                    (difference 4 dw)
                                                                    13
                                                                    (car msg)))
                                                      ts tr w r)
                                                oracle2))
                                  (det (warp (cdrn (dwg (nlst* (difference 17 dw) ts tr w r)
                                                        (nts* (difference 17 dw) ts tr w r)
                                                        (ntr* (difference 17 dw) ts tr w r)
                                                        w r)
                                                   (smooth (b-not (csig flg1 (car msg)))
                                                           (app (cdr (cells (csig flg1 (car msg)) 5
                                                                            13
                                                                            (cdr msg)))
                                                                (listn p2 t))))
                                             (tsg (nlst* (difference 17 dw) ts tr w r)
                                                  (nts* (difference 17 dw) ts tr w r)
                                                  (ntr* (difference 17 dw) ts tr w r)
                                                  w r)
                                             (trg (nlst* (difference 17 dw) ts tr w r)
                                                  (nts* (difference 17 dw) ts tr w r)
                                                  (ntr* (difference 17 dw) ts tr w r)
                                                  w r)
                                             w r)
                                       (oracle* (listn (nqg (nlst* (difference 17 dw) ts tr w r)
                                                            (nts* (difference 17 dw) ts tr w r)
                                                            (ntr* (difference 17 dw) ts tr w r)
                                                            w r)
                                                       'q)
                                                (oracle* (warp (smooth flg2
                                                         (cell flg1
                                                               (difference 4 dw)
                                                               13
                                                               (car msg)))
                                                 ts tr w r)
                                           oracle2)))))))))
  ((disable len app cells)
   (enable warp-app)
   (expand (cells flg1 5 13 msg))))
\end{verbatim}



\noindent{\sc Event}:   Disable cdr-app-cell-cells.

\addvspace{18pt}

\noindent{\sc Event}:   Disable smooth-app-cells.

\addvspace{18pt}

\noindent{\sc Event}:   Disable smooth-app-cell-app-cells.

\addvspace{18pt} \begin{verbatim}; used to be loop-smooth-step
\end{verbatim}
\noindent{\sc Event}:   Disable cdrn-dw-smooth-cell.

\addvspace{18pt}

\noindent{\sc Event}:   Disable cdrn-dw-app-smooth-cell.

\addvspace{18pt}

\noindent{\sc Event}:   Disable lst*-smooth-cell.

\addvspace{18pt}

%\item 
\begin{verbatim}


(prove-lemma loop-killer-1 (rewrite)
  (implies (and (bvp msg)
                (listp msg)
                (listp (cdr msg))
                (numberp ts)
                (numberp tr)
                (not (zerop w))
                (not (zerop r))
                (not (lessp tr ts))
                (lessp tr (plus ts w))
                (rate-proximity w r)

                (numberp nq)
                (not (lessp 3 nq))
                (numberp dw)
                (not (lessp 1 dw))
                (b-xor flg1 flg2))
           (equal (recv (len msg)
                        flg1
                        10
                        (app (det (listn nq 'q) oracle1)
                             (det (warp (cdrn dw
                                              (smooth flg2
                                                      (app (cdr (cells flg1 5 13 msg))
                                                           (listn p2 t))))
                                        ts tr w r)
                                  oracle2)))
                  (recv
                   (len msg)
                   flg1 10
                   (app (det (listn nq 'q) oracle1)
                        (app (det (warp (smooth flg2
                                                (cell flg1
                                                      (difference 4 dw)
                                                      13
                                                      (car msg)))
                                        ts tr w r)
                                  oracle2)
                             (app (det (listn (nqg (nlst* (difference 17 dw) ts tr w r)
                                                   (nts* (difference 17 dw) ts tr w r)
                                                   (ntr* (difference 17 dw) ts tr w r)
                                                   w r)
                                              'q)
                                       (oracle* (warp (smooth flg2
                                                              (cell flg1
                                                                    (difference 4 dw)
                                                                    13
                                                                    (car msg)))
                                                      ts tr w r)
                                                oracle2))
                                  (det (warp (cdrn (dwg (nlst* (difference 17 dw) ts tr w r)
                                                        (nts* (difference 17 dw) ts tr w r)
                                                        (ntr* (difference 17 dw) ts tr w r)
                                                        w r)
                                                   (smooth (b-not (csig flg1 (car msg)))
                                                           (app (cdr (cells (csig flg1 (car msg)) 5
                                                                            13
                                                                            (cdr msg)))
                                                                (listn p2 t))))
                                             (tsg (nlst* (difference 17 dw) ts tr w r)
                                                  (nts* (difference 17 dw) ts tr w r)
                                                  (ntr* (difference 17 dw) ts tr w r)
                                                  w r)
                                             (trg (nlst* (difference 17 dw) ts tr w r)
                                                  (nts* (difference 17 dw) ts tr w r)
                                                  (ntr* (difference 17 dw) ts tr w r)
                                                  w r)
                                             w r)
                                       (oracle* (listn (nqg (nlst* (difference 17 dw) ts tr w r)
                                                            (nts* (difference 17 dw) ts tr w r)
                                                            (ntr* (difference 17 dw) ts tr w r)
                                                            w r)
                                                       'q)
                                                (oracle* (warp (smooth flg2
                                                         (cell flg1
                                                               (difference 4 dw)
                                                               13
                                                               (car msg)))
                                                 ts tr w r)
                                           oracle2)))))))))
  ((enable target)
   (use (loop-killer-1a))))
\end{verbatim}


\begin{verbatim}#|
Observe in the rhs of loop-killer-1 the emergence of an instance of the 
critical part of the lhs:

(app (det (listn nq 'q)
          oracle1)
     (det (warp (cdrn dw
                      (smooth flg2
                              (app (cdr (cells flg1 5 13 msg))
                                   (listn p2 t))))
                ts tr w r)
          oracle2))
From this instance we can read off our induction hypothesis:
|#

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{loop-ind-hint} \\  
\=\+{\rm{loop-ind-hint}}\,({\it{nq\/}}, {\it{oracle1\/}}, {\it{dw\/}}, {\it{flg2\/}}, {\it{flg1\/}}, {\it{msg\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}}, {\it{oracle2\/}})\index{loop-ind-hint} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{msg\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\rm{cdr}}\,({\it{msg\/}}) $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\rm{loop-ind-hint}}\,(\=\+{\rm{nqg}}\,(\=\+{\rm{nlst*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nqg}, \\ 
{\rm{oracle*}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{cell}}\,(\=\+{\it{flg1\/}}, \\ 
{\tt{4}} $-$ {\it{dw\/}}, \\ 
{\tt{13}}, \\ 
{\rm{car}}\,({\it{msg\/}}))\-\index{cell})\-\index{smooth}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle2\/}})\-\index{oracle*}, \\ 
{\rm{dwg}}\,(\=\+{\rm{nlst*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{dwg}, \\ 
{\rm{b-not}}\,({\rm{csig}}\,({\it{flg1\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig})\index{b-not}, \\ 
{\rm{csig}}\,({\it{flg1\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig}, \\ 
{\rm{cdr}}\,({\it{msg\/}}), \\ 
{\rm{tsg}}\,(\=\+{\rm{nlst*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tsg}, \\ 
{\rm{trg}}\,(\=\+{\rm{nlst*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{trg}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}}, \\ 
{\rm{oracle*}}\,(\=\+{\rm{listn}}\,(\=\+{\rm{nqg}}\,(\=\+{\rm{nlst*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nqg}, \\ 
{\tt{'}}{\tt{q}})\-\index{listn}, \\ 
{\rm{oracle*}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{cell}}\,(\=\+{\it{flg1\/}}, \\ 
{\tt{4}} $-$ {\it{dw\/}}, \\ 
{\tt{13}}, \\ 
{\rm{car}}\,({\it{msg\/}}))\-\index{cell})\-\index{smooth}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle2\/}})\-\index{oracle*})\-\index{oracle*})\-\index{loop-ind-hint}$\;${\bf  endif}\-\-
\end{tabbing}
                          

\begin{verbatim}#|
In order for this induction to work out, we have to be able to establish that
the instantiations satisfy the hypotheses of the theorem being proved.  We
have made sure of this through the previously proved lemmas NQG-BOUNDS,
DWG-BOUNDS, NOT-LESSP-TRG*-TSG* and LESSP-TRG*-PLUS-W-TSG*.

Loop-killer-1 does not get us back to the induction hypothesis because
we have to scan past the first cell.  So we now continue with our loop
killer development.  We aim for the following rewrite (under appropriate
hyps):

(equal (recv (len msg) flg1 10
             (app (det (listn nq 'q) oracle1)
                  (app (det (warp (smooth flg2 (cell flg1 (difference 4 dw) 13 bit))
                                  ts tr w r)
                            oracle)
                       rest)))
       (cons bit
             (recv (len (cdr msg))
                   (csig flg1 bit)
                   10
                   rest)))

This will be the conclusion of loop-killer-2.  Observe that killer-2 takes up
where killer-1 left off and, in conjunction with the induction hyp, will
reduce the lhs of the induction concl to (cons (car msg) (cdr msg)).

We resume our step-by-step development by considering the lhs recv above and
successively transforming it.

By opening up the lhs recv above we end up with two hard requirements.
The first is that recv reads the correct bit.  We'll call this
loop-killer-2a:
(recv-bit 10
          (scan flg1
                (app (det (listn nq 'q) oracle1)
                     (app (det (warp (smooth flg2
                                             (cell flg1
                                                   (difference 4 dw)
                                                   13
                                                   (car msg)))
                                     ts tr w r)
                               oracle)
                          rest))))
= (car msg)

The second is that it resumes it scan on a string of bits of the
correct parity.
Loop-killer-2b:
(cdrn 10
      (scan flg1
            (app (det (listn nq 'q) oracle1)
                 (app (det (warp (smooth flg2
                                         (cell flg1 (difference 4 dw) 13 (car msg))
                                 ts tr w r)
                           oracle)
                      rest)))))
= (app (listn ??? (csig flg1 x)) rest)
where ??? is some non-zero number we'll determine during the proof below.

It is loop-killer-2b that gets us back to our induction hyp and
so we will work on it first.  As usual the game is to move the app from
its hiding place in cell through smooth, warp, and det and then do some
arithmetic.

Because it is crucial to all that we do henceforth, we are going to
first show what (warp (smooth flg2 (cell flg1 m n bit)) ts tr w r)
looks like.


|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  app-listn-flg-listn-flg \\ \index{app-listn-flg-listn-flg}
{\rm{app}}\,({\rm{listn}}\,({\it{m\/}}, {\it{flg\/}})\index{listn}, {\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})\index{app} $=$ {\rm{listn}}\,({\it{m\/}} $+$ {\it{n\/}}, {\it{flg\/}})\index{listn}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cdrn-listn \\ \index{cdrn-listn}
({\it{n\/}} $\not<$ {\it{dw\/}}) $\rightarrow$ ({\rm{cdrn}}\,({\it{dw\/}}, {\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})\index{cdrn} $=$ {\rm{listn}}\,({\it{n\/}} $-$ {\it{dw\/}}, {\it{flg\/}})\index{listn})
\end{tabbing}

\begin{verbatim}; The requirement on n below stems from (a) smooth-flg-listn-flg, as it
; smooths the second subcell, needs to know that n is at least 1 so that it
; can take a 'q out; (b) warp-app-listn-q as it is warping that subcell
; needs to know that n-1 is greater than 2 so it can eat at most two
; signals after the q.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  warp-smooth-cell \\ \index{warp-smooth-cell}
\=\+(\=\+{\rm{boolp}}\,({\it{bit\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{m\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $<$ {\it{n\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{warp}}\,({\rm{smooth}}\,({\it{flg2\/}}, {\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{smooth}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{bit\/}} \\ 
{\bf then }{\rm{app}}\,(\=\+{\rm{listn}}\,({\rm{n*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}, {\rm{b-not}}\,({\it{flg1\/}})\index{b-not})\index{listn}, \\ 
{\rm{app}}\,(\=\+{\rm{listn}}\,(\=\+{\rm{nqg}}\,(\=\+{\rm{nlst*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nqg}, \\ 
{\tt{'}}{\tt{q}})\-\index{listn}, \\ 
{\rm{listn}}\,(\=\+{\rm{n*}}\,(\=\+\=\+({\it{n\/}} $-\;1$) \\ 
$-$$\;\;\;\;${\rm{dwg}}\,(\=\+{\rm{nlst*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{dwg}\-, \\ 
{\rm{tsg}}\,(\=\+{\rm{nlst*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tsg}, \\ 
{\rm{trg}}\,(\=\+{\rm{nlst*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{m\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{trg}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{n*}, \\ 
{\it{flg1\/}})\-\index{listn})\-\index{app})\-\index{app} \\ 
{\bf else }{\rm{listn}}\,({\rm{n*}}\,({\it{m\/}} $+$ {\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}, {\rm{b-not}}\,({\it{flg1\/}})\index{b-not})\index{listn}$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{verbatim}; To cdrn through the rhs above we need bounds on n*.  To prove the
; bounds we will have to characterize n* algebraically.  The bounds
; theorems are too weak to prove inductively.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  nendp-alg \\ \index{nendp-alg}
\=\+(({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr+\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{ts\/}} $<$ {\it{tr+\/}})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nendp} $=$ (({\it{ts\/}} $+$ ({\it{n\/}} $*$ {\it{w\/}})) $<$ {\it{tr+\/}}))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nlst+-ts-plus-ts-w \\ \index{nlst+-ts-plus-ts-w}
(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$)) $\rightarrow$ ({\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{ts\/}} $+$ {\it{w\/}}, {\it{w\/}})\index{nlst+} $=$ ({\it{n\/}} $-\;1$))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nlst+-alg \\ \index{nlst+-alg}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr+\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{ts\/}} $<$ {\it{tr+\/}})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nlst+} $=$ ({\it{n\/}} $-$ (({\it{tr+\/}} $-$ {\it{ts\/}}) $\div$ {\it{w\/}})))\-
\end{tabbing}


\noindent{\sc Event}:   Disable nlst+-ts-plus-ts-w.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  not-lessp-nts+-ts \\ \index{not-lessp-nts+-ts}
{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nts+} $\not<$ {\it{ts\/}}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nts+-alg \\ \index{nts+-alg}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{ts\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{tr+\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{w\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{tr+\/}} $\not<$ {\it{ts\/}})) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr+\/}}, {\it{w\/}})\index{nts+} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{ts\/}} $+$ ({\it{n\/}} $*$ {\it{w\/}})) $<$ {\it{tr+\/}}$\;\;${\bf then }{\it{ts\/}} $+$ ({\it{n\/}} $*$ {\it{w\/}}) \\ 
{\bf else }{\it{ts\/}} $+$ ({\it{w\/}} $*$ (({\it{tr+\/}} $-$ {\it{ts\/}}) $\div$ {\it{w\/}}))$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  n*-alg-lemma \\ \index{n*-alg-lemma}
\=\+(\=\+({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nendp}) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+($1\;+$ (\=\+(\=\+({\it{w\/}} $*$ {\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nlst+}) \\ 
$-$$\;\;\;\;$(({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}) $-$ {\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nts+}))\- \\ 
$\div$$\;\;\;\;${\it{r\/}})\-) \\ 
$=$$\;\;\;\;$((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable nsig*-alg-lemma-hack1.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  n*-alg-hack1 \\ \index{n*-alg-hack1}
\=\+(\=\+{\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{tr\/}}, {\it{w\/}})\index{nendp} \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$(({\it{n\/}} $*$ {\it{w\/}}) $\not<$ ({\it{tr\/}} $-$ {\it{ts\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(((({\it{n\/}} $*$ {\it{w\/}}) $-$ ({\it{tr\/}} $-$ {\it{ts\/}})) $<$ {\it{r\/}}) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  n*-alg \\ \index{n*-alg}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{n*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*} $=$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ ({\it{tr\/}} $-$ {\it{ts\/}})) $\div$ {\it{r\/}}))\-
\end{tabbing}


\noindent{\sc Event}:   Disable n*-alg-hack1.

\addvspace{18pt}

\noindent{\sc Event}:   Disable n*-alg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable n*-alg-lemma.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nts+-alg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nlst+-alg.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nendp-alg.

\addvspace{18pt}


\noindent{\sc Event}:   Disable nsig*-upper-bound-hack1.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nsig*-upper-bound-hack2.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nsig*-upper-bound-hack3.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nsig*-upper-bound-lemma2-equality.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  n*-upper-bound \\ \index{n*-upper-bound}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $<$ {\tt{18}}))\- \\ 
$\rightarrow$$\;\;\;\;$({\it{n\/}} $\not<$ {\rm{n*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*})\-
\end{tabbing}


\noindent{\sc Event}:   Disable nsig*-upper-bound-lemma1.

\addvspace{18pt}

\noindent{\sc Event}:   Disable nsig*-upper-bound-lemma2.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  n*-lower-bound \\ \index{n*-lower-bound}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $<$ {\tt{18}}))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{n*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*} $\not<$ (({\it{n\/}} $-\;1$) $-\;1$))\-
\end{tabbing}


\noindent{\sc Event}:   Disable nsig*-lower-bound-lemma1.

\addvspace{18pt}

\begin{verbatim}; So now we know n-2 <= (n* n ts tr w r) <= n.

; Now we consider scanning and cdrning.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  len-det \\ \index{len-det}
{\rm{len}}\,({\rm{det}}\,({\it{lst\/}}, {\it{oracle\/}})\index{det})\index{len} $=$ {\rm{len}}\,({\it{lst\/}})\index{len}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{det-listn-hint} \\  
\=\+{\rm{det-listn-hint}}\,({\it{nq\/}}, {\it{oracle\/}})\index{det-listn-hint} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{nq\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\rm{det-listn-hint}}\,({\it{nq\/}} $-\;1$, {\rm{cdr}}\,({\it{oracle\/}}))\index{det-listn-hint}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{no} \\  
\=\+{\rm{no}}\,({\it{flg\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{no} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{nq\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\rm{b-xor}}\,({\it{flg\/}}, {\rm{car}}\,({\it{oracle\/}}))\index{b-xor}$\;\;${\bf then }{\it{nq\/}} \\ 
{\bf else }{\rm{no}}\,({\it{flg\/}}, {\it{nq\/}} $-\;1$, {\rm{cdr}}\,({\it{oracle\/}}))\index{no}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; The following lemma is provided by way of explanation.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  no-is-len-scan-det-listn \\ \index{no-is-len-scan-det-listn}
\=\+({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\rightarrow$$\;\;\;\;$({\rm{no}}\,({\it{flg\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{no} $=$ {\rm{len}}\,({\rm{scan}}\,({\it{flg\/}}, {\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle\/}})\index{det})\index{scan})\index{len})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  scan-flg-app-listn-not-flg \\ \index{scan-flg-app-listn-not-flg}
\=\+(({\tt{0}} $<$ {\it{n\/}}) $\wedge$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{scan}}\,({\it{flg1\/}}, {\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn}, {\it{rest\/}})\index{app})\index{scan} $=$ {\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn}, {\it{rest\/}})\index{app})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{scan-oracle} \\  
\=\+{\rm{scan-oracle}}\,({\it{flg\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{scan-oracle} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{nq\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\it{oracle\/}} \\ 
{\bf elseif }{\rm{b-xor}}\,({\it{flg\/}}, {\rm{car}}\,({\it{oracle\/}}))\index{b-xor}$\;\;${\bf then }{\it{oracle\/}} \\ 
{\bf else }{\rm{scan-oracle}}\,({\it{flg\/}}, {\it{nq\/}} $-\;1$, {\rm{cdr}}\,({\it{oracle\/}}))\index{scan-oracle}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; The following lemma looks horrible -- the det expression it introduces
; seems a bad trade.  But its oracle is irrelevant elsewhere and its len,
; which is in fact is all we care about, is simple.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  scan-app-det-listn \\ \index{scan-app-det-listn}
\=\+(({\tt{0}} $<$ {\it{n\/}}) $\wedge$ {\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{scan}}\,({\it{flg1\/}}, {\rm{app}}\,({\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle\/}})\index{det}, {\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn}, {\it{rest\/}})\index{app})\index{app})\index{scan} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{det}}\,(\=\+{\rm{listn}}\,({\rm{no}}\,({\it{flg1\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{no}, {\tt{'}}{\tt{q}})\index{listn}, \\ 
{\rm{scan-oracle}}\,({\it{flg1\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{scan-oracle})\-\index{det}, \\ 
{\rm{app}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg2\/}})\index{listn}, {\it{rest\/}})\index{app})\-\index{app})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable scan-flg-app-listn-not-flg.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  cdrn-app \\ \index{cdrn-app}
\=\+{\rm{cdrn}}\,({\it{n\/}}, {\rm{app}}\,({\it{a\/}}, {\it{b\/}})\index{app})\index{cdrn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $<$ {\rm{len}}\,({\it{a\/}})\index{len}$\;\;${\bf then }{\rm{app}}\,({\rm{cdrn}}\,({\it{n\/}}, {\it{a\/}})\index{cdrn}, {\it{b\/}})\index{app} \\ 
{\bf else }{\rm{cdrn}}\,({\it{n\/}} $-$ {\rm{len}}\,({\it{a\/}})\index{len}, {\it{b\/}})\index{cdrn}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-lessp-no \\ \index{not-lessp-no}
{\it{n\/}} $\not<$ {\rm{no}}\,({\it{flg\/}}, {\it{n\/}}, {\it{oracle\/}})\index{no}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  boolp-implies-det-listn \\ \index{boolp-implies-det-listn}
{\rm{boolp}}\,({\it{flg\/}})\index{boolp} $\rightarrow$ ({\rm{det}}\,({\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn}, {\it{oracle\/}})\index{det} $=$ {\rm{listn}}\,({\it{n\/}}, {\it{flg\/}})\index{listn})
\end{tabbing}

\begin{verbatim}; We are about to prove the key lemma that determines baud rate.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  len-warp \\ \index{len-warp}
{\rm{len}}\,({\rm{warp}}\,({\it{lst\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp})\index{len} $=$ {\rm{n*}}\,({\rm{len}}\,({\it{lst\/}})\index{len}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}
\end{tabbing}

\begin{verbatim}; To prove n*-plus we have to USE len-warp with an instantiation
; that causes warp-app-listn-q to fire.  Len-warp is of lemma class
; nil so that the equality thus derived stays around.  But it turns out
; that elsewhere in the proof we have to use len-warp as a rewrite rule!
; So we prove an instance of it that suits our purposes.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  n*-plus-lemma \\ \index{n*-plus-lemma}
{\rm{len}}\,({\rm{warp}}\,({\rm{listn}}\,({\it{j\/}} $-$ {\it{dwg\/}}, {\bf{f}})\index{listn}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{warp})\index{len} $=$ {\rm{n*}}\,({\it{j\/}} $-$ {\it{dwg\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}
\end{tabbing}

\begin{verbatim}; The name n*-plus, below, suggests that the lhs is (n* (plus ...)
; ...) but in fact I named it after the rhs; couldn't bear to rewrite
; the other way.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  n*-plus \\ \index{n*-plus}
\=\+(\=\+({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $<$ ({\tt{2}} $*$ {\it{r\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $<$ ({\tt{2}} $*$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;$({\tt{2}} $<$ {\it{j\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{i\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{j\/}} $\in\;${\bf{N}}${}$))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+{\rm{n*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*} \\ 
$+$$\;\;\;\;${\rm{nqg}}\,(\=\+{\rm{nlst*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{nqg} \\ 
$+$$\;\;\;\;${\rm{n*}}\,(\=\+{\it{j\/}} $-$ {\rm{dwg}}\,(\=\+{\rm{nlst*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{dwg}, \\ 
{\rm{tsg}}\,(\=\+{\rm{nlst*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{tsg}, \\ 
{\rm{trg}}\,(\=\+{\rm{nlst*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*}, \\ 
{\rm{nts*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*}, \\ 
{\rm{ntr*}}\,({\it{i\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{trg}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{n*})\- \\ 
$=$$\;\;\;\;${\rm{n*}}\,($1\;+$ ({\it{i\/}} $+$ {\it{j\/}}), {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable n*-plus-lemma.

\addvspace{18pt}

\begin{verbatim}; If this lemma can be proved for different constants then the
; whole proof can be shifted to those constants.  In particular
; make the replacements indicated below.
; To send cells of size: 32   24  16
;                        31   23  15
;                        16   12   8
;                        15   11   7

\end{verbatim}\begin{tabbing}{\sc Theorem}:  loop-killer-2b \\ \index{loop-killer-2b}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{bvp}}\,({\rm{cdr}}\,({\it{msg\/}}))\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cdrn}}\,(\=\+{\tt{10}}, \\ 
{\rm{scan}}\,(\=\+{\it{flg1\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{cell}}\,({\it{flg1\/}}, {\tt{4}} $-$ {\it{dw\/}}, {\tt{13}}, {\rm{car}}\,({\it{msg\/}}))\index{cell})\-\index{smooth}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle2\/}})\-\index{det}, \\ 
{\it{rest\/}})\-\index{app})\-\index{app})\-\index{scan})\-\index{cdrn} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{listn}}\,(\=\+\=\+({\rm{no}}\,({\it{flg1\/}}, {\it{nq\/}}, {\it{oracle1\/}})\index{no} $+$ {\rm{n*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}) \\ 
$-$$\;\;\;\;${\tt{10}}\-, \\ 
{\rm{csig}}\,({\it{flg1\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig})\-\index{listn}, \\ 
{\it{rest\/}})\-\index{app})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable n*-plus.

\addvspace{18pt}

\noindent{\sc Event}:   Disable cdrn-app.

\addvspace{18pt}

\noindent{\sc Event}:   Disable scan-app-det-listn.

\addvspace{18pt}

\noindent{\sc Event}:   Disable boolp-implies-det-listn.

\addvspace{18pt}

\noindent{\sc Event}:   Disable warp-smooth-cell.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  car-det-listn \\ \index{car-det-listn}
\=\+{\rm{car}}\,({\rm{det}}\,({\rm{listn}}\,({\it{n\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle\/}})\index{det}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\rm{car}}\,({\it{oracle\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  listp-det \\ \index{listp-det}
{\rm{listp}}\,({\rm{det}}\,({\it{lst\/}}, {\it{oracle\/}})\index{det}) $=$ {\rm{listp}}\,({\it{lst\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  car-scan-oracle \\ \index{car-scan-oracle}
\=\+({\rm{no}}\,({\it{flg\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{no} $\not\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$({\rm{car}}\,({\rm{scan-oracle}}\,({\it{flg\/}}, {\it{nq\/}}, {\it{oracle\/}})\index{scan-oracle}) $\leftrightarrow$ {\rm{b-not}}\,({\it{flg\/}})\index{b-not})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  loop-killer-2a-lemma \\ \index{loop-killer-2a-lemma}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{bvp}}\,({\rm{cdr}}\,({\it{msg\/}}))\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg2\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{car}}\,({\rm{scan}}\,(\=\+{\it{flg1\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{cell}}\,({\it{flg1\/}}, {\tt{4}} $-$ {\it{dw\/}}, {\tt{13}}, {\rm{car}}\,({\it{msg\/}}))\index{cell})\-\index{smooth}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle\/}})\-\index{det}, \\ 
{\it{rest\/}})\-\index{app})\-\index{app})\-\index{scan}) \\ 
$=$$\;\;\;\;${\rm{b-not}}\,({\it{flg1\/}})\index{b-not})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable car-det-listn.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  equal-difference-0 \\ \index{equal-difference-0}
(({\it{x\/}} $-$ {\it{y\/}}) $=$ {\tt{0}}) $=$ ({\it{y\/}} $\not<$ {\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  loop-killer-2a \\ \index{loop-killer-2a}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{bvp}}\,({\rm{cdr}}\,({\it{msg\/}}))\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg2\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{recv-bit}}\,(\=\+{\tt{10}}, \\ 
{\rm{scan}}\,(\=\+{\it{flg1\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{cell}}\,(\=\+{\it{flg1\/}}, \\ 
{\tt{4}} $-$ {\it{dw\/}}, \\ 
{\tt{13}}, \\ 
{\rm{car}}\,({\it{msg\/}}))\-\index{cell})\-\index{smooth}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle\/}})\-\index{det}, \\ 
{\it{rest\/}})\-\index{app})\-\index{app})\-\index{scan})\-\index{recv-bit} \\ 
$=$$\;\;\;\;${\rm{car}}\,({\it{msg\/}}))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable loop-killer-2a-lemma.

\addvspace{18pt}

\begin{verbatim}; We also have to take care of the new flg computed by recv:

\end{verbatim}\begin{tabbing}{\sc Theorem}:  loop-killer-2c \\ \index{loop-killer-2c}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{bvp}}\,({\rm{cdr}}\,({\it{msg\/}}))\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{car}}\,({\rm{app}}\,(\=\+{\rm{listn}}\,(\=\+\=\+({\rm{no}}\,({\it{flg1\/}}, {\it{nq\/}}, {\it{oracle1\/}})\index{no} $+$ {\rm{n*}}\,({\tt{17}} $-$ {\it{dw\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{n*}) \\ 
$-$$\;\;\;\;${\tt{10}}\-, \\ 
{\rm{csig}}\,({\it{flg1\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig})\-\index{listn}, \\ 
{\it{rest\/}})\-\index{app}) \\ 
$=$$\;\;\;\;${\rm{csig}}\,({\it{flg1\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig})\-\-
\end{tabbing}
          
\begin{verbatim}; Finally, we must show that recv just eats up the leading string of flgs:

\end{verbatim}\begin{tabbing}{\sc Theorem}:  recv-app-listn \\ \index{recv-app-listn}
{\rm{recv}}\,({\it{n\/}}, {\it{flg\/}}, {\it{k\/}}, {\rm{app}}\,({\rm{listn}}\,({\it{m\/}}, {\it{flg\/}})\index{listn}, {\it{rest\/}})\index{app})\index{recv} $=$ {\rm{recv}}\,({\it{n\/}}, {\it{flg\/}}, {\it{k\/}}, {\it{rest\/}})\index{recv}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  loop-killer-2 \\ \index{loop-killer-2}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{bvp}}\,({\rm{cdr}}\,({\it{msg\/}}))\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg2\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{recv}}\,(\=\+{\rm{len}}\,({\it{msg\/}})\index{len}, \\ 
{\it{flg1\/}}, \\ 
{\tt{10}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{smooth}}\,({\it{flg2\/}}, {\rm{cell}}\,({\it{flg1\/}}, {\tt{4}} $-$ {\it{dw\/}}, {\tt{13}}, {\rm{car}}\,({\it{msg\/}}))\index{cell})\index{smooth}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle\/}})\-\index{det}, \\ 
{\it{rest\/}})\-\index{app})\-\index{app})\-\index{recv} \\ 
$=$$\;\;\;\;${\rm{cons}}\,(\=\+{\rm{car}}\,({\it{msg\/}}), \\ 
{\rm{recv}}\,({\rm{len}}\,({\rm{cdr}}\,({\it{msg\/}}))\index{len}, {\rm{csig}}\,({\it{flg1\/}}, {\rm{car}}\,({\it{msg\/}}))\index{csig}, {\tt{10}}, {\it{rest\/}})\index{recv})\-)\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable recv-app-listn.

\addvspace{18pt}

\begin{verbatim}; We now turn to the base case in which msg of of len 1.  Our killer lemma
; will be named loop-killer-0.  This case is special because the cell is not
; always followed by an edge.  We'll do a blow-by-blow derivation of loop-killer-0,
; starting with the lhs of the loop concl; the killer lemma will reduce it to the
; rhs, which is just msg.  

#|
The lhs of loop-killer-0 is initially:
(RECV (LEN MSG)
      FLG1 10
      (APP (DET (LISTN NQ 'Q) ORACLE1)
           (DET (WARP (CDRN DW
                            (SMOOTH FLG2
                                    (APP (CDR (CELLS FLG1 5 13 MSG))
                                         (LISTN P2 T))))
                      TS TR W R)
                ORACLE2)))
where (listp msg) and (nlistp (cdr msg)) are known.
|#

\end{verbatim}\begin{tabbing}{\sc Theorem}:  cdr-app-cell-rest \\ \index{cdr-app-cell-rest}
\=\+({\it{m\/}} $\not\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cdr}}\,({\rm{app}}\,({\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell}, {\it{rest\/}})\index{app}) \\ 
$=$$\;\;\;\;${\rm{app}}\,({\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}} $-\;1$, {\it{n\/}}, {\it{bit\/}})\index{cell}, {\it{rest\/}})\index{app})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  smooth-app-cell-rest \\ \index{smooth-app-cell-rest}
\=\+(({\it{n\/}} $\not\simeq {\tt{0}}$) $\wedge$ {\rm{b-xor}}\,({\it{flg2\/}}, {\it{flg1\/}})\index{b-xor}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{smooth}}\,({\it{flg2\/}}, {\rm{app}}\,({\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell}, {\it{rest\/}})\index{app})\index{smooth} \\ 
$=$$\;\;\;\;${\rm{app}}\,(\=\+{\rm{smooth}}\,({\it{flg2\/}}, {\rm{cell}}\,({\it{flg1\/}}, {\it{m\/}}, {\it{n\/}}, {\it{bit\/}})\index{cell})\index{smooth}, \\ 
{\rm{smooth}}\,({\rm{csig}}\,({\it{flg1\/}}, {\it{bit\/}})\index{csig}, {\it{rest\/}})\index{smooth})\-\index{app})\-\-
\end{tabbing}

\begin{verbatim}#|
The lhs is now:
(RECV (LEN MSG)
      FLG1 10
      (APP (DET (LISTN NQ 'Q) ORACLE1)
           (DET (WARP (app (smooth flg2
                                   (cell flg1 (difference 4 dw) 13 (car msg)))
                           (smooth (csig flg1 (car msg)) (listn p2 t)))
                      TS TR W R)
                ORACLE2)))
We want to drive the warp inside the app and we will use warp-app to do it by
TARGETing the warp above.  This introduces a warp-smooth-cell instance, which
we need to analyze, and another warp-app instance about what happens after this
cell.  Normally we know what happens next is an edge, so we have a 'q there and
warp-app-listn-q is used instead of warp-app to do this work.  But here there is
no trailing 'q.  Luckily, we don't need to analyze what goes on after this cell
and so we'll just leave the trailing warp unsimplified.

So the lhs becomes
(RECV (LEN MSG)
      FLG1 10
      (APP (DET (LISTN NQ 'Q) ORACLE1)
           (DET (app (warp (smooth flg2
                                   (cell flg1 (difference 4 dw) 13 (car msg)))
                           ts tr w r)
                     (warp (app (lst* (smooth flg2 (cell flg1 (difference 4 dw) 13 (car msg)))
                                      ts tr w r)
                                (smooth (csig flg1 (car msg)) (listn p2 t)))
                           (ts* (smooth flg2 (cell flg1 (difference 4 dw) 13 (car msg)))
                                ts tr w r)
                           (tr* (smooth flg2 (cell flg1 (difference 4 dw) 13 (car msg)))
                                ts tr w r)
                           w r))
                ORACLE2)))
and we can apply det-app to produce
(RECV (LEN MSG)
      FLG1 10
      (APP (DET (LISTN NQ 'Q) ORACLE1)
           (app (det (warp (smooth flg2
                                   (cell flg1 (difference 4 dw) 13 (car msg)))
                           ts tr w r)
                     oracle2)
                (det ...))))
where we really don't care what is in the last det because it is beyond the
only cell we will read.

But now we can apply loop-killer-2 to this and get (list (car msg)).

|#

; The -0a below reminds us that this rule has a TARGET in it.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  loop-killer-0a \\ \index{loop-killer-0a}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;$({\rm{cdr}}\,({\it{msg\/}}) $=$ {\bf{nil}}) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg2\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{recv}}\,(\=\+{\rm{len}}\,({\it{msg\/}})\index{len}, \\ 
{\it{flg1\/}}, \\ 
{\tt{10}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{det}}\,(\=\+{\rm{target}}\,({\rm{warp}}\,(\=\+{\rm{cdrn}}\,(\=\+{\it{dw\/}}, \\ 
{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{cdr}}\,({\rm{cells}}\,({\it{flg1\/}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}), \\ 
{\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\-\index{app})\-\index{smooth})\-\index{cdrn}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp})\index{target}, \\ 
{\it{oracle2\/}})\-\index{det})\-\index{app})\-\index{recv} \\ 
$=$$\;\;\;\;${\it{msg\/}})\-\-
\end{tabbing}

\begin{verbatim}; We now remove the TARGET.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  loop-killer-0 \\ \index{loop-killer-0}
\=\+(\=\+{\rm{listp}}\,({\it{msg\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\rm{car}}\,({\it{msg\/}}))\index{boolp} \\ 
$\wedge$$\;\;\;\;$({\rm{cdr}}\,({\it{msg\/}}) $=$ {\bf{nil}}) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg2\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{recv}}\,(\=\+{\rm{len}}\,({\it{msg\/}})\index{len}, \\ 
{\it{flg1\/}}, \\ 
{\tt{10}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{cdrn}}\,(\=\+{\it{dw\/}}, \\ 
{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{cdr}}\,({\rm{cells}}\,({\it{flg1\/}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}), \\ 
{\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\-\index{app})\-\index{smooth})\-\index{cdrn}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle2\/}})\-\index{det})\-\index{app})\-\index{recv} \\ 
$=$$\;\;\;\;${\it{msg\/}})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable cdr-app-cell-rest.

\addvspace{18pt}

\begin{verbatim}; The two hypotheses about flg1 and flg2 being boolp were added late in the
; development of the loop theorem and I have to prove that the inductive
; instantiation satisfies them.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  boolp-b-not \\ \index{boolp-b-not}
{\rm{boolp}}\,({\rm{b-not}}\,({\it{x\/}})\index{b-not})\index{boolp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  boolp-csig \\ \index{boolp-csig}
{\rm{boolp}}\,({\it{flg\/}})\index{boolp} $\rightarrow$ {\rm{boolp}}\,({\rm{csig}}\,({\it{flg\/}}, {\it{bit\/}})\index{csig})\index{boolp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  loop \\ \index{loop}
\=\+(\=\+{\rm{bvp}}\,({\it{msg\/}})\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{nq\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{3}} $\not<$ {\it{nq\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{dw\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\tt{1}} $\not<$ {\it{dw\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg1\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{boolp}}\,({\it{flg2\/}})\index{boolp} \\ 
$\wedge$$\;\;\;\;${\rm{b-xor}}\,({\it{flg1\/}}, {\it{flg2\/}})\index{b-xor})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{recv}}\,(\=\+{\rm{len}}\,({\it{msg\/}})\index{len}, \\ 
{\it{flg1\/}}, \\ 
{\tt{10}}, \\ 
{\rm{app}}\,(\=\+{\rm{det}}\,({\rm{listn}}\,({\it{nq\/}}, {\tt{'}}{\tt{q}})\index{listn}, {\it{oracle1\/}})\index{det}, \\ 
{\rm{det}}\,(\=\+{\rm{warp}}\,(\=\+{\rm{cdrn}}\,(\=\+{\it{dw\/}}, \\ 
{\rm{smooth}}\,(\=\+{\it{flg2\/}}, \\ 
{\rm{app}}\,(\=\+{\rm{cdr}}\,({\rm{cells}}\,({\it{flg1\/}}, {\tt{5}}, {\tt{13}}, {\it{msg\/}})\index{cells}), \\ 
{\rm{listn}}\,({\it{p2\/}}, {\bf{t}})\index{listn})\-\index{app})\-\index{smooth})\-\index{cdrn}, \\ 
{\it{ts\/}}, \\ 
{\it{tr\/}}, \\ 
{\it{w\/}}, \\ 
{\it{r\/}})\-\index{warp}, \\ 
{\it{oracle2\/}})\-\index{det})\-\index{app})\-\index{recv} \\ 
$=$$\;\;\;\;${\it{msg\/}})\-\-
\end{tabbing}


\begin{verbatim}; The proof idea here is to force the expansion of (bvp msg).  The nil
; case goes through.  The (listp msg) case allows the application of
; top-async-send, which converts the conclusion to an instance of our
; loop form.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  top \\ \index{top}
\=\+(\=\+{\rm{bvp}}\,({\it{msg\/}})\index{bvp} \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{rate-proximity}}\,({\it{w\/}}, {\it{r\/}})\index{rate-proximity} \\ 
$\wedge$$\;\;\;\;$({\it{p1\/}} $\in\;${\bf{N}}${}$))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{recv}}\,({\rm{len}}\,({\it{msg\/}})\index{len}, {\bf{t}}, {\tt{10}}, {\rm{async}}\,({\rm{send}}\,({\it{msg\/}}, {\it{p1\/}}, {\tt{5}}, {\tt{13}}, {\it{p2\/}})\index{send}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}}, {\it{oracle\/}})\index{async})\index{recv} \\ 
$=$$\;\;\;\;${\it{msg\/}})\-\-
\end{tabbing}

\begin{verbatim}; JSM
; July 31, 1991

; That concludes the main theorem.  During the course of discovering
; the proof above I also did some related work that I wish to preserve
; and hence include in this events file.  The first is the development
; of the algebraic identities for the recursive functions used to talk
; about warping.

\end{verbatim}
\noindent{\sc Event}:   Enable nendp-alg.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  nts*-alg-lemma1 \\ \index{nts*-alg-lemma1}
\=\+(\=\+({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{n\/}} $*$ {\it{w\/}}) $=$ ({\it{r\/}} $+$ {\it{x\/}})) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$))\- \\ 
$\rightarrow$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nendp})\-
\end{tabbing}


\begin{tabbing}{\sc Theorem}:  nts*-alg-lemma2 \\ \index{nts*-alg-lemma2}
\=\+(\=\+({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nendp}) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+{\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nts+} \\ 
$+$$\;\;\;\;$({\it{w\/}} $*$ (\=\+(\=\+(\=\+{\it{r\/}} \\ 
$+$$\;\;\;\;${\it{ts\/}} \\ 
$+$$\;\;\;\;${\it{x\/}} \\ 
$+$$\;\;\;\;$({\it{r\/}} $*$ (\=\+(\=\+({\it{w\/}} $*$ {\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nlst+}) \\ 
$-$$\;\;\;\;$(\=\+({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}) \\ 
$-$$\;\;\;\;${\rm{nts+}}\,(\=\+{\it{n\/}}, \\ 
{\it{ts\/}}, \\ 
\=\+{\it{r\/}} \\ 
$+$$\;\;\;\;${\it{ts\/}} \\ 
$+$$\;\;\;\;${\it{x\/}}\-, \\ 
{\it{w\/}})\-\index{nts+})\-)\- \\ 
$\div$$\;\;\;\;${\it{r\/}})\-))\- \\ 
$-$$\;\;\;\;${\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nts+})\- \\ 
$\div$$\;\;\;\;${\it{w\/}})\-))\- \\ 
$=$$\;\;\;\;$({\it{ts\/}} $+$ ({\it{w\/}} $*$ (\=\+({\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))) \\ 
$\div$$\;\;\;\;${\it{w\/}})\-)))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable difference-difference.

\addvspace{18pt}

\noindent{\sc Event}:   Disable difference-difference-other.

\addvspace{18pt}

\begin{verbatim}; Acknowledgement:  This lemma was finally stated accurately by Matt Wilding.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  nts*-alg \\ \index{nts*-alg}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{nts*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nts*} \\ 
$=$$\;\;\;\;$({\it{ts\/}} $+$ ({\it{w\/}} $*$ (\=\+(\=\+({\it{tr\/}} $+$ ({\it{r\/}} $*$ (\=\+(({\it{n\/}} $*$ {\it{w\/}}) $-$ ({\it{tr\/}} $-$ {\it{ts\/}})) \\ 
$\div$$\;\;\;\;${\it{r\/}})\-)) \\ 
$-$$\;\;\;\;${\it{ts\/}})\- \\ 
$\div$$\;\;\;\;${\it{w\/}})\-)))\-\-
\end{tabbing}  

\begin{verbatim}; The following lemma ought to be called ntr*-alg-lemma1 because it is the
; first in direct support of ntr*-alg.  But it is analogous to the ...lemma2
; lemmas of the other algebraic theorems (because its lemma1 needs were met by
; a prior lemma1).

\end{verbatim}\begin{tabbing}{\sc Theorem}:  ntr*-alg-lemma2 \\ \index{ntr*-alg-lemma2}
\=\+(\=\+({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nendp}) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+{\it{r\/}} \\ 
$+$$\;\;\;\;${\it{ts\/}} \\ 
$+$$\;\;\;\;${\it{x\/}} \\ 
$+$$\;\;\;\;$({\it{r\/}} $*$ (\=\+(\=\+({\it{w\/}} $*$ {\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nlst+}) \\ 
$-$$\;\;\;\;$(\=\+({\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}) \\ 
$-$$\;\;\;\;${\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nts+})\-)\- \\ 
$\div$$\;\;\;\;${\it{r\/}})\-))\- \\ 
$=$$\;\;\;\;$({\it{ts\/}} $+$ {\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ntr*-alg \\ \index{ntr*-alg}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{ntr*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{ntr*} \\ 
$=$$\;\;\;\;$({\it{tr\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ ({\it{tr\/}} $-$ {\it{ts\/}})) $\div$ {\it{r\/}}))))\-\-
\end{tabbing}


\begin{tabbing}{\sc Theorem}:  nlst*-alg-lemma2 \\ \index{nlst*-alg-lemma2}
\=\+(\=\+({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{nendp}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nendp}) \\ 
$\wedge$$\;\;\;\;$({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{ts\/}} $+$ {\it{x\/}}) $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+{\rm{nlst+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nlst+} \\ 
$-$$\;\;\;\;$(\=\+(\=\+({\it{ts\/}} $+$ {\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))) \\ 
$-$$\;\;\;\;${\rm{nts+}}\,({\it{n\/}}, {\it{ts\/}}, {\it{r\/}} $+$ {\it{ts\/}} $+$ {\it{x\/}}, {\it{w\/}})\index{nts+})\- \\ 
$\div$$\;\;\;\;${\it{w\/}})\-)\- \\ 
$=$$\;\;\;\;$({\it{n\/}} $-$ (({\it{x\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ {\it{x\/}}) $\div$ {\it{r\/}}))) $\div$ {\it{w\/}})))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nlst*-alg \\ \index{nlst*-alg}
\=\+(\=\+({\it{n\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{ts\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{w\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{r\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $\not<$ {\it{ts\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{tr\/}} $<$ ({\it{ts\/}} $+$ {\it{w\/}})))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{nlst*}}\,({\it{n\/}}, {\it{ts\/}}, {\it{tr\/}}, {\it{w\/}}, {\it{r\/}})\index{nlst*} \\ 
$=$$\;\;\;\;$({\it{n\/}} $-$ (\=\+(\=\+({\it{tr\/}} $+$ ({\it{r\/}} $*$ ((({\it{n\/}} $*$ {\it{w\/}}) $-$ ({\it{tr\/}} $-$ {\it{ts\/}})) $\div$ {\it{r\/}}))) \\ 
$-$$\;\;\;\;${\it{ts\/}})\- \\ 
$\div$$\;\;\;\;${\it{w\/}})\-))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable nendp-alg.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nlst+-alg.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nts+-alg.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nts*-alg-lemma1.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nts*-alg-lemma2-hack1.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nts*-alg-lemma2.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nts*-alg.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable ntr*-alg-lemma2-hack1.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable ntr*-alg-lemma2.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable ntr*-alg.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nlst*-alg-lemma2-hack1.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nlst*-alg-lemma2.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable nlst*-alg.

\addvspace{18pt} 


\begin{verbatim}; The second piece of preserved work is the proof that deterministic fuzzy edge
; detection is impossible.

; An Aside:  Does the Treatment of (X) Preclude Edge Detection?
; May 28, 1991.

; (Note: In this section we adopt the convention that when a list is
; treated as a series of signals arriving at a pin then the last
; (right-most) element of the list is the first signal to arrive.
; This convention is at variance with that used throughout the rest of
; our asychronous work, where the signals arrive in the order in which
; they appear in the list.  We adopted this convention to make our
; pictures of edges and our register chains look traditional.  None of
; the work in this section is used outside of this section.  The whole
; point is to explain why we use Q (which is nondeterministically t or
; f on each occurrence) rather than X (which, in the words of Bishop
; Brock, is "your worst nightmare").)

; I have been trying for some weeks, off and on, to write an edge
; detector that could tolerate an (X) at the edge and never be
; undefined.  I have proved that is impossible.  The formalization
; and proof are given below, after an informal sketch of the problem.

; Let a "fuzzy edge" be a sequence of signals that is initially
; all f's and then becomes all t's -- except that between
; the last f and the first t is an x, i.e.,

;    - - - - - - -
;                  \
;                    - - - - - - -
; ...t t t t t t t x f f f f f f f ...

; A "well-defined" circuit is one that always returns either t or f.
; That is, it never answers x.

; Finally, an "edge detector" is a sequential circuit that sits on the
; line listening to the incoming f's and reporting "no edge yet"; if the
; line eventually goes high, the circuit eventually reports "an edge
; came by."  I am willing to give the circuit designer as many leading
; f's and trailing t's as he wants and I don't care how long after the
; edge he says "an edge came by" as long as he is correct.

; So a "well-defined fuzzy edge detector" is one that always returns t
; or f and successfully detects a fuzzy edge eventually.

; Initially I thought I could build a well-defined fuzzy edge
; detector.  For example, chain three successive pulses into registers
; so that you could see "t x f" in registers r0, r1, and r2, and then
; see if r0 is t while r2 is f.  Well, that doesn't work because at
; the moment before you see "t x f" you see "x f f" and the logic
; described would produce an x.  So you say to yourself, ``there is
; only one x in the sequence, so if I widen the window to "t t x f f"
; in registers r0 through r4, and look for, say, r0 and -r3 or r1 and
; -r4, then that bad case, namely "t x f f f" won't get me.''  But now
; "x f f f f" will get you.  Nevertheless, the feeling persisted that
; since I could have as many t's and f's as I wanted and there was
; only one x, I could somehow (perhaps by majority voting?) protect
; myself from that x while still finding the edge.

; I prove below a theorem that tells me that you can't build a
; well-defined fuzzy edge detector.

; My theorem actually does not consider sequential circuits but
; instead addresses itself to combinational circuits that have access
; to an arbitrarily wide "window" in the signal.  One could imagine,
; for example, that the sequential circuit just chains the signal
; through a sequence of k registers, constantly maintaining a window k
; wide on the signal and testing that window with combinational logic.
; If a fuzzy edge comes through that window, the combinational logic
; circuit must detect it.

; There are k+2 different views of a fuzzy edge in a window k wide.  For
; example, if k is 6 then the 8 views are:

;   f f f f f f
;   x f f f f f
;   t x f f f f
;   t t x f f f
;   t t t x f f
;   t t t t x f
;   t t t t t x
;   t t t t t t

; I limit myself to combinational expressions in F-AND and F-NOT
; because I believe the rest of the primitives can be defined in terms
; of those two (and here I mean not just for T and F but also for X).
; I define an interpreter for F-AND and F-NOT expressions with
; variables v0, v1, ..., vk, where the variables address the
; corresponding positions in the window.  Call such an expression "a
; candidate fuzzy edge detector of width k."

; I prove that if a candidate fuzzy edge detector of width k is
; well-defined (T or F) on all k+2 views of the window, then it is
; constant!

; This work relies upon certain definitions from Warren and Bishop's
; stuff, namely:

; From (note-lib "/usr/home/brock/constants/lsi/reg")
\end{verbatim}
\noindent{\sc Event}:   Add the shell {\it{x\/}}\index{x}, with recognizer function symbol {\it{xp\/}} and no accessors.

\addvspace{18pt}

\begin{verbatim}; From (note-lib "/usr/home/brock/constants/lsi/reg")
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{f-not} \\  
\=\+{\rm{f-not}}\,({\it{a\/}})\index{f-not} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{boolp}}\,({\it{a\/}})\index{boolp}$\;\;${\bf then }$\neg$ {\it{a\/}} \\ 
{\bf else }{\sc{x}}\index{x}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; From (note-lib "/usr/home/brock/constants/lsi/reg")
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{f-and} \\  
\=\+{\rm{f-and}}\,({\it{a\/}}, {\it{b\/}})\index{f-and} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{a\/}} $=$ {\bf{f}}) $\vee$ ({\it{b\/}} $=$ {\bf{f}})$\;\;${\bf then }{\bf{f}} \\ 
{\bf elseif }({\it{a\/}} $=$ {\bf{t}}) $\wedge$ ({\it{b\/}} $=$ {\bf{t}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\sc{x}}\index{x}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{exprp} \\  
\=\+{\rm{exprp}}\,({\it{x\/}})\index{exprp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }({\it{x\/}} $=$ {\tt{'}}{\tt{t}}) $\vee$ ({\it{x\/}} $=$ {\tt{'}}{\tt{f}}) $\vee$ ({\it{x\/}} $\in\;${\bf{N}}${}$) \\ 
{\bf elseif }{\rm{car}}\,({\it{x\/}}) $=$ {\tt{'}}{\tt{f-not}}$\;\;${\bf then }\=\+{\rm{exprp}}\,({\rm{cadr}}\,({\it{x\/}}))\index{exprp} \\ 
$\wedge$$\;\;\;\;$({\rm{cddr}}\,({\it{x\/}}) $=$ {\bf{nil}})\- \\ 
{\bf else }\=\+({\rm{car}}\,({\it{x\/}}) $=$ {\tt{'}}{\tt{f-and}}) \\ 
$\wedge$$\;\;\;\;${\rm{exprp}}\,({\rm{cadr}}\,({\it{x\/}}))\index{exprp} \\ 
$\wedge$$\;\;\;\;${\rm{exprp}}\,({\rm{caddr}}\,({\it{x\/}}))\index{exprp} \\ 
$\wedge$$\;\;\;\;$({\rm{cdddr}}\,({\it{x\/}}) $=$ {\bf{nil}})\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{max-var} \\  
\=\+{\rm{max-var}}\,({\it{x\/}})\index{max-var} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$ \\ 
{\bf then }\=\+{\bf if }({\it{x\/}} $=$ {\tt{'}}{\tt{t}}) $\vee$ ({\it{x\/}} $=$ {\tt{'}}{\tt{f}})$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\it{x\/}}$\;${\bf  endif}\- \\ 
{\bf elseif }{\rm{car}}\,({\it{x\/}}) $=$ {\tt{'}}{\tt{f-not}}$\;\;${\bf then }{\rm{max-var}}\,({\rm{cadr}}\,({\it{x\/}}))\index{max-var} \\ 
{\bf else }{\rm{max}}\,({\rm{max-var}}\,({\rm{cadr}}\,({\it{x\/}}))\index{max-var}, {\rm{max-var}}\,({\rm{caddr}}\,({\it{x\/}}))\index{max-var})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{width}$\;\;$
{\rm{width}}\,({\it{x\/}})\index{width} $=$ ($1\;+$ {\rm{max-var}}\,({\it{x\/}})\index{max-var})
\end{tabbing}

\begin{verbatim}; Any expression is a candidate for an edge detector of size k, where
; k is the width of the expression.

; To evaluate an expression of a given width, k, we must have a vector
; of length k which assigns values (positionally) to each of the k
; variables.  By convention, if a vector is insufficiently long or
; contains a non-Boolean assignment to a variable, we will assume it
; assigns (X) to that variable.  Thus, the empty vector is a
; convenient way to map all variables to (X).  This is unimportant in
; our main result but is used in a subsequent result that shows
; that an expression that is defined on nil is constant.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{var-val} \\  
\=\+{\rm{var-val}}\,({\it{n\/}}, {\it{vector\/}})\index{var-val} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{boolp}}\,({\rm{nth}}\,({\it{n\/}}, {\it{vector\/}})\index{nth})\index{boolp}$\;\;${\bf then }{\rm{nth}}\,({\it{n\/}}, {\it{vector\/}})\index{nth} \\ 
{\bf else }{\sc{x}}\index{x}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; Here is the interpreter for expressions wrt a given vector:

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{val} \\  
\=\+{\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $\simeq\;${{\bf{nil}}}${}$ \\ 
{\bf then }\=\+{\bf if }{\it{x\/}} $=$ {\tt{'}}{\tt{t}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\it{x\/}} $=$ {\tt{'}}{\tt{f}}$\;\;${\bf then }{\bf{f}} \\ 
{\bf else }{\rm{var-val}}\,({\it{x\/}}, {\it{vector\/}})\index{var-val}$\;${\bf  endif}\- \\ 
{\bf elseif }{\rm{car}}\,({\it{x\/}}) $=$ {\tt{'}}{\tt{f-not}}$\;\;${\bf then }{\rm{f-not}}\,({\rm{val}}\,({\rm{cadr}}\,({\it{x\/}}), {\it{vector\/}})\index{val})\index{f-not} \\ 
{\bf else }{\rm{f-and}}\,({\rm{val}}\,({\rm{cadr}}\,({\it{x\/}}), {\it{vector\/}})\index{val}, {\rm{val}}\,({\rm{caddr}}\,({\it{x\/}}), {\it{vector\/}})\index{val})\index{f-and}$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Enable boolp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  var-val-is-x-or-boolp \\ \index{var-val-is-x-or-boolp}
({\rm{var-val}}\,({\it{x\/}}, {\it{vector\/}})\index{var-val} $\not=$ {\sc{x}}\index{x}) $\rightarrow$ {\rm{boolp}}\,({\rm{var-val}}\,({\it{x\/}}, {\it{vector\/}})\index{var-val})\index{boolp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  val-is-x-or-boolp \\ \index{val-is-x-or-boolp}
({\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val} $\not=$ {\sc{x}}\index{x}) $\rightarrow$ {\rm{boolp}}\,({\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val})\index{boolp}
\end{tabbing}


\noindent{\sc Event}:   Disable boolp.

\addvspace{18pt}

\begin{verbatim}; We need to generate the complete list of k+2 views of an edge coming
; thorugh a window of width k.  We enumerate the edges as suggested
; below, e.g., 0 is the one containing all f's, k+1 contains all t's,
; etc.

; 5   t t t t
; 4   t t t x
; 3   t t x f
; 2   t x f f
; 1   x f f f
; 0   f f f f

; The order of enumeration is important to our proof.  In particular,
; if you think of the edges enumerated as above, then an integer, e.g.,
; 3, can either represent the given edge or all the edges at and below that
; one.  And we sometimes induct on these integers to build the set of all
; edges.  We use the property of the enumeration that if a variable is 
; Boolean (never x) in all the edges at or below i, then it is in fact
; constant.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{edge} \\  
\=\+{\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{k\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf elseif }{\it{i\/}} $<$ {\it{k\/}}$\;\;${\bf then }{\rm{app}}\,({\rm{edge}}\,({\it{k\/}} $-\;1$, {\it{i\/}})\index{edge}, {\rm{list}}\,({\bf{f}}))\index{app} \\ 
{\bf elseif }{\it{i\/}} $=$ {\it{k\/}}$\;\;${\bf then }{\rm{app}}\,({\rm{edge}}\,({\it{k\/}} $-\;1$, {\it{i\/}})\index{edge}, {\rm{list}}\,({\sc{x}}\index{x}))\index{app} \\ 
{\bf else }{\rm{app}}\,({\rm{edge}}\,({\it{k\/}} $-\;1$, {\it{i\/}} $-\;1$)\index{edge}, {\rm{list}}\,({\bf{t}}))\index{app}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; Note: In the original development of this theorem, we used the
; natural numbers to encode both edges and sets of edges.  This
; restricted our evaluation function to work only on edges and thus
; restricted what we could say about the value of expressions.  We
; therefore decided to represent edges as bit vectors as above.  But
; to preserve exactly the structure of the proof, we will prove the
; old definition of var-val in var-val-edge below.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  length-edge \\ \index{length-edge}
{\rm{len}}\,({\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge})\index{len} $=$ {\rm{fix}}\,({\it{k\/}})
\end{tabbing}


\noindent{\sc Event}:   Enable cdrn-app.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  cdrn-too-big \\ \index{cdrn-too-big}
({\it{n\/}} $\not<$ {\rm{len}}\,({\it{lst\/}})\index{len}) $\rightarrow$ ($\neg$ {\rm{listp}}\,({\rm{cdrn}}\,({\it{n\/}}, {\it{lst\/}})\index{cdrn}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-n-1 \\ \index{lessp-n-1}
({\it{n\/}} $<$ {\tt{1}}) $=$ ({\it{n\/}} $\simeq {\tt{0}}$)
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  nth-edge \\ \index{nth-edge}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\not\simeq {\tt{0}}$)) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{car}}\,({\rm{cdrn}}\,({\it{n\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge})\index{cdrn}) \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $<$ {\it{k\/}} \\ 
{\bf then }\=\+{\bf if }($1\;+$ {\it{n\/}}) $<$ {\it{i\/}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }($1\;+$ {\it{n\/}}) $=$ {\it{i\/}}$\;\;${\bf then }{\sc{x}}\index{x} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\- \\ 
{\bf else }{\tt{0}}$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  var-val-edge \\ \index{var-val-edge}
\=\+(({\it{n\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\in\;${\bf{N}}${}$) $\wedge$ ({\it{k\/}} $\not\simeq {\tt{0}}$) $\wedge$ ({\it{n\/}} $<$ {\it{k\/}})) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{var-val}}\,({\it{n\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge})\index{var-val} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $<$ {\it{k\/}} \\ 
{\bf then }\=\+{\bf if }($1\;+$ {\it{n\/}}) $<$ {\it{i\/}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }($1\;+$ {\it{n\/}}) $=$ {\it{i\/}}$\;\;${\bf then }{\sc{x}}\index{x} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\- \\ 
{\bf else }{\sc{x}}\index{x}$\;${\bf  endif}\-)\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable var-val.

\addvspace{18pt}

\noindent{\sc Event}:   Disable edge.

\addvspace{18pt}

\begin{verbatim}; We now develop the idea that an expression is "well-defined", i.e.,
; its value is never x on any edge of the appropriate size.  To
; do this we have to check the value on every edge.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{all-edges} \\  
\=\+{\rm{all-edges}}\,({\it{k\/}}, {\it{i\/}})\index{all-edges} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{i\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\rm{list}}\,({\rm{edge}}\,({\it{k\/}}, {\tt{0}})\index{edge}) \\ 
{\bf else }{\rm{cons}}\,({\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge}, {\rm{all-edges}}\,({\it{k\/}}, {\it{i\/}} $-\;1$)\index{all-edges})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; The following function determines that x is well-defined for all
; vectors in a given set test-set:

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{well-defined1} \\  
\=\+{\rm{well-defined1}}\,({\it{x\/}}, {\it{test-set\/}})\index{well-defined1} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{test-set\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }\=\+({\rm{val}}\,({\it{x\/}}, {\rm{car}}\,({\it{test-set\/}}))\index{val} $\not=$ {\sc{x}}\index{x}) \\ 
$\wedge$$\;\;\;\;${\rm{well-defined1}}\,({\it{x\/}}, {\rm{cdr}}\,({\it{test-set\/}}))\index{well-defined1}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; So an expression is well-defined if it is well-defined on all the edges
; of the appropriate size.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{well-defined} \\  
{\rm{well-defined}}\,({\it{x\/}})\index{well-defined} $=$ {\rm{well-defined1}}\,({\it{x\/}}, {\rm{all-edges}}\,({\rm{width}}\,({\it{x\/}})\index{width}, $1\;+$ {\rm{width}}\,({\it{x\/}})\index{width})\index{all-edges})\index{well-defined1}
\end{tabbing}

\begin{verbatim}; The theorem we wish to prove is:

; (implies (and (exprp x)
;               (well-defined x))
;          (equal (val x (edge (width x) i))
;                 (val x (edge (width x) 0))))

; That is, if an expression is well-defined on all edges, then it is
; constant on all edges.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  val-on-successive-edges-is-constant-when-defined \\ \index{val-on-successive-edges-is-const!ant-when-defined}
\=\+(\=\+{\rm{exprp}}\,({\it{x\/}})\index{exprp} \\ 
$\wedge$$\;\;\;\;$({\it{i\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;$({\it{k\/}} $\not<$ {\rm{width}}\,({\it{x\/}})\index{width}) \\ 
$\wedge$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge})\index{val} $\not=$ {\sc{x}}\index{x}) \\ 
$\wedge$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{i\/}} $-\;1$)\index{edge})\index{val} $\not=$ {\sc{x}}\index{x}))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge})\index{val} $=$ {\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{i\/}} $-\;1$)\index{edge})\index{val})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  numberp-max-var \\ \index{numberp-max-var}
{\rm{exprp}}\,({\it{x\/}})\index{exprp} $\rightarrow$ ({\rm{max-var}}\,({\it{x\/}})\index{max-var} $\in\;${\bf{N}}${}$)
\end{tabbing}


\begin{tabbing}{\sc Theorem}:  val-is-x-or-boolp-2 \\ \index{val-is-x-or-boolp-2}
(({\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val} $\not=$ {\sc{x}}\index{x}) $\wedge$ {\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val}) $\rightarrow$ ({\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val} $=$ {\bf{t}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  everything-defined-at-0 \\ \index{everything-defined-at-0}
\=\+(({\it{zero\/}} $\simeq {\tt{0}}$) $\wedge$ {\rm{exprp}}\,({\it{x\/}})\index{exprp} $\wedge$ ({\it{k\/}} $\not<$ {\rm{width}}\,({\it{x\/}})\index{width})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{zero\/}})\index{edge})\index{val} $\not=$ {\sc{x}}\index{x})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  well-defined1-is-a-universal-quantifier \\ \index{well-defined1-is-a-universal-qu!antifier}
\=\+(\=\+{\rm{exprp}}\,({\it{x\/}})\index{exprp} \\ 
$\wedge$$\;\;\;\;$({\it{k\/}} $\not<$ {\rm{width}}\,({\it{x\/}})\index{width}) \\ 
$\wedge$$\;\;\;\;${\rm{well-defined1}}\,({\it{x\/}}, {\rm{all-edges}}\,({\it{k\/}}, {\it{i\/}})\index{all-edges})\index{well-defined1} \\ 
$\wedge$$\;\;\;\;$({\it{i\/}} $\not<$ {\it{j\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{j\/}})\index{edge})\index{val} $\not=$ {\sc{x}}\index{x})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  edge-at-non-numberp \\ \index{edge-at-non-numberp}
({\it{i\/}} $\not\in\;${\bf{N}}${}$) $\rightarrow$ ({\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge} $=$ {\rm{edge}}\,({\it{k\/}}, {\tt{0}})\index{edge})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  well-defined1-implies-constant \\ \index{well-defined1-implies-constant}
\=\+(\=\+{\rm{exprp}}\,({\it{x\/}})\index{exprp} \\ 
$\wedge$$\;\;\;\;$({\it{k\/}} $\not<$ {\rm{width}}\,({\it{x\/}})\index{width}) \\ 
$\wedge$$\;\;\;\;${\rm{well-defined1}}\,({\it{x\/}}, {\rm{all-edges}}\,({\it{k\/}}, {\it{i\/}})\index{all-edges})\index{well-defined1} \\ 
$\wedge$$\;\;\;\;$({\it{i\/}} $\not<$ {\it{j\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\it{j\/}})\index{edge})\index{val} $=$ {\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\it{k\/}}, {\tt{0}})\index{edge})\index{val})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  edge-beyond-max \\ \index{edge-beyond-max}
(($1\;+$ {\it{k\/}}) $<$ {\it{i\/}}) $\rightarrow$ ({\rm{edge}}\,({\it{k\/}}, {\it{i\/}})\index{edge} $=$ {\rm{edge}}\,({\it{k\/}}, $1\;+$ {\it{k\/}})\index{edge})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  well-defined-implies-constant \\ \index{well-defined-implies-constant}
\=\+({\rm{exprp}}\,({\it{x\/}})\index{exprp} $\wedge$ {\rm{well-defined}}\,({\it{x\/}})\index{well-defined}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\rm{width}}\,({\it{x\/}})\index{width}, {\it{i\/}})\index{edge})\index{val} $=$ {\rm{val}}\,({\it{x\/}}, {\rm{edge}}\,({\rm{width}}\,({\it{x\/}})\index{width}, {\tt{0}})\index{edge})\index{val})\-
\end{tabbing}

\begin{verbatim}; Here is a related result.  It says that if an expression is defined
; on the vector that assigns x to each input, then the expression is
; constant.  

\end{verbatim}\begin{tabbing}{\sc Theorem}:  non-x-on-nil-implies-constant \\ \index{non-x-on-nil-implies-constant}
({\rm{exprp}}\,({\it{x\/}})\index{exprp} $\wedge$ ({\rm{val}}\,({\it{x\/}}, {\bf{nil}})\index{val} $\not=$ {\sc{x}}\index{x})) $\rightarrow$ ({\rm{val}}\,({\it{x\/}}, {\it{vector\/}})\index{val} $=$ {\rm{val}}\,({\it{x\/}}, {\bf{nil}})\index{val})
\end{tabbing}

\begin{verbatim}; Some stronger conjectures are not valid.  Consider for example,
; "When x is well-defined (on all edges) then x is constant."  This
; conjecture is falsified by the expression '(f-and (f-not 0) 1).
; As can be determined by r-loop, (well-defined '(f-and (f-not 0) 1)).
; But (val '(f-and (f-not 0) 1) (list f f)) = f
; while
;     (val '(f-and (f-not 0) 1) (list f t)) = t.

; The conjecture "When x is well-defined on some set of vectors s, then
; x is constant on s" is invalidated by the expression 0 on the set s =
; (list (list t) (list f)).

; One is tempted to strengthen the hypothesis above by additionally
; requiring that there exist a vector in s that makes each variable
; of x unknown.  That conjecture is invalidated by x =
; (f-and (f-not 0) 1), again, using the test set:
; (list (list f f) (list (x) f) (list t (x)) (list f t)).  
; The first and last test vectors produce different well-defined values
; of x.  Observe that the only difference between this test set
; and the set of edges of size 2 is the last vector.

; Note added in proof: On Thursday, May 23, I listened to Matt
; Kaufmann talk about his "reset results" with Bishop and Warren.  His
; results established many monotonicity properties of dual-eval and
; got me once again considering the question "what is X?"  I had been
; trying to think of X as nondeterministically 1 or 0.  I talked with
; Bishop about what X was that afternoon.  Upon leaving Bishop's
; office at 6pm I had resolved to prove that you couldn't build a
; fuzzy edge detector with F-NOT and F-AND.  The suspicion that you
; couldn't do it had come to me while at Oberwulfach (I spent hours
; trying) but I decided to lay the problem aside afterwards and focus
; on the formalization of asynchronous communication.

; It took me a night and a day (Thursday evening and then Friday, May
; 24) to get the result its raw form (in which I used numbers to
; encode views through the window).  Then I set about cleaning it up
; by going to the vectors used here.  Lisa's birthday, the Memorial
; Day weekend, an air conditioning failure at CLI, and Matt Wilding's
; birthday party all prevented useful work on the weekend.  (But I
; thought a lot about the problem -- it was surprisingly hard to
; define (edge k i) in a way that let me easily prove the var-val
; theorem about it.)  On Tuesday, I worked another three hours before
; finally getting the file in the form shown.

; At that point I sent a message about it to Warren, Bishop and Matt.
; In my message I asked Matt whether these results were derivable from
; his monotonicity results.  His reply is below.

; From kaufmann@CLI.COM Tue May 28 14:44:01 1991
; Received: by CLI.COM (4.1/1); Tue, 28 May 91 14:43:59 CDT
; Date: Tue, 28 May 91 14:44:33 CDT
; From: Matt Kaufmann <kaufmann@CLI.COM>
; To: moore@CLI.COM
; Cc: Brock@CLI.COM, Hunt@CLI.COM
; Subject: Fuzzy Edge Detection

; Nice going.  Yes, I think that the kind of monotonicity results that I
; proved could be used to get your result (though I don't know if that
; would be any easier than whatever proof you gave).  (Maybe "kind of"
; could even be omitted above.)  The informal argument is as follows.
; Consider for example the following two successive rows.

; (r1)  t x f f f f
; (r2)  t t x f f f

; Notice that these both `approximate' the following row:

; (r3)  t t f f f f

; Now since circuits are monotone, and since (r1) approximates (r3), we
; have that f(r1) approximates f(r3), where f is the candidate fuzzy
; edge detector.  But since f(r1) is well-defined (i.e. T or F), then
; since T and F can only approximate themselves (respectively), we have
; that f(r1) = f(r3).  A similar argument shows f(r2) = f(r3).
; Therefore f(r1) = f(r2).  Arguing in this way we can show that for all
; successive rows r and r', f(r) = f(r'); hence by an easy induction,
; f(r) = f(r') for all rows r, r'.





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