\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 Alex Bronstein and Carolyn Talcott.  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 Alex Bronstein and Carolyn
 Talcott.  All Rights Reserved."

 NO WARRANTY

 Alex Bronstein and Carolyn Talcott PROVIDE 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 Alex Bronstein or Carolyn Talcott 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.

|#

\end{verbatim}
\noindent{\sc Event}:   Start with the library {\tt{"mlp"}} using the compiled version.

\addvspace{18pt}

\begin{verbatim}; pplfun3.bm is our 2nd PIPELINE proof: it generalizes Inc to FUN1.
; 
; Note: we run into trouble w/ R-loop corking, because of the DCL'd function.
; A partial kludge is to:
; (LOAD "Comb/comb_fun1_s.bm") , i.e. with the _s extension, getting an actual
; symbolic value (a list).  But we really need full BY NAME evaluation..

;;; (Sugared) Circuits:
#|
(setq A '(SY-A (x)
(Y1 S Fun1 x)
(Y2 S Fun1 Y1)
(Y3 S Fun1 Y2)
; and the cork:
(Yc2 R (FUN1 (FUN1 0)) Y3)
(Yc1 R (FUN1 0) Yc2)
(Yout R 0 Yc1)
))

(setq B '(SY-B (x)
(Z1 S Fun1 x)
(Z2 R 0 Z1)
(Z3 S Fun1 Z2)
(Z4 R 0 Z3)
(Z5 S Fun1 Z4)
(Zout R 0 Z5)
))

(setq pplfun3 '( |#
; BM DEFINITIONS and A2 LEMMAS, generated by BMSYSD:
; comb_fun1.bm: Fun1 combinational element
; U7-DONE

; arbitrary Char-Fun of arity 1:
\end{verbatim}
\noindent{\sc Event}:   Introduce the function symbol {\it fun1\index{fun1}\/} of one argument.

\addvspace{18pt}

\begin{verbatim}; Everything below generated by: (bmcomb 'Fun1 '() '(x))

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{s-fun1} \\  
\=\+{\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{a}}\,({\rm{s-fun1}}\,({\rm{p}}\,({\it{x\/}})\index{p})\index{s-fun1}, {\rm{fun1}}\,({\rm{l}}\,({\it{x\/}})\index{l})\index{fun1})\index{a}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; A2-Begin-S-FUN1

\end{verbatim}\begin{tabbing}{\sc Theorem}:  a2-empty-s-fun1 \\ \index{a2-empty-s-fun1}
{\rm{empty}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{empty} $=$ {\rm{empty}}\,({\it{x\/}})\index{empty}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-e-s-fun1 \\ \index{a2-e-s-fun1}
({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1} $=$ {\sc{e}}\index{e}) $=$ {\rm{empty}}\,({\it{x\/}})\index{empty}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lp-s-fun1 \\ \index{a2-lp-s-fun1}
{\rm{len}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{len} $=$ {\rm{len}}\,({\it{x\/}})\index{len}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lpe-s-fun1 \\ \index{a2-lpe-s-fun1}
{\rm{eqlen}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1}, {\it{x\/}})\index{eqlen}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-ic-s-fun1 \\ \index{a2-ic-s-fun1}
{\rm{s-fun1}}\,({\rm{i}}\,({\it{c\_x\/}}, {\it{x\/}})\index{i})\index{s-fun1} $=$ {\rm{i}}\,({\rm{fun1}}\,({\it{c\_x\/}})\index{fun1}, {\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{i}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lc-s-fun1 \\ \index{a2-lc-s-fun1}
($\neg$ {\rm{empty}}\,({\it{x\/}})\index{empty}) $\rightarrow$ ({\rm{l}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{l} $=$ {\rm{fun1}}\,({\rm{l}}\,({\it{x\/}})\index{l})\index{fun1})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-pc-s-fun1 \\ \index{a2-pc-s-fun1}
{\rm{p}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{p} $=$ {\rm{s-fun1}}\,({\rm{p}}\,({\it{x\/}})\index{p})\index{s-fun1}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-hc-s-fun1 \\ \index{a2-hc-s-fun1}
($\neg$ {\rm{empty}}\,({\it{x\/}})\index{empty}) $\rightarrow$ ({\rm{h}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{h} $=$ {\rm{fun1}}\,({\rm{h}}\,({\it{x\/}})\index{h})\index{fun1})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-bc-s-fun1 \\ \index{a2-bc-s-fun1}
{\rm{b}}\,({\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{b} $=$ {\rm{s-fun1}}\,({\rm{b}}\,({\it{x\/}})\index{b})\index{s-fun1}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-bnc-s-fun1 \\ \index{a2-bnc-s-fun1}
{\rm{bn}}\,({\it{n\/}}, {\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1})\index{bn} $=$ {\rm{s-fun1}}\,({\rm{bn}}\,({\it{n\/}}, {\it{x\/}})\index{bn})\index{s-fun1}
\end{tabbing}

\begin{verbatim};; A2-End-S-FUN1

; eof:comb_fun1.bm
 

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{topor-sy-a} \\  
\=\+{\rm{topor-sy-a}}\,({\it{ln\/}})\index{topor-sy-a} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{y1}}$\;\;${\bf then }{\tt{1}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{y2}}$\;\;${\bf then }{\tt{2}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{y3}}$\;\;${\bf then }{\tt{3}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yc2}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yc1}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yout}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\tt{0}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{sy-a} \\  
\=\+{\rm{sy-a}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-a} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{y1}}$\;\;${\bf then }{\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{y2}}$\;\;${\bf then }{\rm{s-fun1}}\,({\rm{sy-a}}\,({\tt{'}}{\tt{y1}}, {\it{x\/}})\index{sy-a})\index{s-fun1} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{y3}}$\;\;${\bf then }{\rm{s-fun1}}\,({\rm{sy-a}}\,({\tt{'}}{\tt{y2}}, {\it{x\/}})\index{sy-a})\index{s-fun1} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yc2}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\rm{fun1}}\,({\rm{fun1}}\,({\tt{0}})\index{fun1})\index{fun1}, {\rm{sy-a}}\,({\tt{'}}{\tt{y3}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-a})\index{i}$\;${\bf  endif}\- \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yc1}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\rm{fun1}}\,({\tt{0}})\index{fun1}, {\rm{sy-a}}\,({\tt{'}}{\tt{yc2}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-a})\index{i}$\;${\bf  endif}\- \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yout}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\tt{0}}, {\rm{sy-a}}\,({\tt{'}}{\tt{yc1}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-a})\index{i}$\;${\bf  endif}\- \\ 
{\bf else }{\rm{sfix}}\,({\it{x\/}})\index{sfix}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; A2-Begin-SY-A

\end{verbatim}\begin{tabbing}{\sc Theorem}:  a2-empty-sy-a \\ \index{a2-empty-sy-a}
{\rm{empty}}\,({\rm{sy-a}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-a})\index{empty} $=$ {\rm{empty}}\,({\it{x\/}})\index{empty}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-e-sy-a \\ \index{a2-e-sy-a}
({\rm{sy-a}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-a} $=$ {\sc{e}}\index{e}) $=$ {\rm{empty}}\,({\it{x\/}})\index{empty}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lp-sy-a \\ \index{a2-lp-sy-a}
{\rm{len}}\,({\rm{sy-a}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-a})\index{len} $=$ {\rm{len}}\,({\it{x\/}})\index{len}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lpe-sy-a \\ \index{a2-lpe-sy-a}
{\rm{eqlen}}\,({\rm{sy-a}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-a}, {\it{x\/}})\index{eqlen}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-pc-sy-a \\ \index{a2-pc-sy-a}
{\rm{p}}\,({\rm{sy-a}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-a})\index{p} $=$ {\rm{sy-a}}\,({\it{ln\/}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-a}
\end{tabbing}

\begin{verbatim};; A2-End-SY-A

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{topor-sy-b} \\  
\=\+{\rm{topor-sy-b}}\,({\it{ln\/}})\index{topor-sy-b} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{z1}}$\;\;${\bf then }{\tt{1}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z2}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z3}}$\;\;${\bf then }{\tt{1}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z4}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z5}}$\;\;${\bf then }{\tt{1}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{zout}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\tt{0}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{sy-b} \\  
\=\+{\rm{sy-b}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-b} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{z1}}$\;\;${\bf then }{\rm{s-fun1}}\,({\it{x\/}})\index{s-fun1} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z2}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\tt{0}}, {\rm{sy-b}}\,({\tt{'}}{\tt{z1}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-b})\index{i}$\;${\bf  endif}\- \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z3}}$\;\;${\bf then }{\rm{s-fun1}}\,({\rm{sy-b}}\,({\tt{'}}{\tt{z2}}, {\it{x\/}})\index{sy-b})\index{s-fun1} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z4}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\tt{0}}, {\rm{sy-b}}\,({\tt{'}}{\tt{z3}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-b})\index{i}$\;${\bf  endif}\- \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{z5}}$\;\;${\bf then }{\rm{s-fun1}}\,({\rm{sy-b}}\,({\tt{'}}{\tt{z4}}, {\it{x\/}})\index{sy-b})\index{s-fun1} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{zout}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\tt{0}}, {\rm{sy-b}}\,({\tt{'}}{\tt{z5}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-b})\index{i}$\;${\bf  endif}\- \\ 
{\bf else }{\rm{sfix}}\,({\it{x\/}})\index{sfix}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; A2-Begin-SY-B

\end{verbatim}\begin{tabbing}{\sc Theorem}:  a2-empty-sy-b \\ \index{a2-empty-sy-b}
{\rm{empty}}\,({\rm{sy-b}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-b})\index{empty} $=$ {\rm{empty}}\,({\it{x\/}})\index{empty}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-e-sy-b \\ \index{a2-e-sy-b}
({\rm{sy-b}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-b} $=$ {\sc{e}}\index{e}) $=$ {\rm{empty}}\,({\it{x\/}})\index{empty}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lp-sy-b \\ \index{a2-lp-sy-b}
{\rm{len}}\,({\rm{sy-b}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-b})\index{len} $=$ {\rm{len}}\,({\it{x\/}})\index{len}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-lpe-sy-b \\ \index{a2-lpe-sy-b}
{\rm{eqlen}}\,({\rm{sy-b}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-b}, {\it{x\/}})\index{eqlen}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  a2-pc-sy-b \\ \index{a2-pc-sy-b}
{\rm{p}}\,({\rm{sy-b}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-b})\index{p} $=$ {\rm{sy-b}}\,({\it{ln\/}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-b}
\end{tabbing}

\begin{verbatim};; A2-End-SY-B

;;; CORRECTNESS PROOF (hand generated, dreamer!):


; EQ-A-B: 
;   We start out directly with the expansion list form pplinc3.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  eq-a-b \\ \index{eq-a-b}
{\rm{sy-b}}\,({\tt{'}}{\tt{zout}}, {\it{x\/}})\index{sy-b} $=$ {\rm{sy-a}}\,({\tt{'}}{\tt{yout}}, {\it{x\/}})\index{sy-a}
\end{tabbing}


\begin{verbatim}; eof: pplfun3.bm
;))
\end{verbatim}
%\end{list}
\printindex
\end{document}
