next up previous contents
Next: c < min(k,q) Up: Naming the Nodes Previous: The Algorithm

Correctness Proof

It remains to prove that the above method produces a normalised path as its output, given that the path P1 was normalised. The proof is basically a proof by contradiction; we show that if the output path of the algorithm is not normalised, then the input path must also have not been normalised.

Given that the input is

\begin{displaymath}
P_{1} = x_{1},x_{2}, x_{3} \ldots x_{m}\end{displaymath}

The output of the algorithm is a path P2, with the properties as shown in fig. 3.3


  
Figure 3.3: Properties of P2
\begin{figure}
\begin{displaymath}
P_{2} = x_{1}, \ldots x_{p}, \ldots x_{q}, b,...
 ... )\end{displaymath}
\begin{displaymath}
b < x_{q+1}\end{displaymath}\end{figure}

Any alias for P2 is an alias for P1 with b inserted at some point. So suppose we have a P3, an alias for P1

\begin{displaymath}
P_{3} = y_{1} \ldots y_{m}\end{displaymath}

We must have $P_{3} \ge P_{1}$, as P1 is normalised. If P3 = P1, then we clearly cannot insert b at a valid point in order to decrease P3, so assume from now on that P3 > P1. This gives us:-

\begin{displaymath}
P_{1} = x_{1},x_{2},x_{3}, \ldots x_{m} \quad
P_{3} = y_{1},y_{2},y_{3}, \ldots y_{m}\end{displaymath}

\begin{displaymath}
\exists c \ge 0 \qquad \textrm{s.t.} \qquad x_{i} = y_{i}
\qquad \forall i \le c\end{displaymath}

\begin{displaymath}
\textrm{and} \qquad (
x_{c+1} < y_{c+1})\end{displaymath}

Now suppose P'3 is P3 with b inserted at some point:

\begin{displaymath}
P'_{3} = y_{1} \ldots y_{k},b,y_{k+1} \ldots y_{m}\end{displaymath}

There are now several cases to consider depending on the relative sizes of (c,k,q). For each case we aim to show P'3 > P2, and conclude that P2 must be normalised.



 
next up previous contents
Next: c < min(k,q) Up: Naming the Nodes Previous: The Algorithm
Timothy Lewis
11/12/1997