chiark / gitweb /
merge fixes/clarifications - sort out complex case D = C
[topbloke-formulae.git] / anticommit.tex
1 \section{Anticommit}
2
3 Given $L$ which contains $\pr$ as represented by $R^+, R^-$.
4 Construct $C$ which has $\pr$ removed.
5 Used for removing a branch dependency.
6 \gathbegin
7  C \hasparents \{ L \}
8 \gathnext
9  \patchof{C} = \patchof{L}
10 \gathnext
11  \mergeof{C}{L}{R^+}{R^-}
12 \end{gather}
13
14 \subsection{Conditions}
15
16 \[ \eqn{ Ingredients }{
17 R^+ \in \pry \land R^- = \baseof{R^+}
18 }\]
19 \[ \eqn{ Into Base }{
20  L \in \pqn
21 }\]
22 \[ \eqn{ Unique Tip }{
23  \pendsof{L}{\pry} = \{ R^+ \}
24 }\]
25 \[ \eqn{ Currently Included }{
26  L \haspatch \pry
27 }\]
28
29 \subsection{Ordering of Ingredients:}
30
31 By Unique Tip, $R^+ \le L$.  By definition of $\base$, $R^- \le R^+$
32 so $R^- \le L$.  So $R^+ \le C$ and $R^- \le C$.
33 $\qed$
34
35 (Note that $R^+ \not\le R^-$, i.e. the merge base
36 is a descendant, not an ancestor, of the 2nd parent.)
37
38 \subsection{No Replay}
39
40 By $\merge$,
41 $D \isin C \implies D \isin L \lor D \isin R^- \lor D = C$.
42 So, by Ordering of Ingredients,
43 Ingredients Prevent Replay applies.  $\qed$
44
45 \subsection{Desired Contents}
46
47 \[ D \isin C \equiv [ D \notin \pry \land D \isin L ] \lor D = C \]
48 \proofstarts
49
50 \subsubsection{For $D = C$:}
51
52 Trivially $D \isin C$.  OK.
53
54 \subsubsection{For $D \neq C, D \not\le L$:}
55
56 By No Replay for $L$, $D \not\isin L$.
57 Also, by Ordering of Ingredients, $D \not\le R^-$ hence
58 $D \not\isin R^-$.  Thus $D \not\isin C$.  OK.
59
60 \subsubsection{For $D \neq C, D \le L, D \in \pry$:}
61
62 By Currently Included, $D \isin L$.
63
64 By Tip Self Inpatch for $R^+$, $D \isin R^+ \equiv D \le R^+$, but by
65 by Unique Tip, $D \le R^+ \equiv D \le L$.
66 So $D \isin R^+$.
67
68 By Base Acyclic for $R^-$, $D \not\isin R^-$.
69
70 Apply $\merge$: $D \not\isin C$.  OK.
71
72 \subsubsection{For $D \neq C, D \le L, D \notin \pry$:}
73
74 By Tip Contents for $R^+$, $D \isin R^+ \equiv D \isin R^-$.
75
76 Apply $\merge$: $D \isin C \equiv D \isin L$.  OK.
77
78 $\qed$
79
80 \subsection{Unique Base}
81
82 Into Base means that $C \in \pqn$, so Unique Base is not
83 applicable. $\qed$
84
85 \subsection{Tip Contents}
86
87 Again, not applicable. $\qed$
88
89 \subsection{Base Acyclic}
90
91 By Into Base and Base Acyclic for $L$, $D \isin L \implies D \not\in \pqy$.
92 And by Into Base $C \not\in \pqy$.
93 Now from Desired Contents, above, $D \isin C
94 \implies D \isin L \lor D = C$, which thus
95 $\implies D \not\in \pqy$.  $\qed$.
96
97 \subsection{Coherence and Patch Inclusion}
98
99 Need to consider some $D \in \py$.  By Into Base, $D \neq C$.
100
101 \subsubsection{For $\p = \pr$:}
102 By Desired Contents, above, $D \not\isin C$.
103 So $C \nothaspatch \pr$.
104
105 \subsubsection{For $\p \neq \pr$:}
106 By Desired Contents, $D \isin C \equiv D \isin L$
107 (since $D \in \py$ so $D \not\in \pry$).
108
109 If $L \nothaspatch \p$, $D \not\isin L$ so $D \not\isin C$.
110 So $L \nothaspatch \p \implies C \nothaspatch \p$.
111
112 Whereas if $L \haspatch \p$, $D \isin L \equiv D \le L$.
113 so $L \haspatch \p \implies C \haspatch \p$.
114
115 $\qed$
116
117 \subsection{Foreign Inclusion}
118
119 Consider some $D$ s.t. $\patchof{D} = \bot$.  $D \neq C$.
120 So by Desired Contents $D \isin C \equiv D \isin L$.
121 By Foreign Inclusion of $D$ in $L$, $D \isin L \equiv D \le L$.
122
123 And $D \le C \equiv D \le L$.
124 Thus $D \isin C \equiv D \le C$.
125
126 $\qed$
127
128 \subsection{Foreign Contents}
129
130 Not applicable.
131