\documentstyle[makeidx]{article}
\makeindex
%\setlength{\oddsidemargin}{.5in}
%\setlength{\evensidemargin}{.5in}
%\setlength{\textwidth}{5.8in}
\begin{document}
%\setlength{\parindent}{0pt}
%\newcounter{bean}
%\begin{list}{\arabic{bean}.}{\usecounter{bean}\setlength{\leftmargin}{0pt}\setlength{\rightmargin}{0pt}\setlength{\listparindent}{20pt}\setlength{\parsep}{5pt}}
%\item[]

\begin{verbatim}#|

 Copyright (C) 1994 by Yuan Yu.  All Rights Reserved.

 This script is hereby placed in the public domain, and therefore unlimited
 editing and redistribution is permitted.

 NO WARRANTY

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

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

|#

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

\addvspace{18pt}
\begin{verbatim};          Proof of the Correctness of the STRSPN Function
#|
This is part of our effort to verify the Berkeley C string library.  The 
Berkeley string library is widely used as part of the Berkeley Unix OS.

This is the source code of strspn function in the Berkeley string library.

size_t
strspn(s1, s2)
	const char *s1;
	register const char *s2;
{
	register const char *p = s1, *spanp;
	register char c, sc;

	/*
	 * Skip any characters in s2, excluding the terminating \0.
	 */
cont:
	c = *p++;
	for (spanp = s2; (sc = *spanp++) != 0;)
		if (sc == c)
			goto cont;
	return (p - 1 - s1);
}

The MC68020 assembly code of the C function strspn on SUN-3 is given as 
follows.  This binary is generated by "gcc -O".

0x26e8 <strspn>:        linkw fp,#0
0x26ec <strspn+4>:      movel d2,sp@-
0x26ee <strspn+6>:      movel fp@(8),d2
0x26f2 <strspn+10>:     moveal d2,a1
0x26f4 <strspn+12>:     moveb a1@+,d1
0x26f6 <strspn+14>:     moveal fp@(12),a0
0x26fa <strspn+18>:     bra 0x2700 <strspn+24>
0x26fc <strspn+20>:     cmpb d0,d1
0x26fe <strspn+22>:     beq 0x26f4 <strspn+12>
0x2700 <strspn+24>:     moveb a0@+,d0
0x2702 <strspn+26>:     bne 0x26fc <strspn+20>
0x2704 <strspn+28>:     movel d2,d0
0x2706 <strspn+30>:     addql #1,d0
0x2708 <strspn+32>:     subl a1,d0
0x270a <strspn+34>:     negl d0
0x270c <strspn+36>:     movel fp@(-4),d2
0x2710 <strspn+40>:     unlk fp
0x2712 <strspn+42>:     rts

The machine code of the above program is:

<strspn>:      0x4e56  0x0000  0x2f02  0x242e  0x0008  0x2242  0x1219  0x206e
<strspn+16>:   0x000c  0x6004  0xb200  0x67f4  0x1018  0x66f8  0x2002  0x5280
<strspn+32>:   0x9089  0x4480  0x242e  0xfffc  0x4e5e  0x4e75

'(78      86      0       0       47      2       36      46
  0       8       34      66      18      25      32      110
  0       12      96      4       178     0       103     244
  16      24      102     248     32      2       82      128
  144     137     68      128     36      46      255     252
  78      94      78      117)
|#

