1 \section{Traversal phase --- proofs}
3 For each operation called for by the traversal algorithms, we prove
4 that the commit generation preconditions are met.
6 \subsection{Reachability and coverage}
8 We ensure Tip Covers Reachable as follows:
11 \item We do not generate any commits $\in \py$ other than
12 during $\alg{Merge-Tip}(\py)$;
13 \item So at the start of $\alg{Merge-Tip}(\py)$,
14 $ \pendsof{\allreach}{\py} = \pendsof{\allsrcs}{\py} $
15 \item $\alg{Merge-tip}$ arranges that when it is done
16 $\tippy \ge \pendsof{\allreach}{\py}$ --- see below.
19 A corrolary is as follows:
20 \statement{Tip Covers Superior Reachable} {
21 \bigforall_{\pd \isdep \pc}
22 \tipdy \ge \pendsof{\allreachof{\pcy}}{\pdy}
25 No commits $\in \pdy$ are created other than during
26 $\alg{Merge-Tip}(\pd)$, which runs (and has thus completed)
27 before $\alg{Merge-Tip}(\pcy)$
28 So $\pendsof{\allreachof{\pcy}}{\pdy} =
29 \pendsof{\allreachof{\pdy}}{\pdy}$.
32 \subsection{Traversal Lemmas}
34 \statement{Tip Correct Contents}{
35 \tipcy \haspatch \pa E
37 \pa E = \pc \lor \pa E \isdep \pc
40 For $\pc = \pa E$, Tip Own Contents suffices.
41 For $\pc \neq \pa E$, Exclusive Tip Contents
42 gives $D \isin \tipcy \equiv D \isin \baseof{\tipcy}$
43 which by Correct Base $\equiv D \isin \tipcn$.
46 \subsection{Base Dependency Merge, Base Sibling Merge}
48 We do not prove that the preconditions are met. Instead, we check
49 them at runtime. If they turn out not to be met, we abandon
50 \alg{Merge-Base} and resort to \alg{Recreate-Base}.
52 TODO COMPLETE MERGE-BASE STUFF
54 WIP WHAT ABOUT PROVING ALL THE TRAVERSAL RESULTS
56 \subsection{Recreate Base Beginning}
58 To recap we are executing Create Base with
59 $L = \tipdy$ and $\pq = \pc$.
61 \subsubsection{Create Acyclic}
63 By Tip Correct Contents of $L$,
64 $L \haspatch \pa E \equiv \pa E = \pd \lor \pa E \isdep \pd$.
65 Now $\pd \isdirdep \pc$,
66 so by Coherence, and setting $\pa E = \pc$,
67 $L \nothaspatch \pc$. I.e. $L \nothaspatch \pq$. OK.
69 That's everything for Create Base. $\qed$
71 \subsection{Recreate Base Final Declaration}
73 \subsubsection{Base Only} $\patchof{W} = \patchof{L} = \pn$. OK.
75 \subsubsection{Unique Tips}
77 Want to prove that for any $\p \isin C$, $\tipdy$ is a suitable $T$.
81 \subsection{Tip Base Merge}
83 $L = W$, $R = \tipcn$.
87 Afterwards, $\baseof{W} = \tipcn$.
89 \subsection{Tip Source Merge}
91 In fact, we do this backwards: $L = S$, $R = W$. Since $S \in \pcy$,
92 the resulting $C \in \pcy$ and the remaining properties of the Merge
93 commit construction are symmetrical in $L$ and $R$ so this is fine.
95 By the results of Tip Base Merge, $\baseof{W} = \tipcn$.
97 By Base Ends Supreme, $\tipcn \ge \baseof{S}$ i.e.
98 $\baseof{R} \ge \baseof{L}$.
100 Either $\baseof{L} = \baseof{M}$, or we must choose a different $M$ in
101 which case $M = \baseof{S}$ will suffice.