\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[]


\noindent{\sc Event}:   Start with the library {\tt{"c2"}}.

\addvspace{18pt}

\begin{verbatim};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                    ;;
;;                   PREFIX ACCESSOR FUNCTIONS                        ;; 
;;                                                                    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; These functions simply allow the accessing of various components 
;; of Micro-Gypsy structures.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{loop-body}$\;\;$
{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body} $=$ {\rm{cadr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{prog2-left-branch}$\;\;$
{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch} $=$ {\rm{cadr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{prog2-right-branch}$\;\;$
{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch} $=$ {\rm{caddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{signalled-condition}$\;\;$
{\rm{signalled-condition}}\,({\it{stmt\/}})\index{signalled-condition} $=$ {\rm{cadr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signalled-condition-expansion2 \\ \index{signalled-condition-expansion2}
{\rm{signalled-condition}}\,({\rm{cons}}\,({\it{signal\/}}, {\it{lst\/}}))\index{signalled-condition} $=$ {\rm{car}}\,({\it{lst\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{if-condition}$\;\;$
{\rm{if-condition}}\,({\it{stmt\/}})\index{if-condition} $=$ {\rm{cadr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{if-true-branch}$\;\;$
{\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch} $=$ {\rm{caddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{if-false-branch}$\;\;$
{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch} $=$ {\rm{cadddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{begin-body}$\;\;$
{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body} $=$ {\rm{cadr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{when-labels}$\;\;$
{\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels} $=$ {\rm{caddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{when-handler}$\;\;$
{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler} $=$ {\rm{cadddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{call-name}$\;\;$
{\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\rm{cadr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-name-expansion \\ \index{call-name-expansion}
{\rm{call-name}}\,({\rm{cons}}\,({\it{proc-call\/}}, {\rm{cons}}\,({\it{name\/}}, {\it{y\/}})))\index{call-name} $=$ {\it{name\/}}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{call-actuals}$\;\;$
{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals} $=$ {\rm{caddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{call-conds}$\;\;$
{\rm{call-conds}}\,({\it{stmt\/}})\index{call-conds} $=$ {\rm{cadddr}}\,({\it{stmt\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{formal-type}$\;\;$
{\rm{formal-type}}\,({\it{exp\/}})\index{formal-type} $=$ {\rm{cadr}}\,({\it{exp\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{formal-initial-value}$\;\;$
{\rm{formal-initial-value}}\,({\it{local\/}})\index{formal-initial-value} $=$ {\rm{caddr}}\,({\it{local\/}})
\end{tabbing}

\begin{verbatim};; current count 13

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{predefined-procedure-list} \\  
\=\+{\sc{predefined-procedure-list}}\index{predefined-procedure-list} \\ 
$=$$\;\;\;\;${\tt{'}}{\tt{(}}\=\+{\tt{mg-simple-variable-assignment}} \\ 
{\tt{mg-simple-constant-assignment}}{\tt{ }}{\tt{mg-simple-variable-eq}} \\ 
{\tt{mg-simple-constant-eq}}{\tt{ }}{\tt{mg-integer-le}} \\ 
{\tt{mg-integer-unary-minus}}{\tt{ }}{\tt{mg-integer-add}} \\ 
{\tt{mg-integer-subtract}}{\tt{ }}{\tt{mg-boolean-or}}{\tt{ }}{\tt{mg-boolean-and}} \\ 
{\tt{mg-boolean-not}}{\tt{ }}{\tt{mg-index-array}}{\tt{ }}{\tt{mg-array-element-assignment}}{\tt{)}}\-\-
\end{tabbing}

\begin{verbatim};; The procedure list is an alist of the form 
;; ( ... (name proc-definition) ... ).  Notice that this will change when
;; I return to prefix form since the name is not in the car position in that 
;; representation.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{predefined-procp} \\  
{\rm{predefined-procp}}\,({\it{name\/}})\index{predefined-procp} $=$ ({\it{name\/}} $\in$ {\sc{predefined-procedure-list}}\index{predefined-procedure-list})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{user-defined-procp} \\  
\=\+{\rm{user-defined-procp}}\,({\it{name\/}}, {\it{proc-list\/}})\index{user-defined-procp} \\ 
$=$$\;\;\;\;$(({\it{name\/}} $\not\in$ {\sc{predefined-procedure-list}}\index{predefined-procedure-list}) $\wedge$ {\rm{definedp}}\,({\it{name\/}}, {\it{proc-list\/}})\index{definedp})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{defined-procp} \\  
\=\+{\rm{defined-procp}}\,({\it{name\/}}, {\it{proc-list\/}})\index{defined-procp} \\ 
$=$$\;\;\;\;$({\rm{predefined-procp}}\,({\it{name\/}})\index{predefined-procp} $\vee$ {\rm{user-defined-procp}}\,({\it{name\/}}, {\it{proc-list\/}})\index{user-defined-procp})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{fetch-def}$\;\;$
{\rm{fetch-def}}\,({\it{name\/}}, {\it{proc-list\/}})\index{fetch-def} $=$ {\rm{assoc}}\,({\it{name\/}}, {\it{proc-list\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{fetch-called-def} \\  
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def} $=$ {\rm{fetch-def}}\,({\rm{call-name}}\,({\it{stmt\/}})\index{call-name}, {\it{proc-list\/}})\index{fetch-def}
\end{tabbing}

\begin{verbatim};; (name data-formals cond-formals data-locals cond-locals body)

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{def-name}$\;\;$
{\rm{def-name}}\,({\it{def\/}})\index{def-name} $=$ {\rm{car}}\,({\it{def\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable def-name.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{def-formals}$\;\;$
{\rm{def-formals}}\,({\it{def\/}})\index{def-formals} $=$ {\rm{cadr}}\,({\it{def\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable def-formals.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{def-conds}$\;\;$
{\rm{def-conds}}\,({\it{def\/}})\index{def-conds} $=$ {\rm{caddr}}\,({\it{def\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable def-conds.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{def-locals}$\;\;$
{\rm{def-locals}}\,({\it{def\/}})\index{def-locals} $=$ {\rm{cadddr}}\,({\it{def\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable def-locals.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{def-cond-locals}$\;\;$
{\rm{def-cond-locals}}\,({\it{def\/}})\index{def-cond-locals} $=$ {\rm{caddddr}}\,({\it{def\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable def-cond-locals.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{def-body}$\;\;$
{\rm{def-body}}\,({\it{def\/}})\index{def-body} $=$ {\rm{cadddddr}}\,({\it{def\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable def-body.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{array-elemtype}$\;\;$
{\rm{array-elemtype}}\,({\it{type\/}})\index{array-elemtype} $=$ {\rm{cadr}}\,({\it{type\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable array-elemtype.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{array-length}$\;\;$
{\rm{array-length}}\,({\it{type\/}})\index{array-length} $=$ {\rm{caddr}}\,({\it{type\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable array-length.

\addvspace{18pt}

\begin{verbatim};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                           ;;
;;                          THE RECOGNIZER                                   ;; 
;;                                                                           ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{reserved-names-list} \\  
{\sc{reserved-names-list}}\index{reserved-names-list} $=$ {\tt{'}}{\tt{(}}{\tt{leave}}{\tt{ }}{\tt{normal}}{\tt{ }}{\tt{routineerror}}{\tt{)}}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{reserved-word}$\;\;$
{\rm{reserved-word}}\,({\it{wd\/}})\index{reserved-word} $=$ ({\it{wd\/}} $\in$ {\sc{reserved-names-list}}\index{reserved-names-list})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-mg-namep} \\  
\=\+{\rm{ok-mg-namep}}\,({\it{ident\/}})\index{ok-mg-namep} \\ 
$=$$\;\;\;\;$(\=\+{\rm{litatom}}\,({\it{ident\/}}) \\ 
$\wedge$$\;\;\;\;$({\tt{45}} $\not\in$ {\rm{unpack}}\,({\it{ident\/}})) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{reserved-word}}\,({\it{ident\/}})\index{reserved-word}))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-mg-namep.

\addvspace{18pt}

\begin{verbatim};; Notice that the word size is selected to be exactly that of 
;; Piton.  This eliminates some of the difficulties of the mappings.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-word-size}$\;\;$
{\sc{mg-word-size}}\index{mg-word-size} $=$ {\tt{32}}
\end{tabbing}


\noindent{\sc Event}:   Introduce the function symbol {\it mg-max-ctrl-stk-size\index{mg-max-ctrl-stk-size}\/} of 0 arguments.

\addvspace{18pt}

\begin{tabbing}{\sc Axiom}:  mg-max-ctrl-stk-size-small-naturalp \\ \index{mg-max-ctrl-stk-size-small-natu!ralp}
\=\+({\sc{mg-max-ctrl-stk-size}}\index{mg-max-ctrl-stk-size} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\sc{mg-max-ctrl-stk-size}}\index{mg-max-ctrl-stk-size} $<$ {\rm{exp}}\,({\tt{2}}, {\sc{mg-word-size}}\index{mg-word-size})\index{exp})\-
\end{tabbing}


\noindent{\sc Event}:   Introduce the function symbol {\it mg-max-temp-stk-size\index{mg-max-temp-stk-size}\/} of 0 arguments.

\addvspace{18pt}

\begin{tabbing}{\sc Axiom}:  mg-max-temp-stk-size-numberp \\ \index{mg-max-temp-stk-size-numberp}
\=\+({\sc{mg-max-temp-stk-size}}\index{mg-max-temp-stk-size} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\sc{mg-max-temp-stk-size}}\index{mg-max-temp-stk-size} $<$ {\rm{exp}}\,({\tt{2}}, {\sc{mg-word-size}}\index{mg-word-size})\index{exp})\-
\end{tabbing}

\begin{verbatim};; Notice also the I can simply use the Piton function 
;; small-integerp rather than define a specific MG notion of what 
;; is an acceptable integer.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{maxint}$\;\;$
{\sc{maxint}}\index{maxint} $=$ ({\rm{exp}}\,({\tt{2}}, {\sc{mg-word-size}}\index{mg-word-size} $-\;1$)\index{exp} $-\;1$)
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{minint}$\;\;$
{\sc{minint}}\index{minint} $=$ ($-$ {\rm{exp}}\,({\tt{2}}, {\sc{mg-word-size}}\index{mg-word-size} $-\;1$)\index{exp})
\end{tabbing}

\begin{verbatim};; An integer literal is of the form (INT-MG n) where n is in the 
;; range (minint..maxint).

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{int-literalp} \\  
\=\+{\rm{int-literalp}}\,({\it{exp\/}})\index{int-literalp} \\ 
$=$$\;\;\;\;$(\=\+({\tt{'}}{\tt{int-mg}} $=$ {\rm{car}}\,({\it{exp\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{length-plistp}}\,({\it{exp\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{small-integerp}}\,({\rm{cadr}}\,({\it{exp\/}}), {\sc{mg-word-size}}\index{mg-word-size})\index{small-integerp})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{boolean-literalp} \\  
\=\+{\rm{boolean-literalp}}\,({\it{exp\/}})\index{boolean-literalp} \\ 
$=$$\;\;\;\;$(\=\+({\tt{'}}{\tt{boolean-mg}} $=$ {\rm{car}}\,({\it{exp\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{length-plistp}}\,({\it{exp\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;$({\rm{cadr}}\,({\it{exp\/}}) $\in$ {\tt{'}}{\tt{(}}{\tt{true-mg}}{\tt{ }}{\tt{false-mg}}{\tt{)}}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{character-literalp} \\  
\=\+{\rm{character-literalp}}\,({\it{exp\/}})\index{character-literalp} \\ 
$=$$\;\;\;\;$(\=\+({\tt{'}}{\tt{character-mg}} $=$ {\rm{car}}\,({\it{exp\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{length-plistp}}\,({\it{exp\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;$({\rm{cadr}}\,({\it{exp\/}}) $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\rm{cadr}}\,({\it{exp\/}}) $\leq$ {\tt{127}}))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable int-literalp.

\addvspace{18pt} 

\noindent{\sc Event}:   Disable boolean-literalp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable character-literalp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{simple-mg-type-refp} \\  
\=\+{\rm{simple-mg-type-refp}}\,({\it{typref\/}})\index{simple-mg-type-refp} \\ 
$=$$\;\;\;\;$({\it{typref\/}} $\in$ {\tt{'}}{\tt{(}}{\tt{int-mg}}{\tt{ }}{\tt{boolean-mg}}{\tt{ }}{\tt{character-mg}}{\tt{)}})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{array-mg-type-refp} \\  
\=\+{\rm{array-mg-type-refp}}\,({\it{typref\/}})\index{array-mg-type-refp} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{typref\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;$({\rm{car}}\,({\it{typref\/}}) $=$ {\tt{'}}{\tt{array-mg}}) \\ 
$\wedge$$\;\;\;\;${\rm{simple-mg-type-refp}}\,({\rm{array-elemtype}}\,({\it{typref\/}})\index{array-elemtype})\index{simple-mg-type-refp} \\ 
$\wedge$$\;\;\;\;$({\rm{array-length}}\,({\it{typref\/}})\index{array-length} $\not\simeq {\tt{0}}$))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable array-mg-type-refp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{mg-type-refp} \\  
\=\+{\rm{mg-type-refp}}\,({\it{typref\/}})\index{mg-type-refp} \\ 
$=$$\;\;\;\;$({\rm{simple-mg-type-refp}}\,({\it{typref\/}})\index{simple-mg-type-refp} $\vee$ {\rm{array-mg-type-refp}}\,({\it{typref\/}})\index{array-mg-type-refp})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{simple-typed-literalp} \\  
\=\+{\rm{simple-typed-literalp}}\,({\it{lit\/}}, {\it{type\/}})\index{simple-typed-literalp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{type\/}} $=$ {\tt{'}}{\tt{int-mg}}$\;\;${\bf then }{\rm{int-literalp}}\,({\it{lit\/}})\index{int-literalp} \\ 
{\bf elseif }{\it{type\/}} $=$ {\tt{'}}{\tt{boolean-mg}}$\;\;${\bf then }{\rm{boolean-literalp}}\,({\it{lit\/}})\index{boolean-literalp} \\ 
{\bf elseif }{\it{type\/}} $=$ {\tt{'}}{\tt{character-mg}}$\;\;${\bf then }{\rm{character-literalp}}\,({\it{lit\/}})\index{character-literalp} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{simple-typed-literal-plistp} \\  
\=\+{\rm{simple-typed-literal-plistp}}\,({\it{lst\/}}, {\it{type\/}})\index{simple-typed-literal-plistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{simple-typed-literalp}}\,({\rm{car}}\,({\it{lst\/}}), {\it{type\/}})\index{simple-typed-literalp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-literal-plistp}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{type\/}})\index{simple-typed-literal-plistp}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{array-literalp} \\  
\=\+{\rm{array-literalp}}\,({\it{exp\/}}, {\it{length\/}}, {\it{elemtype\/}})\index{array-literalp} \\ 
$=$$\;\;\;\;$(\=\+{\rm{simple-typed-literal-plistp}}\,({\it{exp\/}}, {\it{elemtype\/}})\index{simple-typed-literal-plistp} \\ 
$\wedge$$\;\;\;\;$({\rm{length}}\,({\it{exp\/}})\index{length} $=$ {\it{length\/}}))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable array-literalp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{ok-mg-array-value} \\  
\=\+{\rm{ok-mg-array-value}}\,({\it{exp\/}}, {\it{type\/}})\index{ok-mg-array-value} \\ 
$=$$\;\;\;\;${\rm{array-literalp}}\,({\it{exp\/}}, {\rm{array-length}}\,({\it{type\/}})\index{array-length}, {\rm{array-elemtype}}\,({\it{type\/}})\index{array-elemtype})\index{array-literalp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-mg-array-value.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{ok-mg-valuep} \\  
\=\+{\rm{ok-mg-valuep}}\,({\it{exp\/}}, {\it{type\/}})\index{ok-mg-valuep} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{simple-mg-type-refp}}\,({\it{type\/}})\index{simple-mg-type-refp}$\;\;${\bf then }{\rm{simple-typed-literalp}}\,({\it{exp\/}}, {\it{type\/}})\index{simple-typed-literalp} \\ 
{\bf elseif }{\rm{array-mg-type-refp}}\,({\it{type\/}})\index{array-mg-type-refp}$\;\;${\bf then }{\rm{ok-mg-array-value}}\,({\it{exp\/}}, {\it{type\/}})\index{ok-mg-array-value} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-mg-valuep.

\addvspace{18pt}

\begin{verbatim};; The recognizer has a structure called the name-alist of the following 
;; form: 
;; (... (name type) ...)  
;; This allows the identification of the types of variables.  It should be 
;; the case that the values of the variables in the meaning alist correspond 
;; to their types on the name-alist.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{m-type}$\;\;$
{\rm{m-type}}\,({\it{x\/}})\index{m-type} $=$ {\rm{cadr}}\,({\it{x\/}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{get-m-type}$\;\;$
{\rm{get-m-type}}\,({\it{name\/}}, {\it{alist\/}})\index{get-m-type} $=$ {\rm{m-type}}\,({\rm{assoc}}\,({\it{name\/}}, {\it{alist\/}}))\index{m-type}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{has-array-type} \\  
\=\+{\rm{has-array-type}}\,({\it{name\/}}, {\it{alist\/}})\index{has-array-type} \\ 
$=$$\;\;\;\;$({\rm{car}}\,({\rm{get-m-type}}\,({\it{name\/}}, {\it{alist\/}})\index{get-m-type}) $=$ {\tt{'}}{\tt{array-mg}})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-name-alist-elementp} \\  
\=\+{\rm{mg-name-alist-elementp}}\,({\it{x\/}})\index{mg-name-alist-elementp} \\ 
$=$$\;\;\;\;$({\rm{ok-mg-namep}}\,({\rm{car}}\,({\it{x\/}}))\index{ok-mg-namep} $\wedge$ {\rm{mg-type-refp}}\,({\rm{m-type}}\,({\it{x\/}})\index{m-type})\index{mg-type-refp})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-name-alistp} \\  
\=\+{\rm{mg-name-alistp}}\,({\it{alist\/}})\index{mg-name-alistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{alist\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{alist\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{mg-name-alist-elementp}}\,({\rm{car}}\,({\it{alist\/}}))\index{mg-name-alist-elementp} \\ 
$\wedge$$\;\;\;\;${\rm{mg-name-alistp}}\,({\rm{cdr}}\,({\it{alist\/}}))\index{mg-name-alistp}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{identifierp}$\;\;$
{\rm{identifierp}}\,({\it{name\/}})\index{identifierp} $=$ {\rm{ok-mg-namep}}\,({\it{name\/}})\index{ok-mg-namep}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{defined-identifierp} \\  
\=\+{\rm{defined-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{defined-identifierp} \\ 
$=$$\;\;\;\;$({\rm{identifierp}}\,({\it{name\/}})\index{identifierp} $\wedge$ {\rm{definedp}}\,({\it{name\/}}, {\it{alist\/}})\index{definedp})\-
\end{tabbing}

\begin{verbatim};; I'm restricting the if-condition to be a boolean identifier rather
;; than a boolean expression just so that the compilation will take a
;; fixed number of steps.  That is, I want every expression within the
;; code to be a reference to a variable.  This can obviously be relaxed
;; but is general since I allow the initialization of locals.  Thus, 
;; any literal values can be stored in local variables.  

;; >>> These should probably be removed in favor of one function with a
;;     type argument.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{boolean-identifierp} \\  
\=\+{\rm{boolean-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{boolean-identifierp} \\ 
$=$$\;\;\;\;$({\rm{identifierp}}\,({\it{name\/}})\index{identifierp} $\wedge$ ({\rm{get-m-type}}\,({\it{name\/}}, {\it{alist\/}})\index{get-m-type} $=$ {\tt{'}}{\tt{boolean-mg}}))\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{int-identifierp} \\  
\=\+{\rm{int-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{int-identifierp} \\ 
$=$$\;\;\;\;$({\rm{identifierp}}\,({\it{name\/}})\index{identifierp} $\wedge$ ({\rm{get-m-type}}\,({\it{name\/}}, {\it{alist\/}})\index{get-m-type} $=$ {\tt{'}}{\tt{int-mg}}))\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{character-identifierp} \\  
\=\+{\rm{character-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{character-identifierp} \\ 
$=$$\;\;\;\;$({\rm{identifierp}}\,({\it{name\/}})\index{identifierp} $\wedge$ ({\rm{get-m-type}}\,({\it{name\/}}, {\it{alist\/}})\index{get-m-type} $=$ {\tt{'}}{\tt{character-mg}}))\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{array-identifierp} \\  
\=\+{\rm{array-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{array-identifierp} \\ 
$=$$\;\;\;\;$({\rm{defined-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{defined-identifierp} $\wedge$ {\rm{has-array-type}}\,({\it{name\/}}, {\it{alist\/}})\index{has-array-type})\-
\end{tabbing}


\noindent{\sc Event}:   Disable boolean-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable int-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable character-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable array-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{simple-identifierp} \\  
\=\+{\rm{simple-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{simple-identifierp} \\ 
$=$$\;\;\;\;$(\=\+{\rm{boolean-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{boolean-identifierp} \\ 
$\vee$$\;\;\;\;${\rm{int-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{int-identifierp} \\ 
$\vee$$\;\;\;\;${\rm{character-identifierp}}\,({\it{name\/}}, {\it{alist\/}})\index{character-identifierp})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{simple-typed-identifierp} \\  
\=\+{\rm{simple-typed-identifierp}}\,({\it{ident\/}}, {\it{type\/}}, {\it{alist\/}})\index{simple-typed-identifierp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{type\/}} $=$ {\tt{'}}{\tt{int-mg}}$\;\;${\bf then }{\rm{int-identifierp}}\,({\it{ident\/}}, {\it{alist\/}})\index{int-identifierp} \\ 
{\bf elseif }{\it{type\/}} $=$ {\tt{'}}{\tt{boolean-mg}}$\;\;${\bf then }{\rm{boolean-identifierp}}\,({\it{ident\/}}, {\it{alist\/}})\index{boolean-identifierp} \\ 
{\bf elseif }{\it{type\/}} $=$ {\tt{'}}{\tt{character-mg}} \\ 
{\bf then }{\rm{character-identifierp}}\,({\it{ident\/}}, {\it{alist\/}})\index{character-identifierp} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  int-identifierp-simple \\ \index{int-identifierp-simple}
{\rm{int-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{int-identifierp} $\rightarrow$ {\rm{simple-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{simple-identifierp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  boolean-identifierp-simple \\ \index{boolean-identifierp-simple}
{\rm{boolean-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{boolean-identifierp} $\rightarrow$ {\rm{simple-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{simple-identifierp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  character-identifierp-simple \\ \index{character-identifierp-simple}
{\rm{character-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{character-identifierp} $\rightarrow$ {\rm{simple-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{simple-identifierp}
\end{tabbing}


\noindent{\sc Event}:   Disable simple-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable simple-typed-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  int-identifierp-implies-definedp \\ \index{int-identifierp-implies-definedp}
{\rm{int-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{int-identifierp} $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable int-identifierp-implies-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  boolean-identifierp-implies-definedp \\ \index{boolean-identifierp-implies-defi!nedp}
{\rm{boolean-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{boolean-identifierp} $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable boolean-identifierp-implies-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  character-identifierp-implies-definedp \\ \index{character-identifierp-implies-de!finedp}
{\rm{character-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{character-identifierp} $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable character-identifierp-implies-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  simple-identifierp-implies-definedp \\ \index{simple-identifierp-implies-defi!nedp}
{\rm{simple-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{simple-identifierp} $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable simple-identifierp-implies-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  simple-typed-identifierp-implies-definedp \\ \index{simple-typed-identifierp-implie!s-definedp}
{\rm{simple-typed-identifierp}}\,({\it{x\/}}, {\it{type\/}}, {\it{alist\/}})\index{simple-typed-identifierp} $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable simple-typed-identifierp-implies-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  array-identifierp-implies-definedp \\ \index{array-identifierp-implies-define!dp}
{\rm{array-identifierp}}\,({\it{x\/}}, {\it{alist\/}})\index{array-identifierp} $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable array-identifierp-implies-definedp.

\addvspace{18pt}

\begin{verbatim};; I have decided to make references to individual array elements impossible.
;; That is, a user program can only pass a whole array to a subroutine.  Arrays
;; are viewed as abstract data types and the only accesses to them are via
;; the predefined functions which select elements and write elements.  This will
;; guarantee that the param list of a routine is unchanged from the non-structured
;; situation.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{identifier-plistp} \\  
\=\+{\rm{identifier-plistp}}\,({\it{lst\/}})\index{identifier-plistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }{\rm{identifierp}}\,({\rm{car}}\,({\it{lst\/}}))\index{identifierp} $\wedge$ {\rm{identifier-plistp}}\,({\rm{cdr}}\,({\it{lst\/}}))\index{identifier-plistp}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  identifier-plistp-plistp \\ \index{identifier-plistp-plistp}
{\rm{identifier-plistp}}\,({\it{x\/}})\index{identifier-plistp} $\rightarrow$ {\rm{plistp}}\,({\it{x\/}})\index{plistp}
\end{tabbing}


\noindent{\sc Event}:   Disable identifier-plistp-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  identifier-plistp-distributes \\ \index{identifier-plistp-distributes}
\=\+({\rm{identifier-plistp}}\,({\it{x\/}})\index{identifier-plistp} $\wedge$ {\rm{identifier-plistp}}\,({\it{y\/}})\index{identifier-plistp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{identifier-plistp}}\,({\rm{append}}\,({\it{x\/}}, {\it{y\/}}))\index{identifier-plistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  leave-not-in-identifier-plistp \\ \index{leave-not-in-identifier-plistp}
{\rm{identifier-plistp}}\,({\it{lst\/}})\index{identifier-plistp} $\rightarrow$ ({\tt{'}}{\tt{leave}} $\not\in$ {\it{lst\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable leave-not-in-identifier-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{cond-identifierp} \\  
\=\+{\rm{cond-identifierp}}\,({\it{x\/}}, {\it{cond-list\/}})\index{cond-identifierp} \\ 
$=$$\;\;\;\;$(({\it{x\/}} $=$ {\tt{'}}{\tt{routineerror}}) $\vee$ ({\rm{identifierp}}\,({\it{x\/}})\index{identifierp} $\wedge$ ({\it{x\/}} $\in$ {\it{cond-list\/}})))\-
\end{tabbing}


\noindent{\sc Event}:   Disable cond-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{cond-identifier-plistp} \\  
\=\+{\rm{cond-identifier-plistp}}\,({\it{lst\/}}, {\it{cond-list\/}})\index{cond-identifier-plistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{cond-identifierp}}\,({\rm{car}}\,({\it{lst\/}}), {\it{cond-list\/}})\index{cond-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{cond-identifier-plistp}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{cond-list\/}})\index{cond-identifier-plistp}\-$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable cond-identifier-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  cond-identifier-plistp-cond-subsetp \\ \index{cond-identifier-plistp-cond-sub!setp}
{\rm{cond-identifier-plistp}}\,({\it{lst\/}}, {\it{cond-list\/}})\index{cond-identifier-plistp} $\rightarrow$ {\rm{cond-subsetp}}\,({\it{lst\/}}, {\it{cond-list\/}})\index{cond-subsetp}
\end{tabbing}


\noindent{\sc Event}:   Disable cond-identifier-plistp-cond-subsetp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  normal-not-in-cond-identifier-plistp \\ \index{normal-not-in-cond-identifier-p!listp}
{\rm{cond-identifier-plistp}}\,({\it{lst\/}}, {\it{cond-list\/}})\index{cond-identifier-plistp} $\rightarrow$ ({\tt{'}}{\tt{normal}} $\not\in$ {\it{lst\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable normal-not-in-cond-identifier-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  adding-element-preserves-cond-identifier-plistp \\ \index{adding-element-preserves-cond-i!dentifier-plistp}
\=\+{\rm{cond-identifier-plistp}}\,({\it{y\/}}, {\it{cond-list\/}})\index{cond-identifier-plistp} \\ 
$\rightarrow$$\;\;\;\;${\rm{cond-identifier-plistp}}\,({\it{y\/}}, {\rm{cons}}\,({\it{x\/}}, {\it{cond-list\/}}))\index{cond-identifier-plistp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable adding-element-preserves-cond-identifier-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  superset-preserves-cond-identifier-plistp \\ \index{superset-preserves-cond-identifie!r-plistp}
\=\+({\rm{subset}}\,({\it{x\/}}, {\it{y\/}})\index{subset} $\wedge$ {\rm{cond-identifier-plistp}}\,({\it{lst\/}}, {\it{x\/}})\index{cond-identifier-plistp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{cond-identifier-plistp}}\,({\it{lst\/}}, {\it{y\/}})\index{cond-identifier-plistp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable superset-preserves-cond-identifier-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{nonempty-cond-identifier-plistp} \\  
\=\+{\rm{nonempty-cond-identifier-plistp}}\,({\it{lst\/}}, {\it{cond-list\/}})\index{nonempty-cond-identifier-plistp} \\ 
$=$$\;\;\;\;$({\rm{cond-identifier-plistp}}\,({\it{lst\/}}, {\it{cond-list\/}})\index{cond-identifier-plistp} $\wedge$ ({\it{lst\/}} $\not=$ {\bf{nil}}))\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-condition} \\  
\=\+{\rm{ok-condition}}\,({\it{exp\/}}, {\it{cond-list\/}})\index{ok-condition} \\ 
$=$$\;\;\;\;$(\=\+({\it{exp\/}} $=$ {\tt{'}}{\tt{routineerror}}) \\ 
$\vee$$\;\;\;\;$(\=\+({\rm{ok-mg-namep}}\,({\it{exp\/}})\index{ok-mg-namep} $\vee$ ({\it{exp\/}} $=$ {\tt{'}}{\tt{leave}})) \\ 
$\wedge$$\;\;\;\;$({\it{exp\/}} $\in$ {\it{cond-list\/}}))\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-condition-litatom \\ \index{ok-condition-litatom}
{\rm{ok-condition}}\,({\it{exp\/}}, {\it{cond-list\/}})\index{ok-condition} $\rightarrow$ {\rm{litatom}}\,({\it{exp\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable ok-condition-litatom.

\addvspace{18pt}

\begin{verbatim};; Notice that I'm not allowing references to individual array elements, so 
;; this doesn't change from the previous version.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-actual-params-list} \\  
\=\+{\rm{ok-actual-params-list}}\,({\it{lst\/}}, {\it{alist\/}})\index{ok-actual-params-list} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{defined-identifierp}}\,({\rm{car}}\,({\it{lst\/}}), {\it{alist\/}})\index{defined-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-actual-params-list}}\,({\rm{cdr}}\,({\it{lst\/}}), {\it{alist\/}})\index{ok-actual-params-list}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; The formal is of the form (name kind typeref);  kind is in {var-mg const-mg}.

;; There is a match between actual and formal if the actual is a literal of the type of the
;; formal or is an identifier of exactly the same type as the formal. 
;; This will have to be relaxed for subtypes when I add them.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-identifier-actual} \\  
\=\+{\rm{ok-identifier-actual}}\,({\it{actual\/}}, {\it{formal\/}}, {\it{alist\/}})\index{ok-identifier-actual} \\ 
$=$$\;\;\;\;$(\=\+{\rm{identifierp}}\,({\it{actual\/}})\index{identifierp} \\ 
$\wedge$$\;\;\;\;$({\rm{get-m-type}}\,({\it{actual\/}}, {\it{alist\/}})\index{get-m-type} $=$ {\rm{formal-type}}\,({\it{formal\/}})\index{formal-type}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{data-params-match} \\  
\=\+{\rm{data-params-match}}\,({\it{actual\/}}, {\it{formal\/}}, {\it{alist\/}})\index{data-params-match} \\ 
$=$$\;\;\;\;${\rm{ok-identifier-actual}}\,({\it{actual\/}}, {\it{formal\/}}, {\it{alist\/}})\index{ok-identifier-actual}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{data-param-lists-match} \\  
\=\+{\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{alist\/}})\index{data-param-lists-match} \\ 
$=$$\;\;\;\;$\=\+{\bf if }({\it{actuals\/}} $\simeq\;${{\bf{nil}}}${}$) $\vee$ ({\it{formals\/}} $\simeq\;${{\bf{nil}}}${}$) \\ 
{\bf then }({\it{formals\/}} $=$ {\bf{nil}}) $\wedge$ ({\it{actuals\/}} $=$ {\bf{nil}}) \\ 
{\bf else }\=\+{\rm{data-params-match}}\,({\rm{car}}\,({\it{actuals\/}}), {\rm{car}}\,({\it{formals\/}}), {\it{alist\/}})\index{data-params-match} \\ 
$\wedge$$\;\;\;\;${\rm{data-param-lists-match}}\,(\=\+{\rm{cdr}}\,({\it{actuals\/}}), \\ 
{\rm{cdr}}\,({\it{formals\/}}), \\ 
{\it{alist\/}})\-\index{data-param-lists-match}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  data-param-lists-match-in-length \\ \index{data-param-lists-match-in-lengt!h}
\=\+{\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{alist\/}})\index{data-param-lists-match} \\ 
$\rightarrow$$\;\;\;\;$({\rm{length}}\,({\it{formals\/}})\index{length} $=$ {\rm{length}}\,({\it{actuals\/}})\index{length})\-
\end{tabbing}


\noindent{\sc Event}:   Disable data-param-lists-match-in-length.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{cond-params-match} \\  
\=\+{\rm{cond-params-match}}\,({\it{cond-actuals\/}}, {\it{conds\/}})\index{cond-params-match} \\ 
$=$$\;\;\;\;$({\rm{length}}\,({\it{cond-actuals\/}})\index{length} $=$ {\rm{length}}\,({\it{conds\/}})\index{length})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  list-count-decreases \\ \index{list-count-decreases}
\=\+(({\it{x\/}} $=$ {\rm{car}}\,({\it{stmt\/}})) $\wedge$ ({\it{x\/}} $\not=$ {\tt{0}})) \\ 
$\rightarrow$$\;\;\;\;$(\=\+(({\rm{count}}\,({\rm{cadr}}\,({\it{stmt\/}})) $<$ {\rm{count}}\,({\it{stmt\/}})) $=$ {\bf{t}}) \\ 
$\wedge$$\;\;\;\;$(({\rm{count}}\,({\rm{caddr}}\,({\it{stmt\/}})) $<$ {\rm{count}}\,({\it{stmt\/}})) $=$ {\bf{t}}) \\ 
$\wedge$$\;\;\;\;$(({\rm{count}}\,({\rm{cadddr}}\,({\it{stmt\/}})) $<$ {\rm{count}}\,({\it{stmt\/}})) $=$ {\bf{t}}) \\ 
$\wedge$$\;\;\;\;$(({\rm{count}}\,({\rm{caddddr}}\,({\it{stmt\/}})) $<$ {\rm{count}}\,({\it{stmt\/}})) $=$ {\bf{t}}))\-\-
\end{tabbing}

\begin{verbatim};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                    ;;
;;                       PREDEFINED PROCEDURES                        ;;
;;                                                                    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Notice that I define the semantics, etc. of each of the predefined routines
;; individually.  This allows me to loosen the restrictions on user-defined 
;; procedures.  It also, allows me to dispense with much of the overhead of 
;; user defined routines.  The only condition that any of the predefined's can
;; return is 'routineerror.  Consequently, I can do away with the cond translation
;; mechanism required of user-defined routines.  These simply set 'routineerror
;; themselves.   Also, I can eliminate the aliasing requirement for these since
;; I guarantee by coding the aliasing does not cause any problem.  

;; This approach does seem to add an additional burden with respect to the 
;; amount of things which must be proved.  However, since the predefined's
;; are not defined recursively, this is not particularly bad.

;; THE 'GENERIC' OPERATIONS
;; The operations of assignment and EQ work on any of the simple types.  For
;; each of them, we allow the variant where one of the args is a literal
;; of the appropriate type.  This is not strictly necessary except insofar
;; as it makes the subset more realistic and usable.

;; (mg-simple-variable-assignment x y)
;; x := y  where source must be a variable of the same type as the destination.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-simple-variable-assignment!-args} \\  
\=\+{\rm{ok-mg-simple-variable-assignment-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-variable-assignment!-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{simple-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{simple-identifierp} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{cadr}}\,({\rm{assoc}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})) \\ 
$=$$\;\;\;\;${\rm{cadr}}\,({\rm{assoc}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})))\-)\-\-
\end{tabbing}

\begin{verbatim};; (mg-simple-constant-assignment x c)
;; x := c where c must be a literal of the same type as the destination

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-simple-constant-assignment!-args} \\  
\=\+{\rm{ok-mg-simple-constant-assignment-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-constant-assignment!-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{simple-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-literalp}}\,({\rm{cadr}}\,({\it{args\/}}), {\rm{cadr}}\,({\rm{assoc}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})))\index{simple-typed-literalp})\-\-
\end{tabbing}


\begin{verbatim};; (mg-simple-variable-eq b x y)
;; b := (x = y) where both x and y are variables of the same type.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-simple-variable-eq-args} \\  
\=\+{\rm{ok-mg-simple-variable-eq-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-variable-eq-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{simple-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{simple-identifierp} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{cadr}}\,({\rm{assoc}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})) \\ 
$=$$\;\;\;\;${\rm{cadr}}\,({\rm{assoc}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})))\-)\-\-
\end{tabbing}

\begin{verbatim};; (mg-simple-constant-eq b x c)
;; b := (x = c) where x is a variable and c a literal of compatible type.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-simple-constant-eq-args} \\  
\=\+{\rm{ok-mg-simple-constant-eq-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-constant-eq-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{simple-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-literalp}}\,(\=\+{\rm{caddr}}\,({\it{args\/}}), \\ 
{\rm{cadr}}\,({\rm{assoc}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})))\-\index{simple-typed-literalp})\-\-
\end{tabbing}

\begin{verbatim};; THE INTEGER OPERATIONS

;; (mg-integer-le b x y)
;; b := (x le y) where both x and y are integer variables

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-integer-le-args} \\  
\=\+{\rm{ok-mg-integer-le-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-le-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; (mg-integer-unary-minus (args alist))
;; z := -x

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-integer-unary-minus-args} \\  
\=\+{\rm{ok-mg-integer-unary-minus-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-unary-minus-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; (mg-integer-add (x y z))
;; x := y + z  >> Notice that this is a change from the previous version.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-integer-add-args} \\  
\=\+{\rm{ok-mg-integer-add-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-add-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; (mg-integer-subtract (x y z))
;; x := y - z 

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-integer-subtract-args} \\  
\=\+{\rm{ok-mg-integer-subtract-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-subtract-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; BOOLEAN OPERATIONS

;; (mg-boolean-or (b c d))
;; b := c or d   -- both disjuncts must be boolean identifiers

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-boolean-or-args} \\  
\=\+{\rm{ok-mg-boolean-or-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-boolean-or-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; (mg-boolean-and (b c d))
;; b := c and d

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-boolean-and-args} \\  
\=\+{\rm{ok-mg-boolean-and-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-boolean-and-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; (mg-boolean-not (b c))
;; b := not c

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-boolean-not-args} \\  
\=\+{\rm{ok-mg-boolean-not-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-boolean-not-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{boolean-identifierp})\-\-
\end{tabbing}

\begin{verbatim};; ARRAY OPERATIONS

;; (mg-index-array (z A i size))  >> Notice the change in the order of the args
;; z := A[i]
;; It is necessary for that last to be passed to do bounds-checking.  That information
;; is not available to the translator otherwise.  It is a special argument which is a
;; numberp rather than an MG literal.  It is expected that the preprocessor 
;; will actually supply this argument, not
;; the mg programmer.  Thus the prefix form might have args (z A i 24) where 24 is the 
;; size of A.  

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-index-array-args} \\  
\=\+{\rm{ok-mg-index-array-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-index-array-args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{4}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{array-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{array-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{caddr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-identifierp}}\,(\=\+{\rm{car}}\,({\it{args\/}}), \\ 
{\rm{array-elemtype}}\,({\rm{cadr}}\,({\rm{assoc}}\,(\=\+{\rm{cadr}}\,({\it{args\/}}), \\ 
{\it{alist\/}})\-))\index{array-elemtype}, \\ 
{\it{alist\/}})\-\index{simple-typed-identifierp} \\ 
$\wedge$$\;\;\;\;$({\rm{cadddr}}\,({\it{args\/}}) $=$ {\rm{array-length}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})))\index{array-length}) \\ 
$\wedge$$\;\;\;\;$({\rm{cadddr}}\,({\it{args\/}}) $<$ {\sc{maxint}}\index{maxint}))\-\-
\end{tabbing}

\begin{verbatim};; (mg-array-element-assignment A i value size)
;; A[i] := value 
;; Here i must be an integer variable and value a variable of 
;; the appropriate element-type.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-array-element-assignment-!args} \\  
\=\+{\rm{ok-mg-array-element-assignment-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-array-element-assignment-!args} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{args\/}}, {\tt{4}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{array-identifierp}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})\index{array-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{int-identifierp}}\,({\rm{cadr}}\,({\it{args\/}}), {\it{alist\/}})\index{int-identifierp} \\ 
$\wedge$$\;\;\;\;$({\rm{cadddr}}\,({\it{args\/}}) $=$ {\rm{array-length}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\rm{car}}\,({\it{args\/}}), {\it{alist\/}})))\index{array-length}) \\ 
$\wedge$$\;\;\;\;$({\rm{cadddr}}\,({\it{args\/}}) $<$ {\sc{maxint}}\index{maxint}) \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-identifierp}}\,(\=\+{\rm{caddr}}\,({\it{args\/}}), \\ 
{\rm{array-elemtype}}\,({\rm{cadr}}\,({\rm{assoc}}\,(\=\+{\rm{car}}\,({\it{args\/}}), \\ 
{\it{alist\/}})\-))\index{array-elemtype}, \\ 
{\it{alist\/}})\-\index{simple-typed-identifierp})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-predefined-proc-args} \\  
\=\+{\rm{ok-predefined-proc-args}}\,({\it{name\/}}, {\it{args\/}}, {\it{alist\/}})\index{ok-predefined-proc-args} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\it{name\/}}: \\ 
{\bf case = }{\it{mg-simple-variable-assignment\/}} \\ 
{\bf then }{\rm{ok-mg-simple-variable-assignment-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-variable-assignment!-args} \\ 
{\bf case = }{\it{mg-simple-constant-assignment\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-simple-constant-assignment-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-constant-assignment!-args} \\ 
{\bf case = }{\it{mg-simple-variable-eq\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-simple-variable-eq-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-variable-eq-args} \\ 
{\bf case = }{\it{mg-simple-constant-eq\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-simple-constant-eq-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-simple-constant-eq-args} \\ 
{\bf case = }{\it{mg-integer-le\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-integer-le-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-le-args} \\ 
{\bf case = }{\it{mg-integer-unary-minus\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-integer-unary-minus-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-unary-minus-args} \\ 
{\bf case = }{\it{mg-integer-add\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-integer-add-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-add-args} \\ 
{\bf case = }{\it{mg-integer-subtract\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-integer-subtract-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-integer-subtract-args} \\ 
{\bf case = }{\it{mg-boolean-or\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-boolean-or-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-boolean-or-args} \\ 
{\bf case = }{\it{mg-boolean-and\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-boolean-and-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-boolean-and-args} \\ 
{\bf case = }{\it{mg-boolean-not\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-boolean-not-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-boolean-not-args} \\ 
{\bf case = }{\it{mg-index-array\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-index-array-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-index-array-args} \\ 
{\bf case = }{\it{mg-array-element-assignment\/}} \\ 
{\bf $\;\;$then }{\rm{ok-mg-array-element-assignment-args}}\,({\it{args\/}}, {\it{alist\/}})\index{ok-mg-array-element-assignment-!args} \\ 
{\bf otherwise }{\bf{f}}$\;${\bf  endcase}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-predefined-proc-args.

\addvspace{18pt}

\begin{verbatim};; A predefined proc-call is of the form (predefined-proc-call-mg name actuals)
;; where name is one of the legal predefineds and the actuals are legitimate arguments
;; for that predefined procedure according to the definitions above.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-predefined-proc-call} \\  
\=\+{\rm{ok-predefined-proc-call}}\,({\it{stmt\/}}, {\it{alist\/}})\index{ok-predefined-proc-call} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{predefined-procp}}\,({\rm{call-name}}\,({\it{stmt\/}})\index{call-name})\index{predefined-procp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-predefined-proc-args}}\,(\=\+{\rm{call-name}}\,({\it{stmt\/}})\index{call-name}, \\ 
{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, \\ 
{\it{alist\/}})\-\index{ok-predefined-proc-args})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-predefined-proc-call.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{ok-proc-call} \\  
\=\+{\rm{ok-proc-call}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-proc-call} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{4}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{identifierp}}\,({\rm{call-name}}\,({\it{stmt\/}})\index{call-name})\index{identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{user-defined-procp}}\,({\rm{call-name}}\,({\it{stmt\/}})\index{call-name}, {\it{proc-list\/}})\index{user-defined-procp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-actual-params-list}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, {\it{alist\/}})\index{ok-actual-params-list} \\ 
$\wedge$$\;\;\;\;${\rm{no-duplicates}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals})\index{no-duplicates} \\ 
$\wedge$$\;\;\;\;${\rm{data-param-lists-match}}\,(\=\+{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, \\ 
{\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals}, \\ 
{\it{alist\/}})\-\index{data-param-lists-match} \\ 
$\wedge$$\;\;\;\;${\rm{cond-identifier-plistp}}\,({\rm{call-conds}}\,({\it{stmt\/}})\index{call-conds}, {\it{r-cond-list\/}})\index{cond-identifier-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{cond-params-match}}\,(\=\+{\rm{call-conds}}\,({\it{stmt\/}})\index{call-conds}, \\ 
{\rm{def-conds}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-conds})\-\index{cond-params-match})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-proc-call.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{ok-mg-statement} \\  
\=\+{\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\rm{car}}\,({\it{stmt\/}}): \\ 
{\bf case = }{\it{no-op-mg\/}} \\ 
{\bf then }{\rm{cdr}}\,({\it{stmt\/}}) $=$ {\bf{nil}} \\ 
{\bf case = }{\it{signal-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-condition}}\,({\rm{signalled-condition}}\,({\it{stmt\/}})\index{signalled-condition}, {\it{r-cond-list\/}})\index{ok-condition}\- \\ 
{\bf case = }{\it{prog2-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement}\- \\ 
{\bf case = }{\it{loop-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\rm{cons}}\,({\tt{'}}{\tt{leave}}, {\it{r-cond-list\/}}), \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement}\- \\ 
{\bf case = }{\it{if-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{4}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{boolean-identifierp}}\,({\rm{if-condition}}\,({\it{stmt\/}})\index{if-condition}, {\it{alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement}\- \\ 
{\bf case = }{\it{begin-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\rm{length-plistp}}\,({\it{stmt\/}}, {\tt{4}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\rm{append}}\,({\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels}, {\it{r-cond-list\/}}), \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{nonempty-cond-identifier-plistp}}\,(\=\+{\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels}, \\ 
{\it{r-cond-list\/}})\-\index{nonempty-cond-identifier-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement}\- \\ 
{\bf case = }{\it{proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{ok-proc-call}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-proc-call} \\ 
{\bf case = }{\it{predefined-proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{ok-predefined-proc-call}}\,({\it{stmt\/}}, {\it{alist\/}})\index{ok-predefined-proc-call} \\ 
{\bf otherwise }{\bf{f}}$\;${\bf  endcase}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable signalled-condition.

\addvspace{18pt}

\noindent{\sc Event}:   Disable prog2-left-branch.

\addvspace{18pt}

\noindent{\sc Event}:   Disable prog2-right-branch.

\addvspace{18pt}

\noindent{\sc Event}:   Disable loop-body.

\addvspace{18pt}

\noindent{\sc Event}:   Disable if-condition.

\addvspace{18pt}

\noindent{\sc Event}:   Disable if-true-branch.

\addvspace{18pt}

\noindent{\sc Event}:   Disable if-false-branch.

\addvspace{18pt}

\noindent{\sc Event}:   Disable begin-body.

\addvspace{18pt}

\noindent{\sc Event}:   Disable when-handler.

\addvspace{18pt}

\noindent{\sc Event}:   Disable when-labels.

\addvspace{18pt}

\noindent{\sc Event}:   Disable call-name.

\addvspace{18pt}

\noindent{\sc Event}:   Disable call-actuals.

\addvspace{18pt}

\noindent{\sc Event}:   Disable call-conds.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  ok-signal-expansion \\ \index{ok-signal-expansion}
\=\+{\rm{ok-mg-statement}}\,({\rm{cons}}\,({\tt{'}}{\tt{signal-mg}}, {\it{args\/}}), {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\rm{cons}}\,({\tt{'}}{\tt{signal-mg}}, {\it{args\/}}), {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-condition}}\,(\=\+{\rm{signalled-condition}}\,({\rm{cons}}\,({\tt{'}}{\tt{signal-mg}}, {\it{args\/}}))\index{signalled-condition}, \\ 
{\it{r-cond-list\/}})\-\index{ok-condition})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-prog2-statement \\ \index{ok-prog2-statement}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{prog2-mg}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{ok-mg-statement}}\,({\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-loop-statement \\ \index{ok-loop-statement}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{loop-mg}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\rm{cons}}\,({\tt{'}}{\tt{leave}}, {\it{r-cond-list\/}}), \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-if-statement \\ \index{ok-if-statement}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{if-mg}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{ok-mg-statement}}\,({\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-begin-expansion \\ \index{ok-begin-expansion}
\=\+{\rm{ok-mg-statement}}\,({\rm{cons}}\,({\tt{'}}{\tt{begin-mg}}, {\it{args\/}}), {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\rm{cons}}\,({\tt{'}}{\tt{begin-mg}}, {\it{args\/}}), {\tt{4}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{begin-body}}\,({\rm{cons}}\,({\tt{'}}{\tt{begin-mg}}, {\it{args\/}}))\index{begin-body}, \\ 
{\rm{append}}\,(\=\+{\rm{when-labels}}\,({\rm{cons}}\,({\tt{'}}{\tt{begin-mg}}, {\it{args\/}}))\index{when-labels}, \\ 
{\it{r-cond-list\/}})\-, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{nonempty-cond-identifier-plistp}}\,(\=\+{\rm{when-labels}}\,({\rm{cons}}\,(\=\+{\tt{'}}{\tt{begin-mg}}, \\ 
{\it{args\/}})\-)\index{when-labels}, \\ 
{\it{r-cond-list\/}})\-\index{nonempty-cond-identifier-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{when-handler}}\,({\rm{cons}}\,({\tt{'}}{\tt{begin-mg}}, {\it{args\/}}))\index{when-handler}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-begin-statement \\ \index{ok-begin-statement}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{begin-mg}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{ok-mg-statement}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\rm{append}}\,({\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels}, {\it{r-cond-list\/}}), \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler}, \\ 
{\it{r-cond-list\/}}, \\ 
{\it{alist\/}}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-proc-call-expansion \\ \index{ok-proc-call-expansion}
\=\+{\rm{ok-mg-statement}}\,({\rm{cons}}\,({\tt{'}}{\tt{proc-call-mg}}, {\it{args\/}}), {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$=$$\;\;\;\;${\rm{ok-proc-call}}\,({\rm{cons}}\,({\tt{'}}{\tt{proc-call-mg}}, {\it{args\/}}), {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-proc-call}\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-mg-statement.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  signalled-condition-not-normal \\ \index{signalled-condition-not-normal}
\=\+(\=\+({\tt{'}}{\tt{signal-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{signalled-condition}}\,({\it{stmt\/}})\index{signalled-condition} $\not=$ {\tt{'}}{\tt{normal}})\-
\end{tabbing}


\noindent{\sc Event}:   Disable signalled-condition-not-normal.

\addvspace{18pt}

\begin{verbatim};; member of the data formal list is of the form
;;   (name typeref)

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-formal-data-param} \\  
\=\+{\rm{ok-mg-formal-data-param}}\,({\it{exp\/}})\index{ok-mg-formal-data-param} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{exp\/}}, {\tt{2}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-namep}}\,({\rm{car}}\,({\it{exp\/}}))\index{ok-mg-namep} \\ 
$\wedge$$\;\;\;\;${\rm{mg-type-refp}}\,({\rm{formal-type}}\,({\it{exp\/}})\index{formal-type})\index{mg-type-refp})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-mg-formal-data-param.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{ok-mg-formal-data-params-plistp} \\  
\=\+{\rm{ok-mg-formal-data-params-plistp}}\,({\it{lst\/}})\index{ok-mg-formal-data-params-plistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{ok-mg-formal-data-param}}\,({\rm{car}}\,({\it{lst\/}}))\index{ok-mg-formal-data-param} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-formal-data-params-plistp}}\,({\rm{cdr}}\,({\it{lst\/}}))\index{ok-mg-formal-data-params-plistp}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; A local decl is of the form (name typeref initial-value).
;; Notice that this obviates the need to compute initial values.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-local-data-decl} \\  
\=\+{\rm{ok-mg-local-data-decl}}\,({\it{exp\/}})\index{ok-mg-local-data-decl} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{exp\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-namep}}\,({\rm{car}}\,({\it{exp\/}}))\index{ok-mg-namep} \\ 
$\wedge$$\;\;\;\;${\rm{mg-type-refp}}\,({\rm{formal-type}}\,({\it{exp\/}})\index{formal-type})\index{mg-type-refp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-valuep}}\,({\rm{formal-initial-value}}\,({\it{exp\/}})\index{formal-initial-value}, {\rm{formal-type}}\,({\it{exp\/}})\index{formal-type})\index{ok-mg-valuep})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-mg-local-data-plistp} \\  
\=\+{\rm{ok-mg-local-data-plistp}}\,({\it{lst\/}})\index{ok-mg-local-data-plistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{ok-mg-local-data-decl}}\,({\rm{car}}\,({\it{lst\/}}))\index{ok-mg-local-data-decl} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-local-data-plistp}}\,({\rm{cdr}}\,({\it{lst\/}}))\index{ok-mg-local-data-plistp}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; The legal conditions which can signalled are those which appear in the 
;; the formal or in the local conds.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{make-cond-list} \\  
{\rm{make-cond-list}}\,({\it{def\/}})\index{make-cond-list} $=$ {\rm{append}}\,({\rm{def-conds}}\,({\it{def\/}})\index{def-conds}, {\rm{def-cond-locals}}\,({\it{def\/}})\index{def-cond-locals})
\end{tabbing}

\begin{verbatim};; This takes a list of formal data params or local var decls and 
;; makes a name-alist. 

;; >>> This is a useless definition.  It does nothing

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{make-alist-from-formals} \\  
\=\+{\rm{make-alist-from-formals}}\,({\it{lst\/}})\index{make-alist-from-formals} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{cons}}\,(\=\+{\rm{list}}\,({\rm{name}}\,({\rm{car}}\,({\it{lst\/}}))\index{name}, {\rm{formal-type}}\,({\rm{car}}\,({\it{lst\/}}))\index{formal-type}), \\ 
{\rm{make-alist-from-formals}}\,({\rm{cdr}}\,({\it{lst\/}}))\index{make-alist-from-formals})\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};; This takes the formals and locals and makes a name-alist.

;; >>> Why not just concatenate them. 

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{make-name-alist} \\  
\=\+{\rm{make-name-alist}}\,({\it{def\/}})\index{make-name-alist} \\ 
$=$$\;\;\;\;${\rm{append}}\,(\=\+{\rm{make-alist-from-formals}}\,({\rm{def-formals}}\,({\it{def\/}})\index{def-formals})\index{make-alist-from-formals}, \\ 
{\rm{make-alist-from-formals}}\,({\rm{def-locals}}\,({\it{def\/}})\index{def-locals})\index{make-alist-from-formals})\-\-
\end{tabbing}

\begin{verbatim};; Given a list of formal-data-params or local-data-decls this lists
;; off the names.  This is necessary to check that all local names are
;; unique.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{collect-local-names} \\  
\=\+{\rm{collect-local-names}}\,({\it{def\/}})\index{collect-local-names} \\ 
$=$$\;\;\;\;${\rm{append}}\,({\rm{listcars}}\,({\rm{def-formals}}\,({\it{def\/}})\index{def-formals})\index{listcars}, {\rm{listcars}}\,({\rm{def-locals}}\,({\it{def\/}})\index{def-locals})\index{listcars})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-mg-def} \\  
\=\+{\rm{ok-mg-def}}\,({\it{def\/}}, {\it{proc-list\/}})\index{ok-mg-def} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{def\/}}, {\tt{6}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-namep}}\,({\rm{def-name}}\,({\it{def\/}})\index{def-name})\index{ok-mg-namep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-formal-data-params-plistp}}\,({\rm{def-formals}}\,({\it{def\/}})\index{def-formals})\index{ok-mg-formal-data-params-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{identifier-plistp}}\,({\rm{def-conds}}\,({\it{def\/}})\index{def-conds})\index{identifier-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-local-data-plistp}}\,({\rm{def-locals}}\,({\it{def\/}})\index{def-locals})\index{ok-mg-local-data-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{identifier-plistp}}\,({\rm{def-cond-locals}}\,({\it{def\/}})\index{def-cond-locals})\index{identifier-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{no-duplicates}}\,({\rm{collect-local-names}}\,({\it{def\/}})\index{collect-local-names})\index{no-duplicates} \\ 
$\wedge$$\;\;\;\;$(\=\+({\rm{length}}\,({\rm{def-conds}}\,({\it{def\/}})\index{def-conds})\index{length} $+$ {\rm{length}}\,({\rm{def-cond-locals}}\,({\it{def\/}})\index{def-cond-locals})\index{length}) \\ 
$<$$\;\;\;\;$((({\rm{exp}}\,({\tt{2}}, {\sc{mg-word-size}}\index{mg-word-size})\index{exp} $-\;1$) $-\;1$) $-\;1$))\- \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,(\=\+{\rm{def-body}}\,({\it{def\/}})\index{def-body}, \\ 
{\rm{make-cond-list}}\,({\it{def\/}})\index{make-cond-list}, \\ 
{\rm{make-name-alist}}\,({\it{def\/}})\index{make-name-alist}, \\ 
{\it{proc-list\/}})\-\index{ok-mg-statement})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  make-cond-list-legal-length \\ \index{make-cond-list-legal-length}
\=\+{\rm{ok-mg-def}}\,({\it{def\/}}, {\it{proc-list\/}})\index{ok-mg-def} \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+{\rm{length}}\,({\rm{make-cond-list}}\,({\it{def\/}})\index{make-cond-list})\index{length} \\ 
$<$$\;\;\;\;$((({\rm{exp}}\,({\tt{2}}, {\sc{mg-word-size}}\index{mg-word-size})\index{exp} $-\;1$) $-\;1$) $-\;1$))\- \\ 
$=$$\;\;\;\;${\bf{t}})\-\-
\end{tabbing}

\begin{verbatim};; (name formals locals conds local-conds body)

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{ok-mg-def-plistp1} \\  
\=\+{\rm{ok-mg-def-plistp1}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{ok-mg-def-plistp1} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst1\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst1\/}} $=$ {\bf{nil}} \\ 
{\bf else }\=\+{\rm{ok-mg-def}}\,({\rm{car}}\,({\it{lst1\/}}), {\it{lst2\/}})\index{ok-mg-def} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp1}}\,({\rm{cdr}}\,({\it{lst1\/}}), {\it{lst2\/}})\index{ok-mg-def-plistp1}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-mg-def-plistp} \\  
{\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp} $=$ {\rm{ok-mg-def-plistp1}}\,({\it{proc-list\/}}, {\it{proc-list\/}})\index{ok-mg-def-plistp1}
\end{tabbing}


\noindent{\sc Event}:   Disable ok-mg-def.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  assoc-def-ok1 \\ \index{assoc-def-ok1}
\=\+({\rm{ok-mg-def-plistp1}}\,({\it{proc-list1\/}}, {\it{proc-list2\/}})\index{ok-mg-def-plistp1} $\wedge$ {\rm{definedp}}\,({\it{name\/}}, {\it{proc-list1\/}})\index{definedp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-def}}\,({\rm{assoc}}\,({\it{name\/}}, {\it{proc-list1\/}}), {\it{proc-list2\/}})\index{ok-mg-def}\-
\end{tabbing}


\noindent{\sc Event}:   Disable assoc-def-ok1.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  called-def-ok \\ \index{called-def-ok}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-def}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def}, {\it{proc-list\/}})\index{ok-mg-def}\-
\end{tabbing}


\noindent{\sc Event}:   Disable fetch-called-def.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  called-def-formals-ok \\ \index{called-def-formals-ok}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{ok-mg-formal-data-params-plistp}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals})\index{ok-mg-formal-data-params-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-local-data-plistp}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{ok-mg-local-data-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{data-param-lists-match}}\,(\=\+{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, \\ 
{\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals}, \\ 
{\it{name-alist\/}})\-\index{data-param-lists-match} \\ 
$\wedge$$\;\;\;\;${\rm{no-duplicates}}\,({\rm{listcars}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals})\index{listcars})\index{no-duplicates} \\ 
$\wedge$$\;\;\;\;${\rm{plistp}}\,({\rm{make-cond-list}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{make-cond-list})\index{plistp} \\ 
$\wedge$$\;\;\;\;${\rm{no-duplicates}}\,({\rm{append}}\,(\=\+{\rm{listcars}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals})\index{listcars}, \\ 
{\rm{listcars}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{listcars})\-)\index{no-duplicates} \\ 
$\wedge$$\;\;\;\;${\rm{all-cars-unique}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-formals})\index{all-cars-unique} \\ 
$\wedge$$\;\;\;\;${\rm{all-cars-unique}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-locals})\index{all-cars-unique})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-locals-plistp \\ \index{ok-locals-plistp}
{\rm{ok-mg-local-data-plistp}}\,({\it{x\/}})\index{ok-mg-local-data-plistp} $\rightarrow$ {\rm{plistp}}\,({\it{x\/}})\index{plistp}
\end{tabbing}


\noindent{\sc Event}:   Disable ok-locals-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  locals-plistp \\ \index{locals-plistp}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{plistp}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-locals})\index{plistp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-name-alist-elementp.

\addvspace{18pt}

\begin{verbatim};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                    ;;
;;                      MG INTERPRETER FUNCTIONS                      ;;
;;                                                                    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; The following set of functions defines the interpreter for Micro-Gypsy.
;; A state is defined to be an ordered pair consisting of a variable a-list and a 
;; global condition indicator.  
;; The meaning of a statement in an environment (state) is the environment
;; which results from executing that statement.  Thus, the semantics is very
;; much an operational semantics.  

;; The condition component of the state is simply a litatom which is 'normal
;; in the initial state.  The variable a-list is of the form 
;; ((v1 (value1 type1)) ... (vn (valuen typen))) for each of the entities known in
;; the current scope.  Notice that the recognizer alist is not required though I 
;; will need to record on the var-alist whether a variable is a const or var
;; param when I add procedure calls.

\end{verbatim}
\noindent{\sc Event}:   Add the shell {\it{mg-state\/}}\index{mg-state}, with recognizer function symbol {\it{mg-statep\/}} and 3 accessors: {\it{cc\/}}, with type restriction (none-of) and default value false; {\it{mg-alist\/}}, with type restriction (none-of) and default value false; {\it{mg-psw\/}}, with type restriction (none-of) and default value false.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{resource-errorp} \\  
{\rm{resource-errorp}}\,({\it{mg-state\/}})\index{resource-errorp} $=$ ({\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw} $\not=$ {\tt{'}}{\tt{run}})
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{signal-system-error} \\  
\=\+{\rm{signal-system-error}}\,({\it{mg-state\/}}, {\it{error\/}})\index{signal-system-error} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,({\rm{cc}}\,({\it{mg-state\/}})\index{cc}, {\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{error\/}})\index{mg-state}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{normal}$\;\;$
{\rm{normal}}\,({\it{mg-state\/}})\index{normal} $=$ ({\rm{cc}}\,({\it{mg-state\/}})\index{cc} $=$ {\tt{'}}{\tt{normal}})
\end{tabbing}

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

\begin{tabbing}{\sc Definition}:\index{get-m-value} \\  
{\rm{get-m-value}}\,({\it{name\/}}, {\it{alist\/}})\index{get-m-value} $=$ {\rm{m-value}}\,({\rm{assoc}}\,({\it{name\/}}, {\it{alist\/}}))\index{m-value}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-alist-elementp} \\  
\=\+{\rm{mg-alist-elementp}}\,({\it{x\/}})\index{mg-alist-elementp} \\ 
$=$$\;\;\;\;$(\=\+{\rm{length-plistp}}\,({\it{x\/}}, {\tt{3}})\index{length-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-namep}}\,({\rm{car}}\,({\it{x\/}}))\index{ok-mg-namep} \\ 
$\wedge$$\;\;\;\;${\rm{mg-type-refp}}\,({\rm{m-type}}\,({\it{x\/}})\index{m-type})\index{mg-type-refp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-valuep}}\,({\rm{m-value}}\,({\it{x\/}})\index{m-value}, {\rm{m-type}}\,({\it{x\/}})\index{m-type})\index{ok-mg-valuep})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  new-value-mg-alist-elementp \\ \index{new-value-mg-alist-elementp}
\=\+({\rm{mg-alist-elementp}}\,({\it{x\/}})\index{mg-alist-elementp} $\wedge$ {\rm{ok-mg-valuep}}\,({\it{value\/}}, {\rm{cadr}}\,({\it{x\/}}))\index{ok-mg-valuep}) \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alist-elementp}}\,({\rm{cons}}\,({\rm{car}}\,({\it{x\/}}), {\rm{cons}}\,({\rm{cadr}}\,({\it{x\/}}), {\rm{cons}}\,({\it{value\/}}, {\rm{cdddr}}\,({\it{x\/}})))))\index{mg-alist-elementp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-alist-elementp.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{mg-alistp} \\  
\=\+{\rm{mg-alistp}}\,({\it{lst\/}})\index{mg-alistp} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{lst\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{lst\/}} $=$ {\bf{nil}} \\ 
{\bf else }{\rm{mg-alist-elementp}}\,({\rm{car}}\,({\it{lst\/}}))\index{mg-alist-elementp} $\wedge$ {\rm{mg-alistp}}\,({\rm{cdr}}\,({\it{lst\/}}))\index{mg-alistp}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alistp-cdr \\ \index{mg-alistp-cdr}
({\rm{listp}}\,({\it{x\/}}) $\wedge$ {\rm{mg-alistp}}\,({\it{x\/}})\index{mg-alistp}) $\rightarrow$ {\rm{mg-alistp}}\,({\rm{cdr}}\,({\it{x\/}}))\index{mg-alistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alistp-cons \\ \index{mg-alistp-cons}
{\rm{mg-alistp}}\,({\rm{cons}}\,({\it{x\/}}, {\rm{cons}}\,({\it{y\/}}, {\it{z\/}})))\index{mg-alistp} $\rightarrow$ {\rm{mg-alistp}}\,({\rm{cons}}\,({\it{x\/}}, {\it{z\/}}))\index{mg-alistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alist-member-mg-alist-elementp \\ \index{mg-alist-member-mg-alist-elementp}
({\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} $\wedge$ ({\it{x\/}} $\in$ {\it{mg-alist\/}})) $\rightarrow$ {\rm{mg-alist-elementp}}\,({\it{x\/}})\index{mg-alist-elementp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alistp-distributes \\ \index{mg-alistp-distributes}
{\rm{mg-alistp}}\,({\rm{append}}\,({\it{x\/}}, {\it{y\/}}))\index{mg-alistp} $\rightarrow$ {\rm{mg-alistp}}\,({\it{y\/}})\index{mg-alistp}
\end{tabbing} 

\begin{tabbing}{\sc Theorem}:  mg-alistp-distributes2 \\ \index{mg-alistp-distributes2}
({\rm{mg-alistp}}\,({\rm{append}}\,({\it{x\/}}, {\it{y\/}}))\index{mg-alistp} $\wedge$ {\rm{plistp}}\,({\it{x\/}})\index{plistp}) $\rightarrow$ {\rm{mg-alistp}}\,({\it{x\/}})\index{mg-alistp}
\end{tabbing} 


\noindent{\sc Event}:   Disable mg-alistp-distributes2.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-alist-mg-name-alistp \\ \index{mg-alist-mg-name-alistp}
{\rm{mg-alistp}}\,({\it{lst\/}})\index{mg-alistp} $\rightarrow$ {\rm{mg-name-alistp}}\,({\it{lst\/}})\index{mg-name-alistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alistp-plistp \\ \index{mg-alistp-plistp}
{\rm{mg-alistp}}\,({\it{alist\/}})\index{mg-alistp} $\rightarrow$ {\rm{plistp}}\,({\it{alist\/}})\index{plistp}
\end{tabbing}


\noindent{\sc Event}:   Disable mg-alistp-plistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-alist-elements-have-ok-values \\ \index{mg-alist-elements-have-ok-value!s}
\=\+({\rm{mg-alistp}}\,({\it{alist\/}})\index{mg-alistp} $\wedge$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-valuep}}\,({\rm{caddr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{alist\/}})), {\rm{cadr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{alist\/}})))\index{ok-mg-valuep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  restrict-preserves-mg-alistp \\ \index{restrict-preserves-mg-alistp}
{\rm{mg-alistp}}\,({\it{alist\/}})\index{mg-alistp} $\rightarrow$ {\rm{mg-alistp}}\,({\rm{restrict}}\,({\it{alist\/}}, {\it{names\/}})\index{restrict})\index{mg-alistp}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-cc} \\  
\=\+{\rm{ok-cc}}\,({\it{c\/}}, {\it{cond-list\/}})\index{ok-cc} \\ 
$=$$\;\;\;\;$(\=\+{\rm{litatom}}\,({\it{c\/}}) \\ 
$\wedge$$\;\;\;\;$(({\it{c\/}} $\in$ {\tt{'}}{\tt{(}}{\tt{normal}}{\tt{ }}{\tt{routineerror}}{\tt{)}}) $\vee$ ({\it{c\/}} $\in$ {\it{cond-list\/}})))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alistp-implies-mg-statep \\ \index{mg-alistp-implies-mg-statep}
{\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{mg-alistp} $\rightarrow$ {\rm{mg-statep}}\,({\it{mg-state\/}})\index{mg-statep}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ok-mg-statep} \\  
\=\+{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{cond-list\/}})\index{ok-mg-statep} \\ 
$=$$\;\;\;\;$({\rm{ok-cc}}\,({\rm{cc}}\,({\it{mg-state\/}})\index{cc}, {\it{cond-list\/}})\index{ok-cc} $\wedge$ {\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{mg-alistp})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-mg-statep-alist-plistp \\ \index{ok-mg-statep-alist-plistp}
{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{cond-list\/}})\index{ok-mg-statep} $\rightarrow$ {\rm{plistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{plistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cons-preserves-ok-mg-statep \\ \index{cons-preserves-ok-mg-statep}
\=\+{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{cond-list\/}})\index{ok-mg-statep} \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\rm{cons}}\,({\it{x\/}}, {\it{cond-list\/}}))\index{ok-mg-statep}\-
\end{tabbing}


\noindent{\sc Event}:   Disable cons-preserves-ok-mg-statep.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{set-condition} \\  
\=\+{\rm{set-condition}}\,({\it{mg-state\/}}, {\it{condition-name\/}})\index{set-condition} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,({\it{condition-name\/}}, {\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\index{mg-state}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cc-set-condition \\ \index{cc-set-condition}
{\rm{cc}}\,({\rm{set-condition}}\,({\it{mg-state\/}}, {\it{cond\/}})\index{set-condition})\index{cc} $=$ {\it{cond\/}}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alist-set-condition \\ \index{mg-alist-set-condition}
{\rm{mg-alist}}\,({\rm{set-condition}}\,({\it{mg-state\/}}, {\it{cond\/}})\index{set-condition})\index{mg-alist} $=$ {\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-mg-statep-mg-alist-mg-alistp \\ \index{ok-mg-statep-mg-alist-mg-alistp}
{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} $\rightarrow$ {\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{mg-alistp}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{remove-leave} \\  
\=\+{\rm{remove-leave}}\,({\it{mg-state\/}})\index{remove-leave} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{cc}}\,({\it{mg-state\/}})\index{cc} $=$ {\tt{'}}{\tt{leave}}$\;\;${\bf then }{\rm{set-condition}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{normal}})\index{set-condition} \\ 
{\bf else }{\it{mg-state\/}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-expression-falsep} \\  
\=\+{\rm{mg-expression-falsep}}\,({\it{exp\/}}, {\it{mg-state\/}})\index{mg-expression-falsep} \\ 
$=$$\;\;\;\;$(\=\+{\rm{get-m-value}}\,({\it{exp\/}}, {\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{get-m-value} \\ 
$=$$\;\;\;\;${\tt{'}}{\tt{(}}{\tt{boolean-mg}}{\tt{ }}{\tt{false-mg}}{\tt{)}})\-\-
\end{tabbing}

\begin{verbatim};; This assumes that the formals and actuals are both given as lists of
;; bare cond names.  This will have to change when the identifier lists
;; are reinstated.
;; Given condition lists (formal1 formal2 ... formaln) and 
;; (actual1 actual2 ... actualn), if cond is formali then return actuali,
;; else 'routineerror.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{convert-condition1} \\  
\=\+{\rm{convert-condition1}}\,({\it{cond\/}}, {\it{formals\/}}, {\it{actuals\/}})\index{convert-condition1} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{formals\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\tt{'}}{\tt{routineerror}} \\ 
{\bf elseif }{\it{cond\/}} $=$ {\rm{car}}\,({\it{formals\/}})$\;\;${\bf then }{\rm{car}}\,({\it{actuals\/}}) \\ 
{\bf else }{\rm{convert-condition1}}\,({\it{cond\/}}, {\rm{cdr}}\,({\it{formals\/}}), {\rm{cdr}}\,({\it{actuals\/}}))\index{convert-condition1}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{convert-condition} \\  
\=\+{\rm{convert-condition}}\,({\it{cond\/}}, {\it{formals\/}}, {\it{actuals\/}})\index{convert-condition} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{cond\/}} $\in$ {\tt{'}}{\tt{(}}{\tt{normal}}{\tt{ }}{\tt{routineerror}}{\tt{)}}$\;\;${\bf then }{\it{cond\/}} \\ 
{\bf else }{\rm{convert-condition1}}\,({\it{cond\/}}, {\it{formals\/}}, {\it{actuals\/}})\index{convert-condition1}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  convert-condition-non-member \\ \index{convert-condition-non-member}
\=\+({\it{cond\/}} $\not\in$ {\it{formals\/}}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{convert-condition1}}\,({\it{cond\/}}, {\it{formals\/}}, {\it{actuals\/}})\index{convert-condition1} $=$ {\tt{'}}{\tt{routineerror}})\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{set-alist-value} \\  
\=\+{\rm{set-alist-value}}\,({\it{name\/}}, {\it{val\/}}, {\it{alist\/}})\index{set-alist-value} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{alist\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf elseif }{\rm{car}}\,({\rm{car}}\,({\it{alist\/}})) $=$ {\it{name\/}} \\ 
{\bf then }{\rm{cons}}\,(\=\+{\rm{cons}}\,(\=\+{\it{name\/}}, \\ 
{\rm{cons}}\,({\rm{m-type}}\,({\rm{car}}\,({\it{alist\/}}))\index{m-type}, {\rm{cons}}\,({\it{val\/}}, {\rm{cdddr}}\,({\rm{car}}\,({\it{alist\/}})))))\-, \\ 
{\rm{cdr}}\,({\it{alist\/}}))\- \\ 
{\bf else }{\rm{cons}}\,({\rm{car}}\,({\it{alist\/}}), {\rm{set-alist-value}}\,({\it{name\/}}, {\it{val\/}}, {\rm{cdr}}\,({\it{alist\/}}))\index{set-alist-value})$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-definedp \\ \index{set-alist-value-preserves-define!dp}
{\rm{definedp}}\,({\it{v\/}}, {\it{alist\/}})\index{definedp} $\rightarrow$ {\rm{definedp}}\,({\it{v\/}}, {\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable set-alist-value-preserves-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-ok-actual-params-list \\ \index{set-alist-value-preserves-ok-act!ual-params-list}
\=\+{\rm{ok-actual-params-list}}\,({\it{actuals\/}}, {\it{alist\/}})\index{ok-actual-params-list} \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-actual-params-list}}\,({\it{actuals\/}}, {\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})\index{ok-actual-params-list}\-
\end{tabbing}


\noindent{\sc Event}:   Disable set-alist-value-preserves-ok-actual-params-list.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-cadr-assoc \\ \index{set-alist-value-preserves-cadr-!assoc}
\=\+{\rm{mg-alistp}}\,({\it{alist\/}})\index{mg-alistp} \\ 
$\rightarrow$$\;\;\;\;$({\rm{cadr}}\,({\rm{assoc}}\,({\it{v\/}}, {\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})) $=$ {\rm{cadr}}\,({\rm{assoc}}\,({\it{v\/}}, {\it{alist\/}})))\-
\end{tabbing}


\noindent{\sc Event}:   Disable set-alist-value-preserves-cadr-assoc.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-data-param-lists-match \\ \index{set-alist-value-preserves-data-p!aram-lists-match}
\=\+({\rm{mg-alistp}}\,({\it{alist\/}})\index{mg-alistp} $\wedge$ {\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{alist\/}})\index{data-param-lists-match}) \\ 
$\rightarrow$$\;\;\;\;${\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})\index{data-param-lists-match}\-
\end{tabbing}


\noindent{\sc Event}:   Disable set-alist-value-preserves-data-param-lists-match.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-listcars \\ \index{set-alist-value-preserves-listc!ars}
{\rm{listcars}}\,({\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})\index{listcars} $=$ {\rm{listcars}}\,({\it{alist\/}})\index{listcars}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-all-cars-unique \\ \index{set-alist-value-preserves-all-c!ars-unique}
{\rm{all-cars-unique}}\,({\it{alist\/}})\index{all-cars-unique} $\rightarrow$ {\rm{all-cars-unique}}\,({\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})\index{all-cars-unique}
\end{tabbing}


\noindent{\sc Event}:   Disable set-alist-value-preserves-all-cars-unique.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-signatures-match \\ \index{set-alist-value-preserves-signat!ures-match}
{\rm{plistp}}\,({\it{alist\/}})\index{plistp} $\rightarrow$ {\rm{signatures-match}}\,({\it{alist\/}}, {\rm{set-alist-value}}\,({\it{x\/}}, {\it{y\/}}, {\it{alist\/}})\index{set-alist-value})\index{signatures-match}
\end{tabbing}


\noindent{\sc Event}:   Disable set-alist-value-preserves-signatures-match.

\addvspace{18pt}      


\begin{tabbing}{\sc Definition}:\index{copy-out-params} \\  
\=\+{\rm{copy-out-params}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{new-var-alist\/}}, {\it{old-var-alist\/}})\index{copy-out-params} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{formals\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\it{old-var-alist\/}} \\ 
{\bf else }{\rm{copy-out-params}}\,(\=\+{\rm{cdr}}\,({\it{formals\/}}), \\ 
{\rm{cdr}}\,({\it{actuals\/}}), \\ 
{\it{new-var-alist\/}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\it{actuals\/}}), \\ 
{\rm{caddr}}\,({\rm{assoc}}\,(\=\+{\rm{caar}}\,({\it{formals\/}}), \\ 
{\it{new-var-alist\/}})\-), \\ 
{\it{old-var-alist\/}})\-\index{set-alist-value})\-\index{copy-out-params}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{map-call-effects} \\  
\=\+{\rm{map-call-effects}}\,({\it{new-state\/}}, {\it{def\/}}, {\it{stmt\/}}, {\it{old-state\/}})\index{map-call-effects} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\rm{convert-condition}}\,(\=\+{\rm{cc}}\,({\it{new-state\/}})\index{cc}, \\ 
{\rm{def-conds}}\,({\it{def\/}})\index{def-conds}, \\ 
{\rm{call-conds}}\,({\it{stmt\/}})\index{call-conds})\-\index{convert-condition}, \\ 
{\rm{copy-out-params}}\,(\=\+{\rm{def-formals}}\,({\it{def\/}})\index{def-formals}, \\ 
{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, \\ 
{\rm{mg-alist}}\,({\it{new-state\/}})\index{mg-alist}, \\ 
{\rm{mg-alist}}\,({\it{old-state\/}})\index{mg-alist})\-\index{copy-out-params}, \\ 
{\rm{mg-psw}}\,({\it{new-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}


\noindent{\sc Event}:   Disable map-call-effects.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-normal \\ \index{map-call-effects-preserves-norm!al}
\=\+{\rm{normal}}\,({\it{new-state\/}})\index{normal} \\ 
$\rightarrow$$\;\;\;\;$({\rm{cc}}\,({\rm{map-call-effects}}\,({\it{new-state\/}}, {\it{def\/}}, {\it{stmt\/}}, {\it{old-state\/}})\index{map-call-effects})\index{cc} $=$ {\tt{'}}{\tt{normal}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-routineerror \\ \index{map-call-effects-preserves-routi!neerror}
\=\+({\rm{cc}}\,({\it{new-state\/}})\index{cc} $=$ {\tt{'}}{\tt{routineerror}}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cc}}\,({\rm{map-call-effects}}\,({\it{new-state\/}}, {\it{def\/}}, {\it{stmt\/}}, {\it{old-state\/}})\index{map-call-effects})\index{cc} \\ 
$=$$\;\;\;\;${\tt{'}}{\tt{routineerror}})\-\-
\end{tabbing}

\begin{verbatim};; This creates the part of the var alist for the call corresponding to the 
;; formals.  The formal has form (name kind type) and the actual is either
;; a literal or an identifierp.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{make-call-param-alist} \\  
\=\+{\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{mg-alist\/}})\index{make-call-param-alist} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{formals\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{nil}} \\ 
{\bf else }{\rm{cons}}\,(\=\+{\rm{list}}\,(\=\+{\rm{caar}}\,({\it{formals\/}}), \\ 
{\rm{cadar}}\,({\it{formals\/}}), \\ 
{\rm{caddr}}\,({\rm{assoc}}\,({\rm{car}}\,({\it{actuals\/}}), {\it{mg-alist\/}})))\-, \\ 
{\rm{make-call-param-alist}}\,(\=\+{\rm{cdr}}\,({\it{formals\/}}), \\ 
{\rm{cdr}}\,({\it{actuals\/}}), \\ 
{\it{mg-alist\/}})\-\index{make-call-param-alist})\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  make-call-param-alist-plistp \\ \index{make-call-param-alist-plistp}
{\rm{plistp}}\,({\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{alist\/}})\index{make-call-param-alist})\index{plistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  make-call-param-alist-preserves-listcars \\ \index{make-call-param-alist-preserves!-listcars}
\=\+{\rm{listcars}}\,({\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{mg-alist\/}})\index{make-call-param-alist})\index{listcars} \\ 
$=$$\;\;\;\;${\rm{listcars}}\,({\it{formals\/}})\index{listcars}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{make-call-var-alist} \\  
\=\+{\rm{make-call-var-alist}}\,({\it{mg-alist\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-var-alist} \\ 
$=$$\;\;\;\;${\rm{append}}\,(\=\+{\rm{make-call-param-alist}}\,(\=\+{\rm{def-formals}}\,({\it{def\/}})\index{def-formals}, \\ 
{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, \\ 
{\it{mg-alist\/}})\-\index{make-call-param-alist}, \\ 
{\rm{def-locals}}\,({\it{def\/}})\index{def-locals})\-\-
\end{tabbing}

\begin{verbatim};; This doesn't really need the hypothesis.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  plistp-make-call-var-alist \\ \index{plistp-make-call-var-alist}
{\rm{plistp}}\,({\rm{def-locals}}\,({\it{def\/}})\index{def-locals})\index{plistp} $\rightarrow$ {\rm{plistp}}\,({\rm{make-call-var-alist}}\,({\it{state\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-var-alist})\index{plistp}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{make-call-environment} \\  
\=\+{\rm{make-call-environment}}\,({\it{mg-state\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-environment} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{make-call-var-alist}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-var-alist}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}


\noindent{\sc Event}:   Disable make-call-environment.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  make-call-environment-decomposition \\ \index{make-call-environment-decompositi!on}
\=\+({\rm{cc}}\,({\rm{make-call-environment}}\,({\it{mg-state\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-environment})\index{cc} $=$ {\tt{'}}{\tt{normal}}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{mg-alist}}\,({\rm{make-call-environment}}\,({\it{mg-state\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-environment})\index{mg-alist} \\ 
$=$$\;\;\;\;${\rm{make-call-var-alist}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-var-alist})\- \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{mg-psw}}\,({\rm{make-call-environment}}\,({\it{mg-state\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-environment})\index{mg-psw} \\ 
$=$$\;\;\;\;${\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\-
\end{tabbing}

\begin{verbatim};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                    ;;
;;           SEMANTICS FOR THE PREDEFINED PROCEDURES                  ;;
;;                                                                    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; These are structurally identical to the Piton version merely
;; altered to change 't and 'f to 'true-mg and 'false-mg.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-bool} \\  
\=\+{\rm{mg-bool}}\,({\it{x\/}})\index{mg-bool} \\ 
$=$$\;\;\;\;${\rm{tag}}\,(\=\+{\tt{'}}{\tt{boolean-mg}}, \\ 
\=\+{\bf if }{\it{x\/}}$\;\;${\bf then }{\tt{'}}{\tt{true-mg}} \\ 
{\bf else }{\tt{'}}{\tt{false-mg}}$\;${\bf  endif}\-)\-\index{tag}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-or-bool} \\  
\=\+{\rm{mg-or-bool}}\,({\it{x\/}}, {\it{y\/}})\index{mg-or-bool} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $=$ {\tt{'}}{\tt{false-mg}}$\;\;${\bf then }{\it{y\/}} \\ 
{\bf else }{\tt{'}}{\tt{true-mg}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-and-bool} \\  
\=\+{\rm{mg-and-bool}}\,({\it{x\/}}, {\it{y\/}})\index{mg-and-bool} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $=$ {\tt{'}}{\tt{false-mg}}$\;\;${\bf then }{\tt{'}}{\tt{false-mg}} \\ 
{\bf else }{\it{y\/}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-not-bool} \\  
\=\+{\rm{mg-not-bool}}\,({\it{x\/}})\index{mg-not-bool} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{x\/}} $=$ {\tt{'}}{\tt{false-mg}}$\;\;${\bf then }{\tt{'}}{\tt{true-mg}} \\ 
{\bf else }{\tt{'}}{\tt{false-mg}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{fetch-array-element} \\  
{\rm{fetch-array-element}}\,({\it{a\/}}, {\it{i\/}}, {\it{alist\/}})\index{fetch-array-element} $=$ {\rm{get}}\,({\it{i\/}}, {\rm{caddr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{alist\/}})))\index{get}
\end{tabbing}

\begin{verbatim};; This returns the array with the substitution, not the resulting
;; alist.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{put-array-element} \\  
{\rm{put-array-element}}\,({\it{a\/}}, {\it{i\/}}, {\it{val\/}}, {\it{alist\/}})\index{put-array-element} $=$ {\rm{put}}\,({\it{val\/}}, {\it{i\/}}, {\rm{caddr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{alist\/}})))\index{put}
\end{tabbing}

\begin{verbatim};; x := y  -- y is a variable

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-simple-variable-a!ssignment} \\  
\=\+{\rm{mg-meaning-mg-simple-variable-assignment}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-variable-a!ssignment} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; x := c  -- c is a constant

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-simple-constant-a!ssignment} \\  
\=\+{\rm{mg-meaning-mg-simple-constant-assignment}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-constant-a!ssignment} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; b := (x = y)

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-simple-variable-eq} \\  
\=\+{\rm{mg-meaning-mg-simple-variable-eq}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-variable-eq} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-bool}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag} \\ 
$=$$\;\;\;\;${\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}\-)\index{mg-bool}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; b := (x = c)

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-simple-constant-eq} \\  
\=\+{\rm{mg-meaning-mg-simple-constant-eq}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-constant-eq} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-bool}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag} \\ 
$=$$\;\;\;\;${\rm{untag}}\,({\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}))\index{untag}\-)\index{mg-bool}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; b := (x le y)  -- Here x and y are integer variables

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-integer-le} \\  
\=\+{\rm{mg-meaning-mg-integer-le}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-le} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-bool}}\,({\rm{ileq}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}, \\ 
{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\-\index{ileq})\index{mg-bool}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; x := -y

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-integer-unary-min!us} \\  
\=\+{\rm{mg-meaning-mg-integer-unary-minus}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-unary-min!us} \\ 
$=$$\;\;\;\;$\=\+{\bf let }\=\+{\it{value\/}}{\bf $\;$ be$\;\;$}{\rm{inegate}}\,({\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\index{inegate}\- \\ 
{\bf in} \\ 
\=\+{\bf if }{\rm{small-integerp}}\,({\it{value\/}}, {\sc{mg-word-size}}\index{mg-word-size})\index{small-integerp} \\ 
{\bf then }{\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{tag}}\,({\tt{'}}{\tt{int-mg}}, {\it{value\/}})\index{tag}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state} \\ 
{\bf else }{\rm{set-condition}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{routineerror}})\index{set-condition}$\;${\bf  endif}\-$\;${\bf  endlet}\-\-
\end{tabbing}

\begin{verbatim};; x := y + z

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-integer-add} \\  
\=\+{\rm{mg-meaning-mg-integer-add}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-add} \\ 
$=$$\;\;\;\;$\=\+{\bf let }\=\+{\it{sum\/}}{\bf $\;$ be$\;\;$}{\rm{iplus}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}, \\ 
{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\-\index{iplus}\- \\ 
{\bf in} \\ 
\=\+{\bf if }{\rm{small-integerp}}\,({\it{sum\/}}, {\sc{mg-word-size}}\index{mg-word-size})\index{small-integerp} \\ 
{\bf then }{\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{tag}}\,({\tt{'}}{\tt{int-mg}}, {\it{sum\/}})\index{tag}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state} \\ 
{\bf else }{\rm{set-condition}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{routineerror}})\index{set-condition}$\;${\bf  endif}\-$\;${\bf  endlet}\-\-
\end{tabbing}

\begin{verbatim};; x := y - z

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-integer-subtract} \\  
\=\+{\rm{mg-meaning-mg-integer-subtract}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-subtract} \\ 
$=$$\;\;\;\;$\=\+{\bf let }\=\+{\it{diff\/}}{\bf $\;$ be$\;\;$}{\rm{idifference}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}, \\ 
{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\-\index{idifference}\- \\ 
{\bf in} \\ 
\=\+{\bf if }{\rm{small-integerp}}\,({\it{diff\/}}, {\sc{mg-word-size}}\index{mg-word-size})\index{small-integerp} \\ 
{\bf then }{\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{tag}}\,({\tt{'}}{\tt{int-mg}}, {\it{diff\/}})\index{tag}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state} \\ 
{\bf else }{\rm{set-condition}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{routineerror}})\index{set-condition}$\;${\bf  endif}\-$\;${\bf  endlet}\-\-
\end{tabbing}

\begin{verbatim};; b := b1 or b2

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-boolean-or} \\  
\=\+{\rm{mg-meaning-mg-boolean-or}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-boolean-or} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{tag}}\,(\=\+{\tt{'}}{\tt{boolean-mg}}, \\ 
{\rm{mg-or-bool}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}, \\ 
{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\-\index{mg-or-bool})\-\index{tag}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; b := b1 and b2

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-boolean-and} \\  
\=\+{\rm{mg-meaning-mg-boolean-and}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-boolean-and} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{tag}}\,(\=\+{\tt{'}}{\tt{boolean-mg}}, \\ 
{\rm{mg-and-bool}}\,(\=\+{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}, \\ 
{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\-\index{mg-and-bool})\-\index{tag}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; b := not b1

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-boolean-not} \\  
\=\+{\rm{mg-meaning-mg-boolean-not}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-boolean-not} \\ 
$=$$\;\;\;\;${\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{tag}}\,(\=\+{\tt{'}}{\tt{boolean-mg}}, \\ 
{\rm{mg-not-bool}}\,({\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag})\index{mg-not-bool})\-\index{tag}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state}\-
\end{tabbing}

\begin{verbatim};; THE ARRAY OPERATIONS

;; z := A[i] for A of size 
;; The call is (predefined-proc-call-mg mg-index-array (z A i size))		 

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-index-array} \\  
\=\+{\rm{mg-meaning-mg-index-array}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-index-array} \\ 
$=$$\;\;\;\;$\=\+{\bf let }\=\+{\it{index\/}}{\bf $\;$ be$\;\;$}{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}\- \\ 
{\bf in} \\ 
\=\+{\bf if }\=\+({\it{index\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{index\/}} $<$ {\rm{array-length}}\,({\rm{get-m-type}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-type})\index{array-length})\- \\ 
{\bf then }{\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{fetch-array-element}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\it{index\/}}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{fetch-array-element}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state} \\ 
{\bf else }{\rm{set-condition}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{routineerror}})\index{set-condition}$\;${\bf  endif}\-$\;${\bf  endlet}\-\-
\end{tabbing}

\begin{verbatim};; A[i] := v   -- The actual argument list is (A i v size) where size is the 
;;      array-length of the type of A.  Here i and v are both variables.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{mg-meaning-mg-array-element-assi!gnment} \\  
\=\+{\rm{mg-meaning-mg-array-element-assignment}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-array-element-assi!gnment} \\ 
$=$$\;\;\;\;$\=\+{\bf let }\=\+{\it{index\/}}{\bf $\;$ be$\;\;$}{\rm{untag}}\,({\rm{get-m-value}}\,(\=\+{\rm{cadr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value})\index{untag}, \\ 
{\it{val\/}}{\bf $\;$ be$\;\;$}{\rm{get-m-value}}\,(\=\+{\rm{caddr}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-value}\- \\ 
{\bf in} \\ 
\=\+{\bf if }\=\+({\it{index\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{index\/}} $<$ {\rm{array-length}}\,({\rm{get-m-type}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{get-m-type})\index{array-length})\- \\ 
{\bf then }{\rm{mg-state}}\,(\=\+{\tt{'}}{\tt{normal}}, \\ 
{\rm{set-alist-value}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\rm{put-array-element}}\,(\=\+{\rm{car}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}), \\ 
{\it{index\/}}, \\ 
{\it{val\/}}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{put-array-element}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{set-alist-value}, \\ 
{\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw})\-\index{mg-state} \\ 
{\bf else }{\rm{set-condition}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{routineerror}})\index{set-condition}$\;${\bf  endif}\-$\;${\bf  endlet}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{mg-meaning-predefined-proc-call} \\  
\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\rm{call-name}}\,({\it{stmt\/}})\index{call-name}: \\ 
{\bf case = }{\it{mg-simple-variable-assignment\/}} \\ 
{\bf then }{\rm{mg-meaning-mg-simple-variable-assignment}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-variable-a!ssignment} \\ 
{\bf case = }{\it{mg-simple-constant-assignment\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-simple-constant-assignment}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-constant-a!ssignment} \\ 
{\bf case = }{\it{mg-simple-variable-eq\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-simple-variable-eq}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-variable-eq} \\ 
{\bf case = }{\it{mg-simple-constant-eq\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-simple-constant-eq}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-simple-constant-eq} \\ 
{\bf case = }{\it{mg-integer-le\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-integer-le}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-le} \\ 
{\bf case = }{\it{mg-integer-unary-minus\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-integer-unary-minus}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-unary-min!us} \\ 
{\bf case = }{\it{mg-integer-add\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-integer-add}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-add} \\ 
{\bf case = }{\it{mg-integer-subtract\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-integer-subtract}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-integer-subtract} \\ 
{\bf case = }{\it{mg-boolean-or\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-boolean-or}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-boolean-or} \\ 
{\bf case = }{\it{mg-boolean-and\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-boolean-and}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-boolean-and} \\ 
{\bf case = }{\it{mg-boolean-not\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-boolean-not}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-boolean-not} \\ 
{\bf case = }{\it{mg-index-array\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-index-array}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-index-array} \\ 
{\bf case = }{\it{mg-array-element-assignment\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-mg-array-element-assignment}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-mg-array-element-assi!gnment} \\ 
{\bf otherwise }{\it{mg-state\/}}$\;${\bf  endcase}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-predefined-proc-call.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{mg-meaning} \\  
\=\+{\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{timed-out}})\index{signal-system-error} \\ 
{\bf elseif }$\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal}$\;\;${\bf then }{\it{mg-state\/}} \\ 
{\bf else }\=\+{\bf case on }{\rm{car}}\,({\it{stmt\/}}): \\ 
{\bf case = }{\it{no-op-mg\/}} \\ 
{\bf then }{\it{mg-state\/}} \\ 
{\bf case = }{\it{signal-mg\/}} \\ 
{\bf $\;\;$then }{\rm{set-condition}}\,({\it{mg-state\/}}, {\rm{signalled-condition}}\,({\it{stmt\/}})\index{signalled-condition})\index{set-condition} \\ 
{\bf case = }{\it{prog2-mg\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning}}\,(\=\+{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning} \\ 
{\bf case = }{\it{loop-mg\/}} \\ 
{\bf $\;\;$then }{\rm{remove-leave}}\,({\rm{mg-meaning}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning})\index{remove-leave} \\ 
{\bf case = }{\it{if-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\bf if }{\rm{mg-expression-falsep}}\,({\rm{if-condition}}\,({\it{stmt\/}})\index{if-condition}, {\it{mg-state\/}})\index{mg-expression-falsep} \\ 
{\bf then }{\rm{mg-meaning}}\,(\=\+{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning} \\ 
{\bf else }{\rm{mg-meaning}}\,(\=\+{\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}$\;${\bf  endif}\- \\ 
{\bf case = }{\it{begin-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\bf if }\=\+{\rm{cc}}\,({\rm{mg-meaning}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning})\index{cc} \\ 
$\in$$\;\;\;\;${\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels}\- \\ 
{\bf then }{\rm{mg-meaning}}\,(\=\+{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{set-condition}}\,(\=\+{\rm{mg-meaning}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\tt{'}}{\tt{normal}})\-\index{set-condition}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning} \\ 
{\bf else }{\rm{mg-meaning}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}$\;${\bf  endif}\- \\ 
{\bf case = }{\it{proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{map-call-effects}}\,(\=\+{\rm{mg-meaning}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def}, \\ 
{\it{stmt\/}}, \\ 
{\it{mg-state\/}})\-\index{map-call-effects} \\ 
{\bf case = }{\it{predefined-proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call} \\ 
{\bf otherwise }{\it{mg-state\/}}$\;${\bf  endcase}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                    ;;
;;                         RESOURCE ERRORS                            ;;
;;                                                                    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; This is the version of mg-meaning with resource errors.  It should be a 
;; theorem that in the absence of resource-error, it behaves exactly as
;; mg-meaning.  

;; The resource descriptor is a pair <temp-stk-size, ctrl-stk-size> where
;; the two components are numberps which characterize the number of free
;; slots on the top of the stacks.  We cause a resource error if there is
;; not enough space to continue without stack overflow.  If the resource
;; requirements exceed the available space, the cc is set to 'resource-error.

;; This computes the amount of space required for the storage of the locals.  It is the
;; number of simple variables plus the sum of the lengths of the arrays.  

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{data-length} \\  
\=\+{\rm{data-length}}\,({\it{locals\/}})\index{data-length} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{locals\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\tt{0}} \\ 
{\bf elseif }{\rm{simple-mg-type-refp}}\,({\rm{cadr}}\,({\rm{car}}\,({\it{locals\/}})))\index{simple-mg-type-refp} \\ 
{\bf then }$1\;+$ {\rm{data-length}}\,({\rm{cdr}}\,({\it{locals\/}}))\index{data-length} \\ 
{\bf else }\=\+{\rm{array-length}}\,({\rm{cadr}}\,({\rm{car}}\,({\it{locals\/}})))\index{array-length} \\ 
$+$$\;\;\;\;${\rm{data-length}}\,({\rm{cdr}}\,({\it{locals\/}}))\index{data-length}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  data-length-not-zerop \\ \index{data-length-not-zerop}
\=\+({\rm{ok-mg-local-data-plistp}}\,({\it{locals\/}})\index{ok-mg-local-data-plistp} $\wedge$ {\rm{listp}}\,({\it{locals\/}})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{data-length}}\,({\it{locals\/}})\index{data-length} $\not\simeq {\tt{0}}$)\-
\end{tabbing}


\noindent{\sc Event}:   Disable data-length-not-zerop.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  data-length-not-zerop2 \\ \index{data-length-not-zerop2}
\=\+({\rm{ok-mg-local-data-plistp}}\,({\it{locals\/}})\index{ok-mg-local-data-plistp} $\wedge$ {\rm{listp}}\,({\it{locals\/}})) \\ 
$\rightarrow$$\;\;\;\;$(({\rm{data-length}}\,({\it{locals\/}})\index{data-length} $\in\;${\bf{N}}${}$) $\wedge$ ({\rm{data-length}}\,({\it{locals\/}})\index{data-length} $\not=$ {\tt{0}}))\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{predefined-proc-call-temp-stk-req!uirement} \\  
\=\+{\rm{predefined-proc-call-temp-stk-requirement}}\,({\it{name\/}})\index{predefined-proc-call-temp-stk-req!uirement} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\it{name\/}}: \\ 
{\bf case = }{\it{mg-simple-variable-assignment\/}} \\ 
{\bf then }{\tt{2}} \\ 
{\bf case = }{\it{mg-simple-constant-assignment\/}} \\ 
{\bf $\;\;$then }{\tt{2}} \\ 
{\bf case = }{\it{mg-simple-variable-eq\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-simple-constant-eq\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-integer-le\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-integer-unary-minus\/}} \\ 
{\bf $\;\;$then }{\tt{2}} \\ 
{\bf case = }{\it{mg-integer-add\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-integer-subtract\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-boolean-or\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-boolean-and\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-boolean-not\/}} \\ 
{\bf $\;\;$then }{\tt{2}} \\ 
{\bf case = }{\it{mg-index-array\/}} \\ 
{\bf $\;\;$then }{\tt{4}} \\ 
{\bf case = }{\it{mg-array-element-assignment\/}} \\ 
{\bf $\;\;$then }{\tt{4}} \\ 
{\bf otherwise }{\tt{0}}$\;${\bf  endcase}\-\-
\end{tabbing}

\begin{verbatim};; The number associated with each predefined procedure
;; represents the number of formals plus locals in the
;; Piton implementation.  This is required because the 
;; ctrl-stk requirements for the call p-frame is 
;; (plus 2 
;;       (length (formal-vars def))
;;       (length (temp-var-dcls def)))

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{predefined-proc-call-bindings-c!ount} \\  
\=\+{\rm{predefined-proc-call-bindings-count}}\,({\it{name\/}})\index{predefined-proc-call-bindings-c!ount} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\it{name\/}}: \\ 
{\bf case = }{\it{mg-simple-variable-assignment\/}} \\ 
{\bf then }{\tt{2}} \\ 
{\bf case = }{\it{mg-simple-constant-assignment\/}} \\ 
{\bf $\;\;$then }{\tt{2}} \\ 
{\bf case = }{\it{mg-simple-variable-eq\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-simple-constant-eq\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-integer-le\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-integer-unary-minus\/}} \\ 
{\bf $\;\;$then }{\tt{4}} \\ 
{\bf case = }{\it{mg-integer-add\/}} \\ 
{\bf $\;\;$then }{\tt{4}} \\ 
{\bf case = }{\it{mg-integer-subtract\/}} \\ 
{\bf $\;\;$then }{\tt{4}} \\ 
{\bf case = }{\it{mg-boolean-or\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-boolean-and\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-boolean-not\/}} \\ 
{\bf $\;\;$then }{\tt{3}} \\ 
{\bf case = }{\it{mg-index-array\/}} \\ 
{\bf $\;\;$then }{\tt{5}} \\ 
{\bf case = }{\it{mg-array-element-assignment\/}} \\ 
{\bf $\;\;$then }{\tt{5}} \\ 
{\bf otherwise }{\tt{0}}$\;${\bf  endcase}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{predefined-proc-call-p-frame-si!ze} \\  
\=\+{\rm{predefined-proc-call-p-frame-size}}\,({\it{name\/}})\index{predefined-proc-call-p-frame-si!ze} \\ 
$=$$\;\;\;\;$($1\;+$ ($1\;+$ {\rm{predefined-proc-call-bindings-count}}\,({\it{name\/}})\index{predefined-proc-call-bindings-c!ount}))\-
\end{tabbing}

\begin{verbatim};; I'm implemententing the resources-available as a pair 
;; <t-size c-size> of numberps.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{t-size}$\;\;$
{\rm{t-size}}\,({\it{x\/}})\index{t-size} $=$ {\rm{car}}\,({\it{x\/}})
\end{tabbing}

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

\begin{verbatim};; An interesting fact is that the requirements for execution of a statement are not
;; dependent on the state.  (Except in the case of begin where a when-label is 
;; signalled.)  This makes the computation of the resource requirements independent of
;; mg-meaning and may allow a much cleaner treatment.

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{temp-stk-requirements} \\  
\=\+{\rm{temp-stk-requirements}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{temp-stk-requirements} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\rm{car}}\,({\it{stmt\/}}): \\ 
{\bf case = }{\it{no-op-mg\/}} \\ 
{\bf then }{\tt{0}} \\ 
{\bf case = }{\it{signal-mg\/}} \\ 
{\bf $\;\;$then }{\tt{1}} \\ 
{\bf case = }{\it{prog2-mg\/}} \\ 
{\bf $\;\;$then }{\tt{0}} \\ 
{\bf case = }{\it{loop-mg\/}} \\ 
{\bf $\;\;$then }{\tt{1}} \\ 
{\bf case = }{\it{if-mg\/}} \\ 
{\bf $\;\;$then }{\tt{1}} \\ 
{\bf case = }{\it{begin-mg\/}} \\ 
{\bf $\;\;$then }{\tt{1}} \\ 
{\bf case = }{\it{proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{max}}\,(\=\+\=\+{\rm{data-length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-locals})\index{data-length} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-locals})\index{length} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals})\index{length}\-, \\ 
{\tt{1}})\- \\ 
{\bf case = }{\it{predefined-proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{predefined-proc-call-temp-stk-requirement}}\,({\rm{call-name}}\,({\it{stmt\/}})\index{call-name})\index{predefined-proc-call-temp-stk-req!uirement} \\ 
{\bf otherwise }{\tt{0}}$\;${\bf  endcase}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{ctrl-stk-requirements} \\  
\=\+{\rm{ctrl-stk-requirements}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{ctrl-stk-requirements} \\ 
$=$$\;\;\;\;$\=\+{\bf case on }{\rm{car}}\,({\it{stmt\/}}): \\ 
{\bf case = }{\it{no-op-mg\/}} \\ 
{\bf then }{\tt{0}} \\ 
{\bf case = }{\it{signal-mg\/}} \\ 
{\bf $\;\;$then }{\tt{0}} \\ 
{\bf case = }{\it{prog2-mg\/}} \\ 
{\bf $\;\;$then }{\tt{0}} \\ 
{\bf case = }{\it{loop-mg\/}} \\ 
{\bf $\;\;$then }{\tt{0}} \\ 
{\bf case = }{\it{if-mg\/}} \\ 
{\bf $\;\;$then }{\tt{0}} \\ 
{\bf case = }{\it{begin-mg\/}} \\ 
{\bf $\;\;$then }{\tt{0}} \\ 
{\bf case = }{\it{proc-call-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\tt{2}} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-locals})\index{length} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-formals})\index{length}\- \\ 
{\bf case = }{\it{predefined-proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{predefined-proc-call-p-frame-size}}\,({\rm{call-name}}\,({\it{stmt\/}})\index{call-name})\index{predefined-proc-call-p-frame-si!ze} \\ 
{\bf otherwise }{\tt{0}}$\;${\bf  endcase}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable temp-stk-requirements.

\addvspace{18pt}

\noindent{\sc Event}:   Disable ctrl-stk-requirements.

\addvspace{18pt}

\begin{verbatim};; Resources are inadequate if I can't perform the current operation without
;; running out of space.  This can alternatively be phrased as follows.
;; In this version, the size-pair contains the 
;; <current temp-stk length, current ctrl-stk length>

\end{verbatim}\begin{tabbing}{\sc Definition}:\index{resources-inadequatep} \\  
\=\+{\rm{resources-inadequatep}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{size-pair\/}})\index{resources-inadequatep} \\ 
$=$$\;\;\;\;$(\=\+(\=\+{\rm{temp-stk-requirements}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{temp-stk-requirements} \\ 
$\not<$$\;\;\;\;$({\sc{mg-max-temp-stk-size}}\index{mg-max-temp-stk-size} $-$ {\rm{t-size}}\,({\it{size-pair\/}})\index{t-size}))\- \\ 
$\vee$$\;\;\;\;$(\=\+{\rm{ctrl-stk-requirements}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{ctrl-stk-requirements} \\ 
$\not<$$\;\;\;\;$({\sc{mg-max-ctrl-stk-size}}\index{mg-max-ctrl-stk-size} $-$ {\rm{c-size}}\,({\it{size-pair\/}})\index{c-size}))\-)\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable resources-inadequatep.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{mg-meaning-r} \\  
\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{timed-out}})\index{signal-system-error} \\ 
{\bf elseif }$\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal}$\;\;${\bf then }{\it{mg-state\/}} \\ 
{\bf elseif }{\rm{resources-inadequatep}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{sizes\/}})\index{resources-inadequatep} \\ 
{\bf then }{\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{resource-error}})\index{signal-system-error} \\ 
{\bf else }\=\+{\bf case on }{\rm{car}}\,({\it{stmt\/}}): \\ 
{\bf case = }{\it{no-op-mg\/}} \\ 
{\bf then }{\it{mg-state\/}} \\ 
{\bf case = }{\it{signal-mg\/}} \\ 
{\bf $\;\;$then }{\rm{set-condition}}\,({\it{mg-state\/}}, {\rm{signalled-condition}}\,({\it{stmt\/}})\index{signalled-condition})\index{set-condition} \\ 
{\bf case = }{\it{prog2-mg\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-r}}\,(\=\+{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning-r}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r} \\ 
{\bf case = }{\it{loop-mg\/}} \\ 
{\bf $\;\;$then }{\rm{remove-leave}}\,({\rm{mg-meaning-r}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning-r}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r})\index{remove-leave} \\ 
{\bf case = }{\it{if-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\bf if }{\rm{mg-expression-falsep}}\,({\rm{if-condition}}\,({\it{stmt\/}})\index{if-condition}, {\it{mg-state\/}})\index{mg-expression-falsep} \\ 
{\bf then }{\rm{mg-meaning-r}}\,(\=\+{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r} \\ 
{\bf else }{\rm{mg-meaning-r}}\,(\=\+{\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r}$\;${\bf  endif}\- \\ 
{\bf case = }{\it{begin-mg\/}} \\ 
{\bf $\;\;$then }\=\+{\bf if }\=\+{\rm{cc}}\,({\rm{mg-meaning-r}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r})\index{cc} \\ 
$\in$$\;\;\;\;${\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels}\- \\ 
{\bf then }{\rm{mg-meaning-r}}\,(\=\+{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{set-condition}}\,(\=\+{\rm{mg-meaning-r}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r}, \\ 
{\tt{'}}{\tt{normal}})\-\index{set-condition}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r} \\ 
{\bf else }{\rm{mg-meaning-r}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes\/}})\-\index{mg-meaning-r}$\;${\bf  endif}\- \\ 
{\bf case = }{\it{proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{map-call-effects}}\,(\=\+{\rm{mg-meaning-r}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\rm{list}}\,(\=\+\=\+{\rm{t-size}}\,({\it{sizes\/}})\index{t-size} \\ 
$+$$\;\;\;\;${\rm{data-length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{data-length}\-, \\ 
\=\+{\rm{c-size}}\,({\it{sizes\/}})\index{c-size} \\ 
$+$$\;\;\;\;$(\=\+{\tt{2}} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{length} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals})\index{length})\-\-)\-)\-\index{mg-meaning-r}, \\ 
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def}, \\ 
{\it{stmt\/}}, \\ 
{\it{mg-state\/}})\-\index{map-call-effects} \\ 
{\bf case = }{\it{predefined-proc-call-mg\/}} \\ 
{\bf $\;\;$then }{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call} \\ 
{\bf otherwise }{\it{mg-state\/}}$\;${\bf  endcase}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-resource-errorp \\ \index{map-call-effects-preserves-reso!urce-errorp}
\=\+{\rm{resource-errorp}}\,({\it{new-state\/}})\index{resource-errorp} \\ 
$\rightarrow$$\;\;\;\;${\rm{resource-errorp}}\,({\rm{map-call-effects}}\,({\it{new-state\/}}, {\it{def\/}}, {\it{stmt\/}}, {\it{old-state\/}})\index{map-call-effects})\index{resource-errorp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-mg-psw \\ \index{map-call-effects-preserves-mg-p!sw}
\=\+{\rm{mg-psw}}\,({\rm{map-call-effects}}\,({\it{new-state\/}}, {\it{def\/}}, {\it{stmt\/}}, {\it{old-state\/}})\index{map-call-effects})\index{mg-psw} \\ 
$=$$\;\;\;\;${\rm{mg-psw}}\,({\it{new-state\/}})\index{mg-psw}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-predefined-proc-call-preserves-resource-error \\ \index{mg-meaning-predefined-proc-call!-preserves-resource-error}
{\rm{mg-psw}}\,({\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call})\index{mg-psw} $=$ {\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  resource-errors-propogate \\ \index{resource-errors-propogate}
\=\+{\rm{resource-errorp}}\,({\it{mg-state\/}})\index{resource-errorp} \\ 
$\rightarrow$$\;\;\;\;${\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r})\index{resource-errorp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  resource-errors-propogate2 \\ \index{resource-errors-propogate2}
\=\+({\rm{mg-psw}}\,({\it{mg-state\/}})\index{mg-psw} $\not=$ {\tt{'}}{\tt{run}}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{mg-psw}}\,({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r})\index{mg-psw} $\not=$ {\tt{'}}{\tt{run}})\-
\end{tabbing}

\begin{verbatim};; This lemma shows that in the absence of resource errors, the two interpreters
;; are equivalent.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  mg-meaning-equivalence \\ \index{mg-meaning-equivalence}
\=\+($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r})\index{resource-errorp}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r} \\ 
$=$$\;\;\;\;${\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  lessp-preserves-difference-lessp \\ \index{lessp-preserves-difference-lessp}
\=\+(({\it{y\/}} $<$ ({\it{a\/}} $-$ {\it{t-size1\/}})) $\wedge$ ({\it{t-size1\/}} $\not<$ {\it{t-size2\/}})) \\ 
$\rightarrow$$\;\;\;\;$(({\it{y\/}} $<$ ({\it{a\/}} $-$ {\it{t-size2\/}})) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-resource-errorp2 \\ \index{map-call-effects-preserves-reso!urce-errorp2}
\=\+{\rm{resource-errorp}}\,({\rm{map-call-effects}}\,({\it{new-state\/}}, {\it{stmt\/}}, {\it{def\/}}, {\it{old-state\/}})\index{map-call-effects})\index{resource-errorp} \\ 
$=$$\;\;\;\;${\rm{resource-errorp}}\,({\it{new-state\/}})\index{resource-errorp}\-
\end{tabbing}

\begin{verbatim};; KEY POINT, t-size and c-size are the amount used, not the amount left

\end{verbatim}\begin{tabbing}{\sc Theorem}:  more-resources-preserves-resources-adequatep2 \\ \index{more-resources-preserves-resour!ces-adequatep2}
\=\+(\=\+({\rm{t-size}}\,({\it{sizes1\/}})\index{t-size} $\not<$ {\rm{t-size}}\,({\it{sizes2\/}})\index{t-size}) \\ 
$\wedge$$\;\;\;\;$({\rm{c-size}}\,({\it{sizes1\/}})\index{c-size} $\not<$ {\rm{c-size}}\,({\it{sizes2\/}})\index{c-size}) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{resources-inadequatep}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{sizes1\/}})\index{resources-inadequatep}))\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{resources-inadequatep}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{sizes2\/}})\index{resources-inadequatep} $=$ {\bf{f}})\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-equivalence.

\addvspace{18pt}

\begin{tabbing}{\sc Definition}:\index{meaning-induction-hint0} \\  
\=\+{\rm{meaning-induction-hint0}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes1\/}}, {\it{sizes2\/}})\index{meaning-induction-hint0} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\rm{resources-inadequatep}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{sizes1\/}})\index{resources-inadequatep}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }$\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\tt{'}}{\tt{no-op-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\tt{'}}{\tt{signal-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\tt{'}}{\tt{prog2-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint0}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint0}}\,(\=\+{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning-r}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}})\-\index{mg-meaning-r}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0}\- \\ 
{\bf elseif }{\tt{'}}{\tt{loop-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint0}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint0}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning-r}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}})\-\index{mg-meaning-r}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0}\- \\ 
{\bf elseif }{\tt{'}}{\tt{if-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint0}}\,(\=\+{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint0}}\,(\=\+{\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0}\- \\ 
{\bf elseif }{\tt{'}}{\tt{begin-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint0}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint0}}\,(\=\+{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{set-condition}}\,(\=\+{\rm{mg-meaning-r}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}})\-\index{mg-meaning-r}, \\ 
{\tt{'}}{\tt{normal}})\-\index{set-condition}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{sizes1\/}}, \\ 
{\it{sizes2\/}})\-\index{meaning-induction-hint0}\- \\ 
{\bf elseif }{\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }{\rm{meaning-induction-hint0}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\rm{list}}\,(\=\+\=\+{\rm{t-size}}\,({\it{sizes1\/}})\index{t-size} \\ 
$+$$\;\;\;\;${\rm{data-length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{data-length}\-, \\ 
\=\+{\rm{c-size}}\,({\it{sizes1\/}})\index{c-size} \\ 
$+$$\;\;\;\;$(\=\+{\tt{2}} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{length} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals})\index{length})\-\-)\-, \\ 
{\rm{list}}\,(\=\+\=\+{\rm{t-size}}\,({\it{sizes2\/}})\index{t-size} \\ 
$+$$\;\;\;\;${\rm{data-length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{data-length}\-, \\ 
\=\+{\rm{c-size}}\,({\it{sizes2\/}})\index{c-size} \\ 
$+$$\;\;\;\;$(\=\+{\tt{2}} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-locals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-locals})\index{length} \\ 
$+$$\;\;\;\;${\rm{length}}\,({\rm{def-formals}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-formals})\index{length})\-\-)\-)\-\index{meaning-induction-hint0} \\ 
{\bf elseif }{\tt{'}}{\tt{predefined-proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-equivalence3 \\ \index{mg-meaning-equivalence3}
\=\+(\=\+($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes1\/}})\index{mg-meaning-r})\index{resource-errorp}) \\ 
$\wedge$$\;\;\;\;$({\rm{t-size}}\,({\it{sizes1\/}})\index{t-size} $\not<$ {\rm{t-size}}\,({\it{sizes2\/}})\index{t-size}) \\ 
$\wedge$$\;\;\;\;$({\rm{c-size}}\,({\it{sizes1\/}})\index{c-size} $\not<$ {\rm{c-size}}\,({\it{sizes2\/}})\index{c-size}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes1\/}})\index{mg-meaning-r} \\ 
$=$$\;\;\;\;${\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes2\/}})\index{mg-meaning-r})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-equivalence3.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-meaning-equivalence4 \\ \index{mg-meaning-equivalence4}
\=\+(\=\+($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes1\/}})\index{mg-meaning-r})\index{resource-errorp}) \\ 
$\wedge$$\;\;\;\;$({\rm{t-size}}\,({\it{sizes1\/}})\index{t-size} $\not<$ {\rm{t-size}}\,({\it{sizes2\/}})\index{t-size}) \\ 
$\wedge$$\;\;\;\;$({\rm{c-size}}\,({\it{sizes1\/}})\index{c-size} $\not<$ {\rm{c-size}}\,({\it{sizes2\/}})\index{c-size}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes2\/}})\index{mg-meaning-r} \\ 
$=$$\;\;\;\;${\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes1\/}})\index{mg-meaning-r})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-equivalence4.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  more-resources-preserves-not-resource-errorp0 \\ \index{more-resources-preserves-not-re!source-errorp0}
\=\+(\=\+({\it{t-size1\/}} $\not<$ {\it{t-size2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{c-size1\/}} $\not<$ {\it{c-size2\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}}, \\ 
{\rm{list}}\,({\it{t-size2\/}}, {\it{c-size2\/}}))\-\index{mg-meaning-r})\index{resource-errorp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}}, \\ 
{\rm{list}}\,({\it{t-size1\/}}, {\it{c-size1\/}}))\-\index{mg-meaning-r})\index{resource-errorp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  more-resources-preserves-not-resource-errorp \\ \index{more-resources-preserves-not-re!source-errorp}
\=\+(\=\+({\it{t-size1\/}} $\not<$ {\it{t-size2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{c-size1\/}} $\not<$ {\it{c-size2\/}}) \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}}, \\ 
{\rm{list}}\,({\it{t-size1\/}}, {\it{c-size1\/}}))\-\index{mg-meaning-r})\index{resource-errorp}))\- \\ 
$\rightarrow$$\;\;\;\;$($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}}, \\ 
{\rm{list}}\,({\it{t-size2\/}}, {\it{c-size2\/}}))\-\index{mg-meaning-r})\index{resource-errorp})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-equivalence2 \\ \index{mg-meaning-equivalence2}
\=\+(\=\+($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}}, \\ 
{\rm{list}}\,({\it{t-size1\/}}, {\it{c-size1\/}}))\-\index{mg-meaning-r})\index{resource-errorp}) \\ 
$\wedge$$\;\;\;\;$({\it{t-size1\/}} $\not<$ {\it{t-size2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{c-size1\/}} $\not<$ {\it{c-size2\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\rm{list}}\,({\it{t-size2\/}}, {\it{c-size2\/}}))\index{mg-meaning-r} \\ 
$=$$\;\;\;\;${\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-meaning-r-resource-error-equivalence \\ \index{mg-meaning-mg-meaning-r-resource!-error-equivalence}
\=\+($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r})\index{resource-errorp}) \\ 
$\rightarrow$$\;\;\;\;$($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\index{resource-errorp})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  zerop-n-mg-meaning \\ \index{zerop-n-mg-meaning}
\=\+({\it{n\/}} $\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning} \\ 
$=$$\;\;\;\;${\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{timed-out}})\index{signal-system-error})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-normal-mg-meaning \\ \index{not-normal-mg-meaning}
\=\+(({\it{n\/}} $\not\simeq {\tt{0}}$) $\wedge$ ($\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning} $=$ {\it{mg-state\/}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  proc-call-meaning-2 \\ \index{proc-call-meaning-2}
\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{proc-call-mg}}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{timed-out}})\index{signal-system-error} \\ 
{\bf elseif }$\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal}$\;\;${\bf then }{\it{mg-state\/}} \\ 
{\bf else }{\rm{map-call-effects}}\,(\=\+{\rm{mg-meaning}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def}, \\ 
{\it{stmt\/}}, \\ 
{\it{mg-state\/}})\-\index{map-call-effects}$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{verbatim};; The versions for mg-meaning-r

\end{verbatim}\begin{tabbing}{\sc Theorem}:  zerop-n-mg-meaning-r \\ \index{zerop-n-mg-meaning-r}
\=\+({\it{n\/}} $\simeq {\tt{0}}$) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r} \\ 
$=$$\;\;\;\;${\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{timed-out}})\index{signal-system-error})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  not-normal-mg-meaning-r \\ \index{not-normal-mg-meaning-r}
\=\+(({\it{n\/}} $\not\simeq {\tt{0}}$) $\wedge$ ($\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal})) \\ 
$\rightarrow$$\;\;\;\;$({\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r} $=$ {\it{mg-state\/}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  resources-inadequatep-mg-meaning-r \\ \index{resources-inadequatep-mg-meanin!g-r}
\=\+(\=\+({\it{n\/}} $\not\simeq {\tt{0}}$) \\ 
$\wedge$$\;\;\;\;${\rm{normal}}\,({\it{mg-state\/}})\index{normal} \\ 
$\wedge$$\;\;\;\;${\rm{resources-inadequatep}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{sizes\/}})\index{resources-inadequatep})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{mg-meaning-r}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{sizes\/}})\index{mg-meaning-r} \\ 
$=$$\;\;\;\;${\rm{signal-system-error}}\,({\it{mg-state\/}}, {\tt{'}}{\tt{resource-error}})\index{signal-system-error})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-r.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  call-cond-lists-lengths-match \\ \index{call-cond-lists-lengths-match}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{length}}\,({\rm{def-conds}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-conds})\index{length} \\ 
$=$$\;\;\;\;${\rm{length}}\,({\rm{call-conds}}\,({\it{stmt\/}})\index{call-conds})\index{length})\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable call-cond-lists-lengths-match.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-mg-alistp \\ \index{set-alist-value-preserves-mg-ali!stp}
\=\+({\rm{mg-alistp}}\,({\it{alist\/}})\index{mg-alistp} $\wedge$ {\rm{ok-mg-valuep}}\,({\it{val\/}}, {\rm{cadr}}\,({\rm{assoc}}\,({\it{name\/}}, {\it{alist\/}})))\index{ok-mg-valuep}) \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{set-alist-value}}\,({\it{name\/}}, {\it{val\/}}, {\it{alist\/}})\index{set-alist-value})\index{mg-alistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-alistps-append \\ \index{mg-alistps-append}
({\rm{mg-alistp}}\,({\it{lst1\/}})\index{mg-alistp} $\wedge$ {\rm{mg-alistp}}\,({\it{lst2\/}})\index{mg-alistp}) $\rightarrow$ {\rm{mg-alistp}}\,({\rm{append}}\,({\it{lst1\/}}, {\it{lst2\/}}))\index{mg-alistp}
\end{tabbing}

\begin{verbatim};; The recognizer has a structure called the name-alist of the following
;; form:
;;        (... (namei typei other-stuff) ...) 
;; This allows the identification of the types of variables.  It should be
;; the case that the values of the variables in the meaning alist correspond
;; to their types on the name-alist.

;; This says that a variable on the name-alist has the same name and type as
;; on the variable alist.  I need to know this to guarantee that the checks for
;; legality are visible in the execution world.

;; The only time a name-alist is ever created in the recognizer is from the formal
;; and locals lists.  There is really no reason why the same structure couldn't
;; be adhered to in the interpreter.  That is, the order of the variables could
;; be maintained.  >> Where would the initial values of the variables come from
;; in that case?
;; I could have an initial alist which serves both as the name-alist and var-alist
;; for the execution of the stmt.  That is, the initial alist only has to be an 
;; assignment of values to the vars which is consistent with the types.

;; Notice that this checks a very strong correspondence between the two alists.
;; Each element agrees in name and type.  The idea here is that the name and var
;; alists are really identical except that some values have been added on the 
;; var alists.  

;; Notice that this correspondence really defines an equivalence relation.  I
;; don't know that I'll need the full power of this.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-get-m-type \\ \index{signatures-match-preserves-get-!m-type}
\=\+{\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} \\ 
$\rightarrow$$\;\;\;\;$({\rm{cadr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{alist1\/}})) $=$ {\rm{cadr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{alist2\/}})))\-
\end{tabbing}


\noindent{\sc Event}:   Disable signatures-match-preserves-get-m-type.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-definedp \\ \index{signatures-match-preserves-defi!nedp}
\=\+{\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} \\ 
$\rightarrow$$\;\;\;\;$({\rm{definedp}}\,({\it{x\/}}, {\it{alist1\/}})\index{definedp} $=$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist2\/}})\index{definedp})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-ok-actual-params-list \\ \index{signatures-match-preserves-ok-a!ctual-params-list}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{ok-actual-params-list}}\,({\it{lst\/}}, {\it{alist1\/}})\index{ok-actual-params-list}) \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-actual-params-list}}\,({\it{lst\/}}, {\it{alist2\/}})\index{ok-actual-params-list}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  set-alist-value-preserves-plistp \\ \index{set-alist-value-preserves-plistp}
{\rm{plistp}}\,({\it{lst\/}})\index{plistp} $\rightarrow$ {\rm{plistp}}\,({\rm{set-alist-value}}\,({\it{name\/}}, {\it{val\/}}, {\it{lst\/}})\index{set-alist-value})\index{plistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-boolean-identifierp \\ \index{signatures-match-preserves-boole!an-identifierp}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{boolean-identifierp}}\,({\it{b\/}}, {\it{alist1\/}})\index{boolean-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{boolean-identifierp}}\,({\it{b\/}}, {\it{alist2\/}})\index{boolean-identifierp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable signatures-match-preserves-boolean-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-int-identifierp \\ \index{signatures-match-preserves-int-i!dentifierp}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{int-identifierp}}\,({\it{x\/}}, {\it{alist1\/}})\index{int-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{int-identifierp}}\,({\it{x\/}}, {\it{alist2\/}})\index{int-identifierp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable signatures-match-preserves-int-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-character-identifierp \\ \index{signatures-match-preserves-char!acter-identifierp}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{character-identifierp}}\,({\it{x\/}}, {\it{alist1\/}})\index{character-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{character-identifierp}}\,({\it{x\/}}, {\it{alist2\/}})\index{character-identifierp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable signatures-match-preserves-character-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-array-identifierp \\ \index{signatures-match-preserves-arra!y-identifierp}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{array-identifierp}}\,({\it{x\/}}, {\it{alist1\/}})\index{array-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{array-identifierp}}\,({\it{x\/}}, {\it{alist2\/}})\index{array-identifierp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable signatures-match-preserves-array-identifierp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-simple-identifierp \\ \index{signatures-match-preserves-simp!le-identifierp}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{simple-identifierp}}\,({\it{x\/}}, {\it{alist1\/}})\index{simple-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-identifierp}}\,({\it{x\/}}, {\it{alist2\/}})\index{simple-identifierp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-simple-typed-identifierp \\ \index{signatures-match-preserves-simp!le-typed-identifierp}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{simple-typed-identifierp}}\,({\it{x\/}}, {\it{type\/}}, {\it{alist1\/}})\index{simple-typed-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-typed-identifierp}}\,({\it{x\/}}, {\it{type\/}}, {\it{alist2\/}})\index{simple-typed-identifierp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-data-param-lists-match \\ \index{signatures-match-preserves-data!-param-lists-match}
\=\+(\=\+{\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{alist1\/}})\index{data-param-lists-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{alist2\/}})\index{data-param-lists-match}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-ok-predefined-proc-args \\ \index{signatures-match-preserves-ok-p!redefined-proc-args}
\=\+(\=\+{\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-predefined-proc-args}}\,({\it{name\/}}, {\it{actuals\/}}, {\it{alist1\/}})\index{ok-predefined-proc-args})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-predefined-proc-args}}\,({\it{name\/}}, {\it{actuals\/}}, {\it{alist2\/}})\index{ok-predefined-proc-args}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-ok-predefined-proc-call \\ \index{signatures-match-preserves-ok-p!redefined-proc-call}
\=\+({\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} $\wedge$ {\rm{ok-predefined-proc-call}}\,({\it{stmt\/}}, {\it{alist1\/}})\index{ok-predefined-proc-call}) \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-predefined-proc-call}}\,({\it{stmt\/}}, {\it{alist2\/}})\index{ok-predefined-proc-call}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-ok-mg-statement \\ \index{signatures-match-preserves-ok-m!g-statement}
\=\+(\=\+{\rm{signatures-match}}\,({\it{alist1\/}}, {\it{alist2\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist1\/}}, {\it{proc-list\/}})\index{ok-mg-statement})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{alist2\/}}, {\it{proc-list\/}})\index{ok-mg-statement}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-predefined-proc-call-preserves-signatures-match \\ \index{mg-meaning-predefined-proc-call!-preserves-signatures-match}
\=\+{\rm{plistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{plistp} \\ 
$\rightarrow$$\;\;\;\;${\rm{signatures-match}}\,(\=\+{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, \\ 
{\rm{mg-alist}}\,({\rm{mg-meaning-predefined-proc-call}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{mg-state\/}})\-\index{mg-meaning-predefined-proc-call})\index{mg-alist})\-\index{signatures-match}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  copy-out-params-preserves-signatures-match \\ \index{copy-out-params-preserves-signat!ures-match}
{\rm{plistp}}\,({\it{v\/}})\index{plistp} $\rightarrow$ {\rm{signatures-match}}\,({\it{v\/}}, {\rm{copy-out-params}}\,({\it{x\/}}, {\it{y\/}}, {\it{z\/}}, {\it{v\/}})\index{copy-out-params})\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  signatures-match-preserves-plistp \\ \index{signatures-match-preserves-plistp}
({\rm{plistp}}\,({\it{x\/}})\index{plistp} $\wedge$ {\rm{signatures-match}}\,({\it{x\/}}, {\it{y\/}})\index{signatures-match}) $\rightarrow$ {\rm{plistp}}\,({\it{y\/}})\index{plistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-preserves-signatures-match \\ \index{mg-meaning-preserves-signatures!-match}
\=\+{\rm{plistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{plistp} \\ 
$\rightarrow$$\;\;\;\;${\rm{signatures-match}}\,(\=\+{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, \\ 
{\rm{mg-alist}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\index{mg-alist})\-\index{signatures-match}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cadr-litatom-implies-definedp \\ \index{cadr-litatom-implies-definedp}
({\rm{cadr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{alist\/}})) $\not=$ {\tt{0}}) $\rightarrow$ {\rm{definedp}}\,({\it{x\/}}, {\it{alist\/}})\index{definedp}
\end{tabbing}


\noindent{\sc Event}:   Disable cadr-litatom-implies-definedp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  call-param-alist-mg-alistp \\ \index{call-param-alist-mg-alistp}
\=\+(\=\+{\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-formal-data-params-plistp}}\,({\it{formals\/}})\index{ok-mg-formal-data-params-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{name-alist\/}})\index{data-param-lists-match} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\it{mg-alist\/}}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{mg-alist\/}})\index{make-call-param-alist})\index{mg-alistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-locals-alist-mg-alistp \\ \index{call-locals-alist-mg-alistp}
{\rm{ok-mg-local-data-plistp}}\,({\it{locals-list\/}})\index{ok-mg-local-data-plistp} $\rightarrow$ {\rm{mg-alistp}}\,({\it{locals-list\/}})\index{mg-alistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  make-call-var-alist-mg-alistp \\ \index{make-call-var-alist-mg-alistp}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\it{mg-alist\/}}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{make-call-var-alist}}\,(\=\+{\it{mg-alist\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\-\index{make-call-var-alist})\index{mg-alistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-mg-statep-preserved-call-case \\ \index{ok-mg-statep-preserved-call-case}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\rm{make-cond-list}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{make-cond-list})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-formal-signatures-match \\ \index{call-formal-signatures-match}
{\rm{signatures-match}}\,(\=\+{\rm{make-alist-from-formals}}\,({\it{formals\/}})\index{make-alist-from-formals}, \\ 
{\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{mg-alist\/}})\index{make-call-param-alist})\-\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-formal-signatures-match2 \\ \index{call-formal-signatures-match2}
{\rm{signatures-match}}\,(\=\+{\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{mg-alist\/}})\index{make-call-param-alist}, \\ 
{\rm{make-alist-from-formals}}\,({\it{formals\/}})\index{make-alist-from-formals})\-\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-local-signatures-match \\ \index{call-local-signatures-match}
{\rm{plistp}}\,({\it{locals\/}})\index{plistp} $\rightarrow$ {\rm{signatures-match}}\,({\rm{make-alist-from-formals}}\,({\it{locals\/}})\index{make-alist-from-formals}, {\it{locals\/}})\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-local-signatures-match2 \\ \index{call-local-signatures-match2}
{\rm{signatures-match}}\,({\it{locals\/}}, {\rm{make-alist-from-formals}}\,({\it{locals\/}})\index{make-alist-from-formals})\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-signatures-match1 \\ \index{call-signatures-match1}
\=\+{\rm{plistp}}\,({\rm{def-locals}}\,({\it{def\/}})\index{def-locals})\index{plistp} \\ 
$\rightarrow$$\;\;\;\;${\rm{signatures-match}}\,(\=\+{\rm{make-name-alist}}\,({\it{def\/}})\index{make-name-alist}, \\ 
{\rm{make-call-var-alist}}\,({\it{mg-alist\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-var-alist})\-\index{signatures-match}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-signatures-match2 \\ \index{call-signatures-match2}
{\rm{signatures-match}}\,({\rm{make-call-var-alist}}\,({\it{mg-alist\/}}, {\it{stmt\/}}, {\it{def\/}})\index{make-call-var-alist}, {\rm{make-name-alist}}\,({\it{def\/}})\index{make-name-alist})\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  call-signatures-match3 \\ \index{call-signatures-match3}
{\rm{signatures-match}}\,(\=\+{\rm{mg-alist}}\,({\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment})\index{mg-alist}, \\ 
{\rm{make-name-alist}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{make-name-alist})\-\index{signatures-match}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{formal-types-preserved} \\  
\=\+{\rm{formal-types-preserved}}\,({\it{formals\/}}, {\it{alist\/}})\index{formal-types-preserved} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{formals\/}} $\simeq\;${{\bf{nil}}}${}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }\=\+{\rm{definedp}}\,({\rm{caar}}\,({\it{formals\/}}), {\it{alist\/}})\index{definedp} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{cadar}}\,({\it{formals\/}}) \\ 
$=$$\;\;\;\;${\rm{cadr}}\,({\rm{assoc}}\,({\rm{caar}}\,({\it{formals\/}}), {\it{alist\/}})))\- \\ 
$\wedge$$\;\;\;\;${\rm{formal-types-preserved}}\,({\rm{cdr}}\,({\it{formals\/}}), {\it{alist\/}})\index{formal-types-preserved}\-$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  formal-types-preserved-append \\ \index{formal-types-preserved-append}
\=\+{\rm{formal-types-preserved}}\,({\it{formals\/}}, {\it{lst1\/}})\index{formal-types-preserved} \\ 
$\rightarrow$$\;\;\;\;${\rm{formal-types-preserved}}\,({\it{formals\/}}, {\rm{append}}\,({\it{lst1\/}}, {\it{lst2\/}}))\index{formal-types-preserved}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  formal-types-unaffected-by-extra-binding \\ \index{formal-types-unaffected-by-extr!a-binding}
\=\+({\rm{car}}\,({\it{x\/}}) $\not\in$ {\rm{listcars}}\,({\it{y\/}})\index{listcars}) \\ 
$\rightarrow$$\;\;\;\;$({\rm{formal-types-preserved}}\,({\it{y\/}}, {\rm{cons}}\,({\it{x\/}}, {\it{z\/}}))\index{formal-types-preserved} $=$ {\rm{formal-types-preserved}}\,({\it{y\/}}, {\it{z\/}})\index{formal-types-preserved})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  formal-types-preserved-in-call-param-alist \\ \index{formal-types-preserved-in-call-p!aram-alist}
\=\+(\=\+{\rm{ok-mg-formal-data-params-plistp}}\,({\it{formals\/}})\index{ok-mg-formal-data-params-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{no-duplicates}}\,({\rm{listcars}}\,({\it{formals\/}})\index{listcars})\index{no-duplicates})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{formal-types-preserved}}\,(\=\+{\it{formals\/}}, \\ 
{\rm{make-call-param-alist}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{mg-alist\/}})\index{make-call-param-alist})\-\index{formal-types-preserved}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  formal-types-preserved-in-call-environment \\ \index{formal-types-preserved-in-call-e!nvironment}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{mg-alistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{formal-types-preserved}}\,(\=\+{\rm{def-formals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-formals}, \\ 
{\rm{mg-alist}}\,({\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment})\index{mg-alist})\-\index{formal-types-preserved}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  copy-out-params-preserves-mg-alistp \\ \index{copy-out-params-preserves-mg-ali!stp}
\=\+(\=\+{\rm{mg-alistp}}\,({\it{old-alist\/}})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{mg-alistp}}\,({\it{new-alist\/}})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{formal-types-preserved}}\,({\it{formals\/}}, {\it{new-alist\/}})\index{formal-types-preserved} \\ 
$\wedge$$\;\;\;\;${\rm{data-param-lists-match}}\,({\it{actuals\/}}, {\it{formals\/}}, {\it{name-alist\/}})\index{data-param-lists-match} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\it{old-alist\/}}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-formal-data-params-plistp}}\,({\it{formals\/}})\index{ok-mg-formal-data-params-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{copy-out-params}}\,({\it{formals\/}}, {\it{actuals\/}}, {\it{new-alist\/}}, {\it{old-alist\/}})\index{copy-out-params})\index{mg-alistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  formal-types-preserved-in-matching-signatures \\ \index{formal-types-preserved-in-matchi!ng-signatures}
\=\+(\=\+{\rm{mg-name-alistp}}\,({\it{old-alist\/}})\index{mg-name-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{formal-types-preserved}}\,({\it{formals\/}}, {\it{old-alist\/}})\index{formal-types-preserved} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\it{old-alist\/}}, {\it{new-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{formal-types-preserved}}\,({\it{formals\/}}, {\it{new-alist\/}})\index{formal-types-preserved}\-
\end{tabbing}

\begin{verbatim};; This is the case needed for map-call-effects-preserves-ok-state.

\end{verbatim}\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-mg-alistp \\ \index{map-call-effects-preserves-mg-a!listp}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def}, {\it{proc-list\/}})\index{ok-mg-def} \\ 
$\wedge$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\rm{mg-meaning}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning})\index{mg-alist})\index{mg-alistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{copy-out-params}}\,(\=\+{\rm{def-formals}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-formals}, \\ 
{\rm{call-actuals}}\,({\it{stmt\/}})\index{call-actuals}, \\ 
{\rm{mg-alist}}\,({\rm{mg-meaning}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning})\index{mg-alist}, \\ 
{\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist})\-\index{copy-out-params})\index{mg-alistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  convert-condition1-membership \\ \index{convert-condition1-membership}
\=\+({\rm{length}}\,({\it{def-conds\/}})\index{length} $=$ {\rm{length}}\,({\it{call-conds\/}})\index{length}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{convert-condition1}}\,({\it{cc\/}}, {\it{def-conds\/}}, {\it{call-conds\/}})\index{convert-condition1} \\ 
$\in$$\;\;\;\;${\rm{cons}}\,({\tt{'}}{\tt{routineerror}}, {\it{call-conds\/}}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  cond-identifier-plistp-preserves-membership \\ \index{cond-identifier-plistp-preserve!s-membership}
\=\+(\=\+({\it{cc\/}} $\in$ {\it{lst1\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{cond-identifier-plistp}}\,({\it{lst1\/}}, {\it{lst2\/}})\index{cond-identifier-plistp} \\ 
$\wedge$$\;\;\;\;$({\it{cc\/}} $\not=$ {\tt{'}}{\tt{routineerror}}))\- \\ 
$\rightarrow$$\;\;\;\;$({\it{cc\/}} $\in$ {\it{lst2\/}})\-
\end{tabbing}


\noindent{\sc Event}:   Disable cond-identifier-plistp-preserves-membership.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  cons-preserves-membership \\ \index{cons-preserves-membership}
(({\it{x\/}} $\in$ {\rm{cons}}\,({\it{y\/}}, {\it{z\/}})) $\wedge$ ({\it{x\/}} $\not=$ {\it{y\/}})) $\rightarrow$ ({\it{x\/}} $\in$ {\it{z\/}})
\end{tabbing}


\noindent{\sc Event}:   Disable cons-preserves-membership.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  cond-identifier-conversion-litatom \\ \index{cond-identifier-conversion-litat!om}
\=\+(\=\+({\rm{length}}\,({\it{def-conds\/}})\index{length} $=$ {\rm{length}}\,({\it{call-conds\/}})\index{length}) \\ 
$\wedge$$\;\;\;\;${\rm{cond-identifier-plistp}}\,({\it{call-conds\/}}, {\it{cond-list\/}})\index{cond-identifier-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{litatom}}\,({\rm{convert-condition1}}\,({\it{cc\/}}, {\it{def-conds\/}}, {\it{call-conds\/}})\index{convert-condition1})\-
\end{tabbing}


\noindent{\sc Event}:   Disable cond-identifier-conversion-litatom.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  map-call-effects-preserves-ok-state \\ \index{map-call-effects-preserves-ok-st!ate}
\=\+(\=\+({\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\rm{make-cond-list}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{make-cond-list})\-\index{ok-mg-statep})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{map-call-effects}}\,(\=\+{\rm{mg-meaning}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def}, \\ 
{\it{stmt\/}}, \\ 
{\it{mg-state\/}})\-\index{map-call-effects}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-typed-literalp-ok-valuep \\ \index{simple-typed-literalp-ok-valuep}
{\rm{simple-typed-literalp}}\,({\it{exp\/}}, {\it{type\/}})\index{simple-typed-literalp} $\rightarrow$ {\rm{ok-mg-valuep}}\,({\it{exp\/}}, {\it{type\/}})\index{ok-mg-valuep}
\end{tabbing}


\noindent{\sc Event}:   Enable ok-predefined-proc-call.

\addvspace{18pt}

\noindent{\sc Event}:   Enable ok-predefined-proc-args.

\addvspace{18pt}

\noindent{\sc Event}:   Enable ok-mg-statement.

\addvspace{18pt}

\noindent{\sc Event}:   Enable simple-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Enable int-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Enable boolean-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Enable character-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Enable boolean-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Enable character-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Enable int-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable mg-bool.

\addvspace{18pt}

\noindent{\sc Event}:   Disable mg-or-bool.

\addvspace{18pt}

\noindent{\sc Event}:   Disable mg-and-bool.

\addvspace{18pt}

\noindent{\sc Event}:   Disable mg-not-bool.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  tag-length-plistp \\ \index{tag-length-plistp}
{\rm{length-plistp}}\,({\rm{tag}}\,({\it{x\/}}, {\it{y\/}})\index{tag}, {\tt{2}})\index{length-plistp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  car-tag \\ \index{car-tag}
({\rm{car}}\,({\rm{tag}}\,({\it{x\/}}, {\it{y\/}})\index{tag}) $=$ {\it{x\/}}) $\wedge$ ({\rm{cdr}}\,({\rm{tag}}\,({\it{x\/}}, {\it{y\/}})\index{tag}) $=$ {\rm{list}}\,({\it{y\/}}))
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-typed-literalp-boolean-literals \\ \index{simple-typed-literalp-boolean-lite!rals}
\=\+{\rm{simple-typed-literalp}}\,({\rm{tag}}\,({\tt{'}}{\tt{boolean-mg}}, {\tt{'}}{\tt{true-mg}})\index{tag}, {\tt{'}}{\tt{boolean-mg}})\index{simple-typed-literalp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-literalp}}\,(\=\+{\rm{tag}}\,({\tt{'}}{\tt{boolean-mg}}, {\tt{'}}{\tt{false-mg}})\index{tag}, \\ 
{\tt{'}}{\tt{boolean-mg}})\-\index{simple-typed-literalp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-typed-literalp-boolean-mg-bool \\ \index{simple-typed-literalp-boolean-m!g-bool}
{\rm{simple-typed-literalp}}\,({\rm{mg-bool}}\,({\it{x\/}})\index{mg-bool}, {\tt{'}}{\tt{boolean-mg}})\index{simple-typed-literalp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-typed-literalp-boolean-mg-bool-not \\ \index{simple-typed-literalp-boolean-m!g-bool-not}
{\rm{simple-typed-literalp}}\,({\rm{tag}}\,({\tt{'}}{\tt{boolean-mg}}, {\rm{mg-not-bool}}\,({\it{x\/}})\index{mg-not-bool})\index{tag}, {\tt{'}}{\tt{boolean-mg}})\index{simple-typed-literalp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  ok-mg-valuep-int-mg \\ \index{ok-mg-valuep-int-mg}
\=\+{\rm{ok-mg-valuep}}\,({\rm{tag}}\,({\tt{'}}{\tt{int-mg}}, {\it{x\/}})\index{tag}, {\tt{'}}{\tt{int-mg}})\index{ok-mg-valuep} \\ 
$=$$\;\;\;\;${\rm{small-integerp}}\,({\it{x\/}}, {\sc{mg-word-size}}\index{mg-word-size})\index{small-integerp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  boolean-literalp-tag-untag \\ \index{boolean-literalp-tag-untag}
{\rm{boolean-literalp}}\,({\it{x\/}})\index{boolean-literalp} $\rightarrow$ {\rm{boolean-literalp}}\,({\rm{tag}}\,({\tt{'}}{\tt{boolean-mg}}, {\rm{untag}}\,({\it{x\/}})\index{untag})\index{tag})\index{boolean-literalp}
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  boolean-identifier-boolean-literal-value \\ \index{boolean-identifier-boolean-lite!ral-value}
\=\+({\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} $\wedge$ ({\rm{cadr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{mg-alist\/}})) $=$ {\tt{'}}{\tt{boolean-mg}})) \\ 
$\rightarrow$$\;\;\;\;${\rm{boolean-literalp}}\,({\rm{caddr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{mg-alist\/}})))\index{boolean-literalp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  boolean-identifier-boolean-literalp \\ \index{boolean-identifier-boolean-lite!ralp}
\=\+(\=\+{\rm{boolean-identifierp}}\,({\it{x\/}}, {\it{name-alist\/}})\index{boolean-identifierp} \\ 
$\wedge$$\;\;\;\;${\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\it{mg-alist\/}}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{boolean-literalp}}\,({\rm{caddr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{mg-alist\/}})))\index{boolean-literalp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-simple-variable-assignment-preserves-ok-mg-statep \\ \index{mg-meaning-mg-simple-variable-a!ssignment-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-simple-variable-assignment}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-simple-constant-assignment-preserves-ok-mg-statep \\ \index{mg-meaning-mg-simple-constant-a!ssignment-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-simple-constant-assignment}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-simple-variable-eq-preserves-ok-mg-statep \\ \index{mg-meaning-mg-simple-variable-eq!-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-simple-variable-eq}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-simple-constant-eq-preserves-ok-mg-statep \\ \index{mg-meaning-mg-simple-constant-eq!-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-simple-constant-eq}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-integer-le-preserves-ok-mg-statep \\ \index{mg-meaning-mg-integer-le-preserve!s-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-integer-le}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-integer-unary-minus-preserves-ok-mg-statep \\ \index{mg-meaning-mg-integer-unary-min!us-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-integer-unary-minus}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-integer-add-preserves-ok-mg-statep \\ \index{mg-meaning-mg-integer-add-prese!rves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-integer-add}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-integer-subtract-preserves-ok-mg-statep \\ \index{mg-meaning-mg-integer-subtract-p!reserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-integer-subtract}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-boolean-or-preserves-ok-mg-statep \\ \index{mg-meaning-mg-boolean-or-preserve!s-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-boolean-or}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-boolean-and-preserves-ok-mg-statep \\ \index{mg-meaning-mg-boolean-and-prese!rves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-boolean-and}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-boolean-not-preserves-ok-mg-statep \\ \index{mg-meaning-mg-boolean-not-prese!rves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-boolean-not}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-typed-literal-list-elements \\ \index{simple-typed-literal-list-eleme!nts}
\=\+({\rm{simple-typed-literal-plistp}}\,({\it{lst\/}}, {\it{type\/}})\index{simple-typed-literal-plistp} $\wedge$ ({\it{i\/}} $<$ {\rm{length}}\,({\it{lst\/}})\index{length})) \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-typed-literalp}}\,({\rm{get}}\,({\it{i\/}}, {\it{lst\/}})\index{get}, {\it{type\/}})\index{simple-typed-literalp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  index-array-mg-alist-elementp \\ \index{index-array-mg-alist-elementp}
\=\+(\=\+{\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} \\ 
$\wedge$$\;\;\;\;${\rm{array-identifierp}}\,({\it{a\/}}, {\it{mg-alist\/}})\index{array-identifierp} \\ 
$\wedge$$\;\;\;\;$({\it{i\/}} $<$ {\rm{array-length}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})))\index{array-length}))\- \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-typed-literalp}}\,(\=\+{\rm{get}}\,({\it{i\/}}, {\rm{caddr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})))\index{get}, \\ 
{\rm{array-elemtype}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})))\index{array-elemtype})\-\index{simple-typed-literalp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  put-preserves-simple-typed-literal-plistp \\ \index{put-preserves-simple-typed-lite!ral-plistp}
\=\+(\=\+{\rm{simple-typed-literal-plistp}}\,({\it{lst\/}}, {\it{type\/}})\index{simple-typed-literal-plistp} \\ 
$\wedge$$\;\;\;\;$({\it{i\/}} $<$ {\rm{length}}\,({\it{lst\/}})\index{length}) \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-literalp}}\,({\it{val\/}}, {\it{type\/}})\index{simple-typed-literalp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-typed-literal-plistp}}\,({\rm{put}}\,({\it{val\/}}, {\it{i\/}}, {\it{lst\/}})\index{put}, {\it{type\/}})\index{simple-typed-literal-plistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-type-literal-plistp-ok-valuep \\ \index{simple-type-literal-plistp-ok-v!aluep}
\=\+(\=\+{\rm{array-mg-type-refp}}\,({\it{type\/}})\index{array-mg-type-refp} \\ 
$\wedge$$\;\;\;\;${\rm{simple-typed-literal-plistp}}\,({\it{exp\/}}, {\rm{array-elemtype}}\,({\it{type\/}})\index{array-elemtype})\index{simple-typed-literal-plistp} \\ 
$\wedge$$\;\;\;\;$({\rm{length}}\,({\it{exp\/}})\index{length} $=$ {\rm{array-length}}\,({\it{type\/}})\index{array-length}))\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-valuep}}\,({\it{exp\/}}, {\it{type\/}})\index{ok-mg-valuep}\-
\end{tabbing}
     
\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-index-array-preserves-ok-mg-statep \\ \index{mg-meaning-mg-index-array-prese!rves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-index-array}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  array-identifiers-have-array-types \\ \index{array-identifiers-have-array-type!s}
\=\+({\rm{array-identifierp}}\,({\it{x\/}}, {\it{mg-alist\/}})\index{array-identifierp} $\wedge$ {\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{array-mg-type-refp}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{mg-alist\/}})))\index{array-mg-type-refp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  array-identifiers-have-array-types2 \\ \index{array-identifiers-have-array-type!s2}
\=\+({\rm{array-identifierp}}\,({\it{a\/}}, {\it{mg-alist\/}})\index{array-identifierp} $\wedge$ {\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-typed-literal-plistp}}\,(\=\+{\rm{caddr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})), \\ 
{\rm{array-elemtype}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})))\index{array-elemtype})\-\index{simple-typed-literal-plistp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  array-identifier-lengths-match \\ \index{array-identifier-lengths-match}
\=\+({\rm{array-identifierp}}\,({\it{a\/}}, {\it{mg-alist\/}})\index{array-identifierp} $\wedge$ {\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{length}}\,({\rm{caddr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})))\index{length} \\ 
$=$$\;\;\;\;${\rm{array-length}}\,({\rm{cadr}}\,({\rm{assoc}}\,({\it{a\/}}, {\it{mg-alist\/}})))\index{array-length})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  simple-typed-identifier-has-simple-typed-literal-value \\ \index{simple-typed-identifier-has-simp!le-typed-literal-value}
\=\+({\rm{mg-alistp}}\,({\it{mg-alist\/}})\index{mg-alistp} $\wedge$ {\rm{simple-typed-identifierp}}\,({\it{x\/}}, {\it{type\/}}, {\it{mg-alist\/}})\index{simple-typed-identifierp}) \\ 
$\rightarrow$$\;\;\;\;${\rm{simple-typed-literalp}}\,({\rm{caddr}}\,({\rm{assoc}}\,({\it{x\/}}, {\it{mg-alist\/}})), {\it{type\/}})\index{simple-typed-literalp}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-mg-array-element-assignment-preserves-ok-mg-statep \\ \index{mg-meaning-mg-array-element-assi!gnment-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;$({\rm{call-name}}\,({\it{stmt\/}})\index{call-name} $=$ {\tt{'}}{\tt{mg-array-element-assignment}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  mg-meaning-predefined-proc-call-preserves-ok-mg-statep \\ \index{mg-meaning-predefined-proc-call!-preserves-ok-mg-statep}
\=\+(\=\+({\rm{car}}\,({\it{stmt\/}}) $=$ {\tt{'}}{\tt{predefined-proc-call-mg}}) \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,(\=\+{\rm{mg-meaning-predefined-proc-call}}\,({\it{stmt\/}}, {\it{mg-state\/}})\index{mg-meaning-predefined-proc-call}, \\ 
{\it{r-cond-list\/}})\-\index{ok-mg-statep}\-
\end{tabbing} 

\begin{tabbing}{\sc Theorem}:  set-condition-normal-preserves-ok-mg-statep \\ \index{set-condition-normal-preserves-!ok-mg-statep}
\=\+{\rm{ok-mg-statep}}\,({\it{state\/}}, {\it{cond-list1\/}})\index{ok-mg-statep} \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,({\rm{set-condition}}\,({\it{state\/}}, {\tt{'}}{\tt{normal}})\index{set-condition}, {\it{cond-list2\/}})\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  append-conditions-preserves-ok-mg-statep \\ \index{append-conditions-preserves-ok-!mg-statep}
\=\+({\rm{ok-mg-statep}}\,({\it{state\/}}, {\rm{append}}\,({\it{lst\/}}, {\it{lst2\/}}))\index{ok-mg-statep} $\wedge$ ({\rm{cc}}\,({\it{state\/}})\index{cc} $\not\in$ {\it{lst\/}})) \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{state\/}}, {\it{lst2\/}})\index{ok-mg-statep}\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{meaning-induction-hint} \\  
\=\+{\rm{meaning-induction-hint}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}}, {\it{name-alist\/}}, {\it{r-cond-list\/}})\index{meaning-induction-hint} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{n\/}} $\simeq {\tt{0}}$$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }$\neg$ {\rm{normal}}\,({\it{mg-state\/}})\index{normal}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\tt{'}}{\tt{no-op-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\tt{'}}{\tt{signal-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\tt{'}}{\tt{prog2-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\it{r-cond-list\/}})\-\index{meaning-induction-hint} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint}}\,(\=\+{\rm{prog2-right-branch}}\,({\it{stmt\/}})\index{prog2-right-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning}}\,(\=\+{\rm{prog2-left-branch}}\,({\it{stmt\/}})\index{prog2-left-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\it{r-cond-list\/}})\-\index{meaning-induction-hint}\- \\ 
{\bf elseif }{\tt{'}}{\tt{loop-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\rm{cons}}\,({\tt{'}}{\tt{leave}}, {\it{r-cond-list\/}}))\-\index{meaning-induction-hint} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{mg-meaning}}\,(\=\+{\rm{loop-body}}\,({\it{stmt\/}})\index{loop-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\it{r-cond-list\/}})\-\index{meaning-induction-hint}\- \\ 
{\bf elseif }{\tt{'}}{\tt{if-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint}}\,(\=\+{\rm{if-false-branch}}\,({\it{stmt\/}})\index{if-false-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\it{r-cond-list\/}})\-\index{meaning-induction-hint} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint}}\,(\=\+{\rm{if-true-branch}}\,({\it{stmt\/}})\index{if-true-branch}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\it{r-cond-list\/}})\-\index{meaning-induction-hint}\- \\ 
{\bf elseif }{\tt{'}}{\tt{begin-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }\=\+{\rm{meaning-induction-hint}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\rm{append}}\,({\rm{when-labels}}\,({\it{stmt\/}})\index{when-labels}, {\it{r-cond-list\/}}))\-\index{meaning-induction-hint} \\ 
$\wedge$$\;\;\;\;${\rm{meaning-induction-hint}}\,(\=\+{\rm{when-handler}}\,({\it{stmt\/}})\index{when-handler}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{set-condition}}\,(\=\+{\rm{mg-meaning}}\,(\=\+{\rm{begin-body}}\,({\it{stmt\/}})\index{begin-body}, \\ 
{\it{proc-list\/}}, \\ 
{\it{mg-state\/}}, \\ 
{\it{n\/}} $-\;1$)\-\index{mg-meaning}, \\ 
{\tt{'}}{\tt{normal}})\-\index{set-condition}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\it{name-alist\/}}, \\ 
{\it{r-cond-list\/}})\-\index{meaning-induction-hint}\- \\ 
{\bf elseif }{\tt{'}}{\tt{proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}}) \\ 
{\bf then }{\rm{meaning-induction-hint}}\,(\=\+{\rm{def-body}}\,({\rm{fetch-called-def}}\,({\it{stmt\/}}, {\it{proc-list\/}})\index{fetch-called-def})\index{def-body}, \\ 
{\it{proc-list\/}}, \\ 
{\rm{make-call-environment}}\,(\=\+{\it{mg-state\/}}, \\ 
{\it{stmt\/}}, \\ 
{\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\-\index{make-call-environment}, \\ 
{\it{n\/}} $-\;1$, \\ 
{\rm{make-name-alist}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{make-name-alist}, \\ 
{\rm{make-cond-list}}\,({\rm{fetch-called-def}}\,(\=\+{\it{stmt\/}}, \\ 
{\it{proc-list\/}})\-\index{fetch-called-def})\index{make-cond-list})\-\index{meaning-induction-hint} \\ 
{\bf elseif }{\tt{'}}{\tt{predefined-proc-call-mg}} $=$ {\rm{car}}\,({\it{stmt\/}})$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\bf{f}}$\;${\bf  endif}\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable ok-predefined-proc-call.

\addvspace{18pt}

\noindent{\sc Event}:   Disable ok-predefined-proc-args.

\addvspace{18pt}

\noindent{\sc Event}:   Disable ok-mg-statement.

\addvspace{18pt}

\noindent{\sc Event}:   Disable simple-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable int-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable boolean-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable character-identifierp-implies-definedp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable boolean-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable character-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable int-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable signatures-match-preserves-ok-mg-statement.

\addvspace{18pt}

\noindent{\sc Event}:   Disable signatures-match-preserves-ok-predefined-proc-call.

\addvspace{18pt}

\noindent{\sc Event}:   Disable signatures-match-preserves-ok-predefined-proc-args.

\addvspace{18pt}

\noindent{\sc Event}:   Disable signatures-match-preserves-simple-identifierp.

\addvspace{18pt}

\noindent{\sc Event}:   Disable not-member-listcars-not-assoc.

\addvspace{18pt}

\noindent{\sc Event}:   Disable ok-mg-statep.

\addvspace{18pt}

\noindent{\sc Event}:   Disable call-locals-alist-mg-alistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  removing-condition-preserves-ok-mg-statep \\ \index{removing-condition-preserves-ok!-mg-statep}
\=\+({\rm{ok-mg-statep}}\,({\it{state\/}}, {\rm{cons}}\,({\it{x\/}}, {\it{lst\/}}))\index{ok-mg-statep} $\wedge$ ({\rm{cc}}\,({\it{state\/}})\index{cc} $\not=$ {\it{x\/}})) \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,({\it{state\/}}, {\it{lst\/}})\index{ok-mg-statep}\-
\end{tabbing}


\noindent{\sc Event}:   Disable removing-condition-preserves-ok-mg-statep.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  adding-condition-preserves-ok-mg-statep \\ \index{adding-condition-preserves-ok-m!g-statep}
{\rm{ok-mg-statep}}\,({\it{state\/}}, {\it{lst2\/}})\index{ok-mg-statep} $\rightarrow$ {\rm{ok-mg-statep}}\,({\it{state\/}}, {\rm{append}}\,({\it{lst\/}}, {\it{lst2\/}}))\index{ok-mg-statep}
\end{tabbing}


\noindent{\sc Event}:   Disable adding-condition-preserves-ok-mg-statep.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-meaning-preserves-ok-mg-statep \\ \index{mg-meaning-preserves-ok-mg-statep}
\=\+(\=\+{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-mg-statep}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning}, {\it{r-cond-list\/}})\index{ok-mg-statep}\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-preserves-ok-mg-statep.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-meaning-preserves-ok-cc \\ \index{mg-meaning-preserves-ok-cc}
\=\+(\=\+{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{ok-cc}}\,({\rm{cc}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\index{cc}, {\it{r-cond-list\/}})\index{ok-cc}\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-preserves-ok-cc.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-meaning-preserves-mg-alistp \\ \index{mg-meaning-preserves-mg-alistp}
\=\+(\=\+{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{mg-alistp}}\,({\rm{mg-alist}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\index{mg-alist})\index{mg-alistp}\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-preserves-mg-alistp.

\addvspace{18pt}

\begin{tabbing}{\sc Theorem}:  mg-meaning-condition-member-cond-list1 \\ \index{mg-meaning-condition-member-con!d-list1}
\=\+(\=\+{\rm{ok-mg-statep}}\,({\it{mg-state\/}}, {\it{r-cond-list\/}})\index{ok-mg-statep} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-statement}}\,({\it{stmt\/}}, {\it{r-cond-list\/}}, {\it{name-alist\/}}, {\it{proc-list\/}})\index{ok-mg-statement} \\ 
$\wedge$$\;\;\;\;${\rm{ok-mg-def-plistp}}\,({\it{proc-list\/}})\index{ok-mg-def-plistp} \\ 
$\wedge$$\;\;\;\;${\rm{signatures-match}}\,({\rm{mg-alist}}\,({\it{mg-state\/}})\index{mg-alist}, {\it{name-alist\/}})\index{signatures-match} \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{resource-errorp}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\index{resource-errorp}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{cc}}\,({\rm{mg-meaning}}\,({\it{stmt\/}}, {\it{proc-list\/}}, {\it{mg-state\/}}, {\it{n\/}})\index{mg-meaning})\index{cc} \\ 
$\in$$\;\;\;\;${\rm{cons}}\,({\tt{'}}{\tt{normal}}, {\rm{cons}}\,({\tt{'}}{\tt{routineerror}}, {\it{r-cond-list\/}})))\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable mg-meaning-condition-member-cond-list1.

\addvspace{18pt}



\noindent{\sc Event}:   Make the library {\tt{"c3"}}.

\addvspace{18pt}

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