chiark / gitweb /
strategy: reachable is going well
[topbloke-formulae.git] / trav-proofs.tex
1 \section{Traversal phase --- proofs}
2
3 For each operation called for by the traversal algorithms, we prove
4 that the commit generation preconditions are met.
5
6 \subsection{Reachability and coverage}
7
8 We ensure Tip Covers Reachable as follows:
9
10 \begin{itemize}
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.
17 \end{itemize}
18
19 A corrolary is as follows:
20 \statement{Tip Covers Superior Reachable} {
21   \bigforall_{\pd \isdep \pc}
22     \tipdy \ge \pendsof{\allreachof{\pcy}}{\pdy}
23 }
24 \proof{
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}$.
30 }
31
32 \subsection{Traversal Lemmas}
33
34 \statement{Tip Correct Contents}{
35   \tipcy \haspatch \pa E
36     \equiv
37   \pa E = \pc \lor \pa E \isdep \pc
38 }
39 \proof{
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$.
44 }
45
46 \subsection{Base Dependency Merge, Base Sibling Merge}
47
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}.
51
52 TODO COMPLETE MERGE-BASE STUFF
53
54 WIP WHAT ABOUT PROVING ALL THE TRAVERSAL RESULTS
55
56 \subsection{Recreate Base Beginning}
57
58 To recap we are executing Create Base with
59 $L = \tipdy$ and $\pq = \pc$.
60
61 \subsubsection{Create Acyclic}
62
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.
68
69 That's everything for Create Base.  $\qed$
70
71 \subsection{Recreate Base Final Declaration}
72
73 \subsubsection{Base Only} $\patchof{W} = \patchof{L} = \pn$.  OK.
74
75 \subsubsection{Unique Tips}
76
77 Want to prove that for any $\p \isin C$, $\tipdy$ is a suitable $T$.
78
79 WIP
80
81 \subsection{Tip Base Merge}
82
83 $L = W$, $R = \tipcn$.
84
85 TODO TBD
86
87 Afterwards, $\baseof{W} = \tipcn$.
88
89 \subsection{Tip Source Merge}
90
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.
94
95 By the results of Tip Base Merge, $\baseof{W} = \tipcn$.
96
97 By Base Ends Supreme, $\tipcn \ge \baseof{S}$ i.e.
98 $\baseof{R} \ge \baseof{L}$.
99
100 Either $\baseof{L} = \baseof{M}$, or we must choose a different $M$ in
101 which case $M = \baseof{S}$ will suffice.
102