chiark / gitweb /
wip exclusive haspatch - fix Simple / Coherence
[topbloke-formulae.git] / simple.tex
1 \section{Simple commit}
2
3 A simple single-parent forward commit $C$ as made by git-commit.
4 \begin{gather}
5 \tag*{} C \hasparents \{ L \} \\
6 \tag*{} \patchof{C} = \patchof{L} \\
7 \tag*{} D \isin C \equiv D \isin L \lor D = C
8 \end{gather}
9 This also covers Topbloke-generated commits on plain git branches:
10 Topbloke strips the metadata when exporting.
11
12 \subsection{No Replay}
13
14 Ingredients Prevent Replay applies.  $\qed$
15
16 \subsection{Unique Base}
17 If $L, C \in \py$ then by Calculation of Ends,
18 $\pendsof{C}{\pn} = \pendsof{L}{\pn}$ so
19 $\baseof{C} = \baseof{L}$. $\qed$
20
21 \subsection{Tip Contents}
22 We need to consider only $L, C \in \py$.  From Tip Contents for $L$:
23 \[ D \isin L \equiv D \isin \baseof{L} \lor ( D \in \py \land D \le L ) \]
24 Substitute into the contents of $C$:
25 \[ D \isin C \equiv D \isin \baseof{L} \lor ( D \in \py \land D \le L )
26     \lor D = C \]
27 Since $D = C \implies D \in \py$,
28 and substituting in $\baseof{C}$, from Unique Base above, this gives:
29 \[ D \isin C \equiv D \isin \baseof{C} \lor
30     (D \in \py \land D \le L) \lor
31     (D = C \land D \in \py) \]
32 \[ \equiv D \isin \baseof{C} \lor
33    [ D \in \py \land ( D \le L \lor D = C ) ] \]
34 So by Exact Ancestors:
35 \[ D \isin C \equiv D \isin \baseof{C} \lor ( D \in \py \land D \le C
36 ) \]
37 $\qed$
38
39 \subsection{Base Acyclic}
40
41 Need to consider only $L, C \in \pn$.
42
43 For $D = C$: $D \in \pn$ so $D \not\in \py$. OK.
44
45 For $D \neq C$: $D \isin C \equiv D \isin L$, so by Base Acyclic for
46 $L$, $D \isin C \implies D \not\in \py$.
47
48 $\qed$
49
50 \subsection{Coherence and patch inclusion}
51
52 Need to consider $D \in \py$
53
54 \subsubsection{For $L \haspatch \p, D = C$:}
55
56 Ancestors of $C$:
57 $ D \le C $.
58
59 Contents of $C$:
60 $ D \isin C \equiv \ldots \lor \true \text{ so } D \haspatch C $.
61
62 \subsubsection{For $L \haspatch \p, D \neq C$:}
63 Ancestors: $ D \le C \equiv D \le L $.
64
65 Contents: $ D \isin C \equiv D \isin L \lor f $
66 so $ D \isin C \equiv D \isin L $, i.e. $ C \zhaspatch P $.
67 By $\haspatch$ for $L$, $\exists_{F \in \py} F \le L$
68 and this $F$ is also $\le C$.  So $\haspatch$.
69
70 So:
71 \[ L \haspatch \p \implies C \haspatch \p \]
72
73 \subsubsection{For $L \nothaspatch \p$:}
74
75 Firstly, $C \not\in \py$ since if it were, $L \in \py$.
76 Thus $D \neq C$.
77
78 Now by contents of $L$, $D \notin L$, so $D \notin C$.
79
80 So:
81 \[ L \nothaspatch \p \implies C \nothaspatch \p \]
82 $\qed$
83
84 \subsection{Foreign Inclusion:}
85
86 Simple Foreign Inclusion applies.  $\qed$
87
88 \subsection{Foreign Contents:}
89
90 Only relevant if $\patchof{C} = \bot$, and in that case Totally
91 Foreign Contents applies. $\qed$
92