; in the logic, the above program is defined by (strspn-code). 
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{strspn-code} \\  
\=\+{\sc{strspn-code}}\index{strspn-code} \\ 
$=$$\;\;\;\;${\tt{'}}{\tt{(}}\=\+{\tt{78}}{\tt{ }}{\tt{86}}{\tt{ }}{\tt{0}}{\tt{ }}{\tt{0}}{\tt{ }}{\tt{47}}{\tt{ }}{\tt{2}}{\tt{ }}{\tt{36}}{\tt{ }}{\tt{46}}{\tt{ }}{\tt{0}}{\tt{ }}{\tt{8}}{\tt{ }}{\tt{34}}{\tt{ }}{\tt{66}}{\tt{ }}{\tt{18}}{\tt{ }}{\tt{25}}{\tt{ }}{\tt{32}}{\tt{ }}{\tt{110}}{\tt{ }}{\tt{0}}{\tt{ }}{\tt{12}}{\tt{ }}{\tt{96}} \\ 
{\tt{4}}{\tt{ }}{\tt{178}}{\tt{ }}{\tt{0}}{\tt{ }}{\tt{103}}{\tt{ }}{\tt{244}}{\tt{ }}{\tt{16}}{\tt{ }}{\tt{24}}{\tt{ }}{\tt{102}}{\tt{ }}{\tt{248}}{\tt{ }}{\tt{32}}{\tt{ }}{\tt{2}}{\tt{ }}{\tt{82}}{\tt{ }}{\tt{128}}{\tt{ }}{\tt{144}}{\tt{ }}{\tt{137}}{\tt{ }}{\tt{68}} \\ 
{\tt{128}}{\tt{ }}{\tt{36}}{\tt{ }}{\tt{46}}{\tt{ }}{\tt{255}}{\tt{ }}{\tt{252}}{\tt{ }}{\tt{78}}{\tt{ }}{\tt{94}}{\tt{ }}{\tt{78}}{\tt{ }}{\tt{117}}{\tt{)}}\-\-
\end{tabbing}

\begin{verbatim}; the computation time of the program.
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{strspn-t0} \\  
\=\+{\rm{strspn-t0}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{i2\/}} $<$ {\it{n2\/}} \\ 
{\bf then }\=\+{\bf if }{\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\tt{0}}$\;\;${\bf then }{\tt{9}} \\ 
{\bf elseif }{\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\it{ch\/}}$\;\;${\bf then }{\tt{4}} \\ 
{\bf else }{\rm{splus}}\,({\tt{4}}, {\rm{strspn-t0}}\,($1\;+$ {\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0})\index{splus}$\;${\bf  endif}\- \\ 
{\bf else }{\tt{0}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{strspn-t1} \\  
{\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t1} $=$ {\rm{splus}}\,({\tt{3}}, {\rm{strspn-t0}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0})\index{splus}
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{strspn-t2} \\  
\=\+{\rm{strspn-t2}}\,({\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t2} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{i1\/}} $<$ {\it{n1\/}} \\ 
{\bf then }\=\+{\bf if }{\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strchr1} \\ 
{\bf then }{\rm{splus}}\,(\=\+{\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strspn-t1}, \\ 
{\rm{strspn-t2}}\,($1\;+$ {\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t2})\-\index{splus} \\ 
{\bf else }{\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strspn-t1}$\;${\bf  endif}\- \\ 
{\bf else }{\tt{0}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{strspn-t} \\  
{\rm{strspn-t}}\,({\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t} $=$ {\rm{splus}}\,({\tt{4}}, {\rm{strspn-t2}}\,({\tt{0}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t2})\index{splus}
\end{tabbing}

\begin{verbatim}; two induction hints.
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{strspn-induct0} \\  
\=\+{\rm{strspn-induct0}}\,({\it{s\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-induct0} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{i2\/}} $<$ {\it{n2\/}} \\ 
{\bf then }\=\+{\bf if }{\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\tt{0}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf elseif }{\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\it{ch\/}}$\;\;${\bf then }{\bf{t}} \\ 
{\bf else }{\rm{strspn-induct0}}\,(\=\+{\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn}, \\ 
{\rm{add}}\,({\tt{32}}, {\it{i2*\/}}, {\tt{1}})\index{add}, \\ 
$1\;+$ {\it{i2\/}}, \\ 
{\it{n2\/}}, \\ 
{\it{lst2\/}}, \\ 
{\it{ch\/}})\-\index{strspn-induct0}$\;${\bf  endif}\- \\ 
{\bf else }{\bf{t}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{strspn-induct1} \\  
\=\+{\rm{strspn-induct1}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-induct1} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\it{i1\/}} $<$ {\it{n1\/}} \\ 
{\bf then }\=\+{\bf if }{\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strchr1} \\ 
{\bf then }{\rm{strspn-induct1}}\,(\=\+{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strspn-t1})\index{stepn}, \\ 
{\rm{add}}\,({\tt{32}}, {\it{i1*\/}}, {\tt{1}})\index{add}, \\ 
$1\;+$ {\it{i1\/}}, \\ 
{\it{n1\/}}, \\ 
{\it{lst1\/}}, \\ 
{\it{n2\/}}, \\ 
{\it{lst2\/}})\-\index{strspn-induct1} \\ 
{\bf else }{\bf{t}}$\;${\bf  endif}\- \\ 
{\bf else }{\bf{t}}$\;${\bf  endif}\-\-
\end{tabbing}

\begin{verbatim}; the preconditions of the initial state.
\end{verbatim}\begin{tabbing}{\sc Definition}:\index{strspn-statep} \\  
\=\+{\rm{strspn-statep}}\,({\it{s\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-statep} \\ 
$=$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{s\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;${\rm{evenp}}\,({\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{evenp} \\ 
$\wedge$$\;\;\;\;${\rm{rom-addrp}}\,({\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{44}})\index{rom-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mcode-addrp}}\,({\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\sc{strspn-code}}\index{strspn-code})\index{mcode-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{8}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{20}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\it{str1\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n1\/}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mem-lst}}\,({\tt{1}}, {\it{str1\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n1\/}}, {\it{lst1\/}})\index{mem-lst} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\it{str2\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n2\/}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mem-lst}}\,({\tt{1}}, {\it{str2\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n2\/}}, {\it{lst2\/}})\index{mem-lst} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\rm{sub}}\,({\tt{32}}, {\tt{8}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp})\index{sub}, {\tt{20}}, {\it{str1\/}}, {\it{n1\/}})\index{disjoint} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\rm{sub}}\,({\tt{32}}, {\tt{8}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp})\index{sub}, {\tt{20}}, {\it{str2\/}}, {\it{n2\/}})\index{disjoint} \\ 
$\wedge$$\;\;\;\;$({\it{str1\/}} $=$ {\rm{read-mem}}\,({\rm{add}}\,({\tt{32}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp}, {\tt{4}})\index{add}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{4}})\index{read-mem}) \\ 
$\wedge$$\;\;\;\;$({\it{str2\/}} $=$ {\rm{read-mem}}\,({\rm{add}}\,({\tt{32}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp}, {\tt{8}})\index{add}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{4}})\index{read-mem}) \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\tt{0}}, {\it{n1\/}}, {\it{lst1\/}})\index{slen} $<$ {\it{n1\/}}) \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}})\index{slen} $<$ {\it{n2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{n1\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{n2\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{uint-rangep}}\,({\it{n1\/}}, {\tt{32}})\index{uint-rangep} \\ 
$\wedge$$\;\;\;\;${\rm{uint-rangep}}\,({\it{n2\/}}, {\tt{32}})\index{uint-rangep})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{strspn-s0p} \\  
\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$=$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{s\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;${\rm{evenp}}\,({\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{evenp} \\ 
$\wedge$$\;\;\;\;${\rm{rom-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{12}}, {\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{44}})\index{rom-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mcode-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{12}}, {\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\sc{strspn-code}}\index{strspn-code})\index{mcode-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{20}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\it{str1\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n1\/}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mem-lst}}\,({\tt{1}}, {\it{str1\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n1\/}}, {\it{lst1\/}})\index{mem-lst} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\it{str2\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n2\/}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mem-lst}}\,({\tt{1}}, {\it{str2\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n2\/}}, {\it{lst2\/}})\index{mem-lst} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an})\index{sub}, {\tt{20}}, {\it{str1\/}}, {\it{n1\/}})\index{disjoint} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an})\index{sub}, {\tt{20}}, {\it{str2\/}}, {\it{n2\/}})\index{disjoint} \\ 
$\wedge$$\;\;\;\;${\rm{equal*}}\,({\rm{read-an}}\,({\tt{32}}, {\tt{1}}, {\it{s\/}})\index{read-an}, {\rm{add}}\,({\tt{32}}, {\it{str1\/}}, {\it{i1*\/}})\index{add})\index{equal*} \\ 
$\wedge$$\;\;\;\;$({\it{str2\/}} $=$ {\rm{read-mem}}\,({\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}, {\tt{12}})\index{add}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{4}})\index{read-mem}) \\ 
$\wedge$$\;\;\;\;$({\it{str1\/}} $=$ {\rm{read-dn}}\,({\tt{32}}, {\tt{2}}, {\it{s\/}})\index{read-dn}) \\ 
$\wedge$$\;\;\;\;$({\it{i1*\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{nat-rangep}}\,({\it{i1*\/}}, {\tt{32}})\index{nat-rangep} \\ 
$\wedge$$\;\;\;\;$({\it{i1\/}} $=$ {\rm{nat-to-uint}}\,({\it{i1*\/}})\index{nat-to-uint}) \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}})\index{slen} $<$ {\it{n1\/}}) \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}})\index{slen} $<$ {\it{n2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{n1\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;$({\it{n2\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{uint-rangep}}\,({\it{n1\/}}, {\tt{32}})\index{uint-rangep} \\ 
$\wedge$$\;\;\;\;${\rm{uint-rangep}}\,({\it{n2\/}}, {\tt{32}})\index{uint-rangep})\-\-
\end{tabbing}

\begin{tabbing}{\sc Definition}:\index{strspn-s1-1p} \\  
\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$=$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{s\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;${\rm{evenp}}\,({\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{evenp} \\ 
$\wedge$$\;\;\;\;${\rm{rom-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{24}}, {\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{44}})\index{rom-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mcode-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{24}}, {\rm{mc-pc}}\,({\it{s\/}})\index{mc-pc})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\sc{strspn-code}}\index{strspn-code})\index{mcode-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an})\index{sub}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{20}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\it{str2\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n2\/}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mem-lst}}\,({\tt{1}}, {\it{str2\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n2\/}}, {\it{lst2\/}})\index{mem-lst} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an})\index{sub}, {\tt{20}}, {\it{str2\/}}, {\it{n2\/}})\index{disjoint} \\ 
$\wedge$$\;\;\;\;$({\it{str1\/}} $=$ {\rm{read-dn}}\,({\tt{32}}, {\tt{2}}, {\it{s\/}})\index{read-dn}) \\ 
$\wedge$$\;\;\;\;$({\it{str2\/}} $=$ {\rm{read-mem}}\,({\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}, {\tt{12}})\index{add}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\tt{4}})\index{read-mem}) \\ 
$\wedge$$\;\;\;\;$({\it{ch\/}} $=$ {\rm{uread-dn}}\,({\tt{8}}, {\tt{1}}, {\it{s\/}})\index{uread-dn}) \\ 
$\wedge$$\;\;\;\;${\rm{equal*}}\,({\rm{read-an}}\,({\tt{32}}, {\tt{1}}, {\it{s\/}})\index{read-an}, {\rm{add}}\,({\tt{32}}, {\it{str1\/}}, {\it{i1*\/}})\index{add})\index{equal*} \\ 
$\wedge$$\;\;\;\;${\rm{equal*}}\,({\rm{read-an}}\,({\tt{32}}, {\tt{0}}, {\it{s\/}})\index{read-an}, {\rm{add}}\,({\tt{32}}, {\it{str2\/}}, {\it{i2*\/}})\index{add})\index{equal*} \\ 
$\wedge$$\;\;\;\;$({\it{i1*\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{nat-rangep}}\,({\it{i1*\/}}, {\tt{32}})\index{nat-rangep} \\ 
$\wedge$$\;\;\;\;$({\it{i1\/}} $=$ {\rm{nat-to-uint}}\,({\it{i1*\/}})\index{nat-to-uint}) \\ 
$\wedge$$\;\;\;\;$({\it{i2*\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{nat-rangep}}\,({\it{i2*\/}}, {\tt{32}})\index{nat-rangep} \\ 
$\wedge$$\;\;\;\;$({\it{i2\/}} $=$ {\rm{nat-to-uint}}\,({\it{i2*\/}})\index{nat-to-uint}) \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{slen} $<$ {\it{n2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{n2\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{uint-rangep}}\,({\it{n2\/}}, {\tt{32}})\index{uint-rangep})\-\-
\end{tabbing}       

\begin{tabbing}{\sc Definition}:\index{strspn-s1p} \\  
\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$=$$\;\;\;\;$(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;${\rm{ram-addrp}}\,({\it{str1\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n1\/}})\index{ram-addrp} \\ 
$\wedge$$\;\;\;\;${\rm{mem-lst}}\,({\tt{1}}, {\it{str1\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{n1\/}}, {\it{lst1\/}})\index{mem-lst} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an})\index{sub}, {\tt{20}}, {\it{str1\/}}, {\it{n1\/}})\index{disjoint} \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}})\index{slen} $<$ {\it{n1\/}}) \\ 
$\wedge$$\;\;\;\;$({\rm{slen}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}})\index{slen} $<$ {\it{n2\/}}) \\ 
$\wedge$$\;\;\;\;$({\it{n1\/}} $\in\;${\bf{N}}${}$) \\ 
$\wedge$$\;\;\;\;${\rm{uint-rangep}}\,({\it{n1\/}}, {\tt{32}})\index{uint-rangep})\-\-
\end{tabbing}

\begin{verbatim}; from the initial state s to s0: s --> s0.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s-s0 \\ \index{strspn-s-s0}
\=\+{\rm{strspn-statep}}\,({\it{s\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-statep} \\ 
$\rightarrow$$\;\;\;\;${\rm{strspn-s0p}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn}, {\tt{0}}, {\tt{0}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s-s0-else \\ \index{strspn-s-s0-else}
\=\+{\rm{strspn-statep}}\,({\it{s\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-statep} \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\rm{linked-rts-addr}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{linked-rts-addr} $=$ {\rm{rts-addr}}\,({\it{s\/}})\index{rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{linked-a6}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{linked-a6} $=$ {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{sub}}\,({\tt{32}}, {\tt{4}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp})\index{sub})\- \\ 
$\wedge$$\;\;\;\;$({\rm{rn-saved}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{rn-saved} $=$ {\rm{read-rn}}\,({\tt{32}}, {\tt{2}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn}))\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s-s0-rfile \\ \index{strspn-s-s0-rfile}
\=\+({\rm{strspn-statep}}\,({\it{s\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-statep} $\wedge$ {\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s-s0-mem \\ \index{strspn-s-s0-mem}
\=\+(\=\+{\rm{strspn-statep}}\,({\it{s\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-statep} \\ 
$\wedge$$\;\;\;\;${\rm{disjoint}}\,({\it{x\/}}, {\it{k\/}}, {\rm{sub}}\,({\tt{32}}, {\tt{8}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp})\index{sub}, {\tt{20}})\index{disjoint})\- \\ 
$\rightarrow$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem})\-
\end{tabbing}

\begin{verbatim}; loop 0.
; from s0 to s1: s0 --> s1.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s0-s1-1 \\ \index{strspn-s0-s1-1}
\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\rightarrow$$\;\;\;\;${\rm{strspn-s1-1p}}\,(\=\+{\rm{stepn}}\,({\it{s\/}}, {\tt{3}})\index{stepn}, \\ 
{\rm{add}}\,({\tt{32}}, {\it{i1*\/}}, {\tt{1}})\index{add}, \\ 
$1\;+$ {\it{i1\/}}, \\ 
{\it{str1\/}}, \\ 
{\it{n1\/}}, \\ 
{\it{lst1\/}}, \\ 
{\tt{0}}, \\ 
{\tt{0}}, \\ 
{\it{str2\/}}, \\ 
{\it{n2\/}}, \\ 
{\it{lst2\/}}, \\ 
{\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\-\index{strspn-s1-1p}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strchr1-la \\ \index{strchr1-la}
{\rm{strchr1}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1} $\rightarrow$ ({\it{ch\/}} $\not=$ {\tt{0}})
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-s1 \\ \index{strspn-s0-s1}
\=\+(\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;${\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strchr1})\- \\ 
$\rightarrow$$\;\;\;\;${\rm{strspn-s1p}}\,(\=\+{\rm{stepn}}\,({\it{s\/}}, {\tt{3}})\index{stepn}, \\ 
{\rm{add}}\,({\tt{32}}, {\it{i1*\/}}, {\tt{1}})\index{add}, \\ 
$1\;+$ {\it{i1\/}}, \\ 
{\it{str1\/}}, \\ 
{\it{n1\/}}, \\ 
{\it{lst1\/}}, \\ 
{\tt{0}}, \\ 
{\tt{0}}, \\ 
{\it{str2\/}}, \\ 
{\it{n2\/}}, \\ 
{\it{lst2\/}}, \\ 
{\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\-\index{strspn-s1p}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-s1-else \\ \index{strspn-s0-s1-else}
\=\+{\bf let }\=\+{\it{s1\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\tt{3}})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\rightarrow$$\;\;\;\;$(\=\+(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s1\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\- \\ 
$\wedge$$\;\;\;\;$({\rm{linked-a6}}\,({\it{s1\/}})\index{linked-a6} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$({\rm{linked-rts-addr}}\,({\it{s1\/}})\index{linked-rts-addr} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{rn-saved}}\,({\it{s1\/}})\index{rn-saved} $=$ {\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s1\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem}))\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-s1-rfile \\ \index{strspn-s0-s1-rfile}
\=\+({\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} $\wedge$ {\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p}) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{3}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-\-
\end{tabbing}

\begin{verbatim}; loop 1.
; base case 1. from s1 to exit: s1 --> sn, when lst1[i] == 0.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s1-sn-base \\ \index{strspn-s1-sn-base}
\=\+(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\tt{0}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;$({\rm{mc-pc}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{mc-pc} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-dn}}\,({\tt{32}}, {\tt{0}}, {\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{read-dn} $=$ {\rm{sub}}\,({\tt{32}}, {\tt{1}}, {\it{i1*\/}})\index{sub}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{mc-rfile})\index{read-rn} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{15}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}, {\tt{8}})\index{add})\- \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{mc-mem}, {\it{k\/}})\index{read-mem} \\ 
$=$$\;\;\;\;${\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem})\-)\-\-
\end{tabbing}			  

\begin{tabbing}{\sc Theorem}:  strspn-s1-sn-rfile-base \\ \index{strspn-s1-sn-rfile-base}
\=\+(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\it{oplen\/}} $\leq$ {\tt{32}}) \\ 
$\wedge$$\;\;\;\;${\rm{d2-7a2-5p}}\,({\it{rn\/}})\index{d2-7a2-5p})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{9}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p}$\;\;${\bf then }{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn} \\ 
{\bf else }{\rm{head}}\,({\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}, {\it{oplen\/}})\index{head}$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{verbatim}; base case 2.  s1 --> s0, when lst1[i] =\= 0  and lst2[j] = ch.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s1-s0-base \\ \index{strspn-s1-s0-base}
\=\+(\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\it{ch\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{strspn-s0p}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\- \\ 
$\wedge$$\;\;\;\;$({\rm{linked-a6}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{linked-a6} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$({\rm{linked-rts-addr}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{linked-rts-addr} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-mem}, {\it{k\/}})\index{read-mem} \\ 
$=$$\;\;\;\;${\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem})\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-s0-rfile-base \\ \index{strspn-s1-s0-rfile-base}
\=\+(\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $=$ {\it{ch\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-\-
\end{tabbing}

\begin{verbatim}; induction case. s1 --> s1, when lst1[i] =\= 0 and lst2[j] =\= ch.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s1-s1-1 \\ \index{strspn-s1-s1-1}
\=\+(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\it{ch\/}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{strspn-s1-1p}}\,(\=\+{\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn}, \\ 
{\it{i1*\/}}, \\ 
{\it{i1\/}}, \\ 
{\it{str1\/}}, \\ 
{\it{n1\/}}, \\ 
{\it{lst1\/}}, \\ 
{\rm{add}}\,({\tt{32}}, {\it{i2*\/}}, {\tt{1}})\index{add}, \\ 
$1\;+$ {\it{i2\/}}, \\ 
{\it{str2\/}}, \\ 
{\it{n2\/}}, \\ 
{\it{lst2\/}}, \\ 
{\it{ch\/}})\-\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\- \\ 
$\wedge$$\;\;\;\;$({\rm{linked-a6}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{linked-a6} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$({\rm{linked-rts-addr}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{linked-rts-addr} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{rn-saved}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{rn-saved} $=$ {\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-mem}, {\it{k\/}})\index{read-mem} \\ 
$=$$\;\;\;\;${\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem})\-)\-\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-s1 \\ \index{strspn-s1-s1}
\=\+(\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\it{ch\/}}))\- \\ 
$\rightarrow$$\;\;\;\;${\rm{strspn-s1p}}\,(\=\+{\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn}, \\ 
{\it{i1*\/}}, \\ 
{\it{i1\/}}, \\ 
{\it{str1\/}}, \\ 
{\it{n1\/}}, \\ 
{\it{lst1\/}}, \\ 
{\rm{add}}\,({\tt{32}}, {\it{i2*\/}}, {\tt{1}})\index{add}, \\ 
$1\;+$ {\it{i2\/}}, \\ 
{\it{str2\/}}, \\ 
{\it{n2\/}}, \\ 
{\it{lst2\/}}, \\ 
{\it{ch\/}})\-\index{strspn-s1p}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-s1-rfile \\ \index{strspn-s1-s1-rfile}
\=\+(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\tt{0}}) \\ 
$\wedge$$\;\;\;\;$({\rm{get-nth}}\,({\it{i2\/}}, {\it{lst2\/}})\index{get-nth} $\not=$ {\it{ch\/}}) \\ 
$\wedge$$\;\;\;\;${\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\tt{4}})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-\-
\end{tabbing}

\begin{verbatim}; put together.
; case 1. s1 --> exit, when (not (strchr1 i2 n2 lst2 ch)).
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s1-1p-info \\ \index{strspn-s1-1p-info}
\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\rightarrow$$\;\;\;\;$(({\it{i2\/}} $<$ {\it{n2\/}}) $=$ {\bf{t}})\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-sn \\ \index{strspn-s1-sn}
\=\+{\bf let }\=\+{\it{sn\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t0}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{strchr1}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{sn\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;$({\rm{mc-pc}}\,({\it{sn\/}})\index{mc-pc} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-dn}}\,({\tt{32}}, {\tt{0}}, {\it{sn\/}})\index{read-dn} $=$ {\rm{sub}}\,({\tt{32}}, {\tt{1}}, {\it{i1*\/}})\index{sub}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{15}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}, {\tt{8}})\index{add})\- \\ 
$\wedge$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{sn\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem}))\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-sn-rfile \\ \index{strspn-s1-sn-rfile}
\=\+(\=\+{\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p} \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{strchr1}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1}) \\ 
$\wedge$$\;\;\;\;${\rm{d2-7a2-5p}}\,({\it{rn\/}})\index{d2-7a2-5p} \\ 
$\wedge$$\;\;\;\;$({\it{oplen\/}} $\leq$ {\tt{32}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t0}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p}$\;\;${\bf then }{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn} \\ 
{\bf else }{\rm{head}}\,({\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}, {\it{oplen\/}})\index{head}$\;${\bf  endif}\-)\-\-
\end{tabbing}


\noindent{\sc Event}:   Disable strspn-s1-1p-info.

\addvspace{18pt}

\begin{verbatim}; case 2. s1 --> s0, when (strchr1 i2 n2 lst2 ch).
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s1p-s1-1p \\ \index{strspn-s1p-s1-1p}
\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$\rightarrow$$\;\;\;\;${\rm{strspn-s1-1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1-1p}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-s0 \\ \index{strspn-s1-s0}
\=\+{\bf let }\=\+{\it{s0\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t0}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+(\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$\wedge$$\;\;\;\;${\rm{strchr1}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{strspn-s0p}}\,({\it{s0\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s0\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\- \\ 
$\wedge$$\;\;\;\;$({\rm{linked-a6}}\,({\it{s0\/}})\index{linked-a6} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$({\rm{linked-rts-addr}}\,({\it{s0\/}})\index{linked-rts-addr} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{rn-saved}}\,({\it{s0\/}})\index{rn-saved} $=$ {\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s0\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem}))\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s1-s0-rfile \\ \index{strspn-s1-s0-rfile}
\=\+(\=\+{\rm{strspn-s1p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{i2*\/}}, {\it{i2\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-s1p} \\ 
$\wedge$$\;\;\;\;${\rm{strchr1}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1} \\ 
$\wedge$$\;\;\;\;${\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t0}}\,({\it{i2\/}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t0})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-\-
\end{tabbing}

\begin{verbatim}; from s0 --> exit. s0 --> sn.
; base case:  s0 --> sn,  when (not (strchr1 i2 n2 lst2 ch)).
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s0-sn-base \\ \index{strspn-s0-sn-base}
\=\+{\bf let }\=\+{\it{sn\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strspn-t1})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+(\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strchr1}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{sn\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;$({\rm{mc-pc}}\,({\it{sn\/}})\index{mc-pc} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-dn}}\,({\tt{32}}, {\tt{0}}, {\it{sn\/}})\index{read-dn} $=$ {\rm{head}}\,({\it{i1*\/}}, {\tt{32}})\index{head}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{15}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}, {\tt{8}})\index{add})\- \\ 
$\wedge$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{sn\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem}))\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-sn-rfile-base \\ \index{strspn-s0-sn-rfile-base}
\=\+{\bf let }\=\+{\it{ch\/}}{\bf $\;$ be$\;\;$}{\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth}\- \\ 
{\bf in} \\ 
\=\+(\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;$($\neg$ {\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1}) \\ 
$\wedge$$\;\;\;\;$({\it{oplen\/}} $\leq$ {\tt{32}}) \\ 
$\wedge$$\;\;\;\;${\rm{d2-7a2-5p}}\,({\it{rn\/}})\index{d2-7a2-5p})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t1})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p}$\;\;${\bf then }{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn} \\ 
{\bf else }{\rm{head}}\,({\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}, {\it{oplen\/}})\index{head}$\;${\bf  endif}\-)\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{verbatim}; induction case: s0 --> s0,  when (strchr1 i2 n2 lst2 ch).
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s0-s0 \\ \index{strspn-s0-s0}
\=\+{\bf let }\=\+{\it{s0\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strspn-t1})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+(\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;${\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth})\index{strchr1})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{strspn-s0p}}\,({\it{s0\/}}, {\rm{add}}\,({\tt{32}}, {\it{i1*\/}}, {\tt{1}})\index{add}, $1\;+$ {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s0\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\- \\ 
$\wedge$$\;\;\;\;$({\rm{linked-a6}}\,({\it{s0\/}})\index{linked-a6} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$({\rm{linked-rts-addr}}\,({\it{s0\/}})\index{linked-rts-addr} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{rn-saved}}\,({\it{s0\/}})\index{rn-saved} $=$ {\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s0\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem}))\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-s0-rfile \\ \index{strspn-s0-s0-rfile}
\=\+{\bf let }\=\+{\it{ch\/}}{\bf $\;$ be$\;\;$}{\rm{get-nth}}\,({\it{i1\/}}, {\it{lst1\/}})\index{get-nth}\- \\ 
{\bf in} \\ 
\=\+(\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;${\rm{strchr1}}\,({\tt{0}}, {\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strchr1} \\ 
$\wedge$$\;\;\;\;${\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p})\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t1}}\,({\it{n2\/}}, {\it{lst2\/}}, {\it{ch\/}})\index{strspn-t1})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{verbatim}; put together: s0 --> sn.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-s0p-info \\ \index{strspn-s0p-info}
\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\rightarrow$$\;\;\;\;$((({\it{i1\/}} $<$ {\it{n1\/}}) $=$ {\bf{t}}) $\wedge$ ({\rm{nat-to-uint}}\,({\rm{head}}\,({\it{i1*\/}}, {\tt{32}})\index{head})\index{nat-to-uint} $=$ {\rm{fix}}\,({\it{i1\/}})))\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-sn \\ \index{strspn-s0-sn}
\=\+{\bf let }\=\+{\it{sn\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t2}}\,({\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t2})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{sn\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;$({\rm{mc-pc}}\,({\it{sn\/}})\index{mc-pc} $=$ {\rm{linked-rts-addr}}\,({\it{s\/}})\index{linked-rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{uread-dn}}\,({\tt{32}}, {\tt{0}}, {\it{sn\/}})\index{uread-dn} $=$ {\rm{strspn}}\,({\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} $=$ {\rm{linked-a6}}\,({\it{s\/}})\index{linked-a6}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{15}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}, {\tt{8}})\index{add})\- \\ 
$\wedge$$\;\;\;\;$({\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{sn\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} $=$ {\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem}))\-\-$\;${\bf  endlet}\-
\end{tabbing}

\begin{tabbing}{\sc Theorem}:  strspn-s0-sn-rfile \\ \index{strspn-s0-sn-rfile}
\=\+(\=\+{\rm{strspn-s0p}}\,({\it{s\/}}, {\it{i1*\/}}, {\it{i1\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-s0p} \\ 
$\wedge$$\;\;\;\;${\rm{d2-7a2-5p}}\,({\it{rn\/}})\index{d2-7a2-5p} \\ 
$\wedge$$\;\;\;\;$({\it{oplen\/}} $\leq$ {\tt{32}}))\- \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t2}}\,({\it{i1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t2})\index{stepn})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;$\=\+{\bf if }{\rm{d3-7a2-5p}}\,({\it{rn\/}})\index{d3-7a2-5p}$\;\;${\bf then }{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn} \\ 
{\bf else }{\rm{head}}\,({\rm{rn-saved}}\,({\it{s\/}})\index{rn-saved}, {\it{oplen\/}})\index{head}$\;${\bf  endif}\-)\-\-
\end{tabbing}

\begin{verbatim}; the correctness of strspn.
\end{verbatim}\begin{tabbing}{\sc Theorem}:  strspn-correctness \\ \index{strspn-correctness}
\=\+{\bf let }\=\+{\it{sn\/}}{\bf $\;$ be$\;\;$}{\rm{stepn}}\,({\it{s\/}}, {\rm{strspn-t}}\,({\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-t})\index{stepn}\- \\ 
{\bf in} \\ 
\=\+{\rm{strspn-statep}}\,({\it{s\/}}, {\it{str1\/}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{str2\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn-statep} \\ 
$\rightarrow$$\;\;\;\;$(\=\+({\rm{mc-status}}\,({\it{sn\/}})\index{mc-status} $=$ {\tt{'}}{\tt{running}}) \\ 
$\wedge$$\;\;\;\;$({\rm{mc-pc}}\,({\it{sn\/}})\index{mc-pc} $=$ {\rm{rts-addr}}\,({\it{s\/}})\index{rts-addr}) \\ 
$\wedge$$\;\;\;\;$({\rm{read-rn}}\,({\tt{32}}, {\tt{14}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} $=$ {\rm{read-an}}\,({\tt{32}}, {\tt{6}}, {\it{s\/}})\index{read-an}) \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\tt{32}}, {\tt{15}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{add}}\,({\tt{32}}, {\rm{read-an}}\,({\tt{32}}, {\tt{7}}, {\it{s\/}})\index{read-an}, {\tt{4}})\index{add})\- \\ 
$\wedge$$\;\;\;\;$(\=\+({\rm{d2-7a2-5p}}\,({\it{rn\/}})\index{d2-7a2-5p} $\wedge$ ({\it{oplen\/}} $\leq$ {\tt{32}})) \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{sn\/}})\index{mc-rfile})\index{read-rn} \\ 
$=$$\;\;\;\;${\rm{read-rn}}\,({\it{oplen\/}}, {\it{rn\/}}, {\rm{mc-rfile}}\,({\it{s\/}})\index{mc-rfile})\index{read-rn})\-)\- \\ 
$\wedge$$\;\;\;\;$(\=\+{\rm{disjoint}}\,({\it{x\/}}, {\it{k\/}}, {\rm{sub}}\,({\tt{32}}, {\tt{8}}, {\rm{read-sp}}\,({\it{s\/}})\index{read-sp})\index{sub}, {\tt{20}})\index{disjoint} \\ 
$\rightarrow$$\;\;\;\;$(\=\+{\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{sn\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem} \\ 
$=$$\;\;\;\;${\rm{read-mem}}\,({\it{x\/}}, {\rm{mc-mem}}\,({\it{s\/}})\index{mc-mem}, {\it{k\/}})\index{read-mem})\-)\- \\ 
$\wedge$$\;\;\;\;$({\rm{uread-dn}}\,({\tt{32}}, {\tt{0}}, {\it{sn\/}})\index{uread-dn} $=$ {\rm{strspn}}\,({\tt{0}}, {\it{n1\/}}, {\it{lst1\/}}, {\it{n2\/}}, {\it{lst2\/}})\index{strspn}))\-\-$\;${\bf  endlet}\-
\end{tabbing}


\noindent{\sc Event}:   Disable strspn-s0p-info.

\addvspace{18pt}

\noindent{\sc Event}:   Disable strspn-t.

\addvspace{18pt}

\begin{verbatim}; some properties of strspn.
; see file cstring.events\end{verbatim}
%\end{list}
\printindex
\end{document}
