\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}; prod0_CSXAdd.bm
;   . definition of circuits [assumes stringadd.bm] : 
;     - if the circuit has only one line: OK without any hint
; 	We MAY want to put the TOPO hint, just for the induction, although
;	for one line it probably collapes to the same induction (LEN X).
;     - if the circuit has more than one line: 
;	   - without hints: FAIL
;          - TOPO0 is not definable, because of loops in the dependency graph!
;	   - with TOPOR: OK
; NOTE: the above comments date back to the hand-generation time, when we
;       were still trying to FIND a way to feed things to BM.  They are kept
;       here for historical purposes only...


;;; DEFINITION OF CIRCUITS:
#|
(setq sysd-prod '(sy-prod (x)
(Yprod S Times x Yprod2)
(Yprod2 R 0 Yprod)
))

(setq sysd-const0 '(sy-const0 (x)
(Yconst0 R 0 Yconst0)
))

(setq prod0_CSXA00 '(
|#

; BM DEFINITIONS and A2 LEMMAS, generated by BMSYSD:
; comb_times.bm: Times combinational element.
; U7-DONE

; no character function def since BM already knows about Times..

; Everything below generated by:     (bmcomb 'times '() '(x y))

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

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

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

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

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

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

\begin{tabbing}{\sc Theorem}:  a2-ic-s-times \\ \index{a2-ic-s-times}
\=\+({\rm{len}}\,({\it{x\/}})\index{len} $=$ {\rm{len}}\,({\it{y\/}})\index{len}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{s-times}}\,({\rm{i}}\,({\it{c\_x\/}}, {\it{x\/}})\index{i}, {\rm{i}}\,({\it{c\_y\/}}, {\it{y\/}})\index{i})\index{s-times} $=$ {\rm{i}}\,({\it{c\_x\/}} $*$ {\it{c\_y\/}}, {\rm{s-times}}\,({\it{x\/}}, {\it{y\/}})\index{s-times})\index{i})\-
\end{tabbing}

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

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

\begin{tabbing}{\sc Theorem}:  a2-hc-s-times \\ \index{a2-hc-s-times}
\=\+(($\neg$ {\rm{empty}}\,({\it{x\/}})\index{empty}) $\wedge$ ({\rm{len}}\,({\it{x\/}})\index{len} $=$ {\rm{len}}\,({\it{y\/}})\index{len})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{h}}\,({\rm{s-times}}\,({\it{x\/}}, {\it{y\/}})\index{s-times})\index{h} $=$ ({\rm{h}}\,({\it{x\/}})\index{h} $*$ {\rm{h}}\,({\it{y\/}})\index{h}))\-
\end{tabbing}

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

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

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

; eof:comb_times.bm


\end{verbatim}\begin{tabbing}{\sc Definition}:\index{topor-sy-prod} \\  
\=\+{\rm{topor-sy-prod}}\,({\it{ln\/}})\index{topor-sy-prod} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{yprod}}$\;\;${\bf then }{\tt{1}} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yprod2}}$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\tt{0}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{sy-prod} \\  
\=\+{\rm{sy-prod}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-prod} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{yprod}}$\;\;${\bf then }{\rm{s-times}}\,({\it{x\/}}, {\rm{sy-prod}}\,({\tt{'}}{\tt{yprod2}}, {\it{x\/}})\index{sy-prod})\index{s-times} \\ 
{\bf elseif }{\it{ln\/}} $=$ {\tt{'}}{\tt{yprod2}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\tt{0}}, {\rm{sy-prod}}\,({\tt{'}}{\tt{yprod}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-prod})\index{i}$\;${\bf  endif}\- \\ 
{\bf else }{\rm{sfix}}\,({\it{x\/}})\index{sfix}$\;${\bf  endif}\-\-
\end{tabbing}

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

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

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

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

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

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

\begin{verbatim};; A2-End-SY-PROD
; BM DEFINITIONS and A2 LEMMAS, generated by BMSYSD:

; No TOPO def for 1 line sysds because it is not needed and confuses BM

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{sy-const0} \\  
\=\+{\rm{sy-const0}}\,({\it{ln\/}}, {\it{x\/}})\index{sy-const0} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{ln\/}} $=$ {\tt{'}}{\tt{yconst0}} \\ 
{\bf then }\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{i}}\,({\tt{0}}, {\rm{sy-const0}}\,({\tt{'}}{\tt{yconst0}}, {\rm{p}}\,({\it{x\/}})\index{p})\index{sy-const0})\index{i}$\;${\bf  endif}\- \\ 
{\bf else }{\rm{sfix}}\,({\it{x\/}})\index{sfix}$\;${\bf  endif}\-\-
\end{tabbing}

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

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

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

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

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

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

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

;;; PROOF OF EQUIVALENCE:

; The key fact about SY-Yconst is that it equals the constant 0 function:

\end{verbatim}\begin{tabbing}{\sc Theorem}:  sy-const0-is-const \\ \index{sy-const0-is-const}
{\rm{sy-const0}}\,({\tt{'}}{\tt{yconst0}}, {\it{x\/}})\index{sy-const0} $=$ {\rm{s-const}}\,({\tt{0}}, {\it{x\/}})\index{s-const}
\end{tabbing}

\begin{verbatim}; The key fact (bug) about prod0 is that both lines also equal const-0 sfun 
; CRUCIAL NOTE: we only want the 1st equality, but in order for the induction
; proof to succeed, we need the stronger (global) statement.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  prod0-is-const \\ \index{prod0-is-const}
\=\+({\rm{sy-prod}}\,({\tt{'}}{\tt{yprod}}, {\it{x\/}})\index{sy-prod} $=$ {\rm{s-const}}\,({\tt{0}}, {\it{x\/}})\index{s-const}) \\ 
$\wedge$$\;\;\;\;$({\rm{sy-prod}}\,({\tt{'}}{\tt{yprod2}}, {\it{x\/}})\index{sy-prod} $=$ {\rm{s-const}}\,({\tt{0}}, {\it{x\/}})\index{s-const})\-
\end{tabbing}

\begin{verbatim}; now the equality is trivial:

\end{verbatim}\begin{tabbing}{\sc Theorem}:  e\_prodconst0 \\ \index{e\_prodconst0}
{\rm{sy-prod}}\,({\tt{'}}{\tt{yprod}}, {\it{x\/}})\index{sy-prod} $=$ {\rm{sy-const0}}\,({\tt{'}}{\tt{yconst0}}, {\it{x\/}})\index{sy-const0}
\end{tabbing}


\begin{verbatim}; eof: prod0_CSXA00.bm
;))

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