\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}; acc_CSXA00.bm
;   . definition of circuit (only 1 here) [assumes stringadd.bm] : 
;	- no hint: FAIL
;	- w/ TOPOR:  OK!
;   . proof of equivalence w/ Spec(s): 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 CIRCUIT:
#|
(setq sysd '(SY-ACC (x)
(Yacc S Plus x Yacc2)
(Yacc2 R 0 Yacc)
))

(setq acc_CSXA00 '(
-rsb |#
; BM DEFINITIONS and A2 LEMMAS, generated by BMSYSD:
; comb_plus.bm: Plus combinational element.
; U7-DONE

;   no character function definition since BM already knows about Plus..

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

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

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

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

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

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

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

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

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

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

\begin{tabbing}{\sc Theorem}:  a2-hc-s-plus \\ \index{a2-hc-s-plus}
\=\+(($\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-plus}}\,({\it{x\/}}, {\it{y\/}})\index{s-plus})\index{h} $=$ ({\rm{h}}\,({\it{x\/}})\index{h} $+$ {\rm{h}}\,({\it{y\/}})\index{h}))\-
\end{tabbing}

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

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

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

; eof:comb_plus.bm


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

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

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

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

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

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

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

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

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

;;; SPEC definition (hand, of course):

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{numer-acc} \\  
\=\+{\rm{numer-acc}}\,({\it{x\/}})\index{numer-acc} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\tt{0}} \\ 
{\bf else }{\rm{numer-acc}}\,({\rm{p}}\,({\it{x\/}})\index{p})\index{numer-acc} $+$ {\rm{l}}\,({\it{x\/}})\index{l}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; this is the standard extension from last-char-fun to MLP-string-fun.
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{spec-acc} \\  
\=\+{\rm{spec-acc}}\,({\it{x\/}})\index{spec-acc} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{empty}}\,({\it{x\/}})\index{empty}$\;\;${\bf then }{\sc{e}}\index{e} \\ 
{\bf else }{\rm{a}}\,({\rm{spec-acc}}\,({\rm{p}}\,({\it{x\/}})\index{p})\index{spec-acc}, {\rm{numer-acc}}\,({\it{x\/}})\index{numer-acc})\index{a}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};;; Circuit CORRECTNESS:

; Acc-correct-ax-help makes the proof of acc_correct_ax much easier, but is
; not necessary.
;
;(prove-lemma acc-correct-ax-help (rewrite)
;(implies (not (empty x))
;	 (equal (L (sy-acc 'yacc x))
;		(plus (numer-acc (P x)) (L x))))
;((induct (induct-P x))
; (expand (sy-acc 'yacc x))
;)
;)

; Acc-correct-ax is a "predicative correctness statement", i.e. what we would
; do if we didn't have functional equality as a specification method, but 
; instead used a purely axiomatic approach.
; BM finds the proof on its own, but still needs quite a few generalizations...

\end{verbatim}\begin{tabbing}{\sc Theorem}:  acc-correct-ax \\ \index{acc-correct-ax}
($\neg$ {\rm{empty}}\,({\it{x\/}})\index{empty}) $\rightarrow$ ({\rm{l}}\,({\rm{sy-acc}}\,({\tt{'}}{\tt{yacc}}, {\it{x\/}})\index{sy-acc})\index{l} $=$ {\rm{numer-acc}}\,({\it{x\/}})\index{numer-acc})
\end{tabbing}

\begin{verbatim}; to go to a functional equality once we have the "last" (ax) statement is
; a trivial induction, if we start out with an P-L split which is unnatural
; for BM, so we force it w/ a USE hint of A-p-l-split

\end{verbatim}\begin{tabbing}{\sc Theorem}:  a-p-l-split \\ \index{a-p-l-split}
\=\+($\neg$ {\rm{empty}}\,({\it{x\/}})\index{empty}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{sy-acc}}\,({\tt{'}}{\tt{yacc}}, {\it{x\/}})\index{sy-acc} $=$ {\rm{a}}\,({\rm{p}}\,({\rm{sy-acc}}\,({\tt{'}}{\tt{yacc}}, {\it{x\/}})\index{sy-acc})\index{p}, {\rm{l}}\,({\rm{sy-acc}}\,({\tt{'}}{\tt{yacc}}, {\it{x\/}})\index{sy-acc})\index{l})\index{a})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  acc-correct \\ \index{acc-correct}
{\rm{sy-acc}}\,({\tt{'}}{\tt{yacc}}, {\it{x\/}})\index{sy-acc} $=$ {\rm{spec-acc}}\,({\it{x\/}})\index{spec-acc}
\end{tabbing}

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