chiark / gitweb /
strategy: wip
[topbloke-formulae.git] / notation.tex
1 \stdsection{Notation}
2
3 Throughout, any free variables are implicitly universally quantified
4 at the outermost level.
5
6 \begin{basedescript}{
7 \desclabelwidth{5em}
8 \desclabelstyle{\nextlinelabel}
9 }
10 \item[ $ C \hasparents \set X $ ]
11 The parents of commit $C$ are exactly the set
12 $\set X$.
13
14 \item[ $ C \ge D $ ]
15 $C$ is a descendant of $D$ in the git commit
16 graph.  This is a partial order, namely the transitive closure of
17 $ D \in \set X $ where $ C \hasparents \set X $.
18
19 \item[ $ C \has D $ ]
20 Informally, the tree at commit $C$ contains the change
21 made in commit $D$.  Does not take account of deliberate reversions by
22 the user or reversion, rebasing or rewinding in
23 non-Topbloke-controlled branches.  For merges and Topbloke-generated
24 anticommits or re-commits, the ``change made'' is only to be thought
25 of as any conflict resolution.  This is not a partial order because it
26 is not transitive.
27
28 \item[ $ \p, \py, \pn $ ]
29 A patch $\p$ consists of two sets of commits $\pn$ and $\py$, which
30 are respectively the base and tip git branches.  $\p$ may be used
31 where the context requires a set, in which case the statement
32 is to be taken as applying to both $\py$ and $\pn$.
33 All of these sets will be disjoint by construction
34 (see Invariants, below).  Hence:
35
36 \item[ $\set A$, $\set P$, $\ldots$ ]
37 Arbitrary sets of commits.  Maybe $\set P = \p$ i.e.\ some $\py$ or $\pn$, but
38 maybe not.
39
40 \item[ $ \patchof{ C } $ ]
41 Either $\p$ s.t. $ C \in \p $, or $\bot$.
42 A function from commits to patches' sets $\p$.
43
44 \item[ $ \pancsof{C}{\set P} $ ]
45 $ \{ A \; | \; A \le C \land A \in \set P \} $
46 i.e. all the ancestors of $C$
47 which are in $\set P$.
48
49 \item[ $ \pendsof{C}{\set P} $ ]
50 $ \{ E \; | \; E \in \pancsof{C}{\set P}
51   \land \mathop{\not\exists}_{A \in \pancsof{C}{\set P}}
52   E \neq A \land E \le A \} $
53 i.e. all $\le$-maximal commits in $\pancsof{C}{\set P}$.
54
55 \item[ $ \baseof{C} $ ]
56 $ \pendsof{C}{\pn} = \{ \baseof{C} \} $ where $ C \in \py $.
57 A partial function from commits to commits.
58 See Unique Base, below.
59
60 \item[ $ C \nothaspatch \p $ ]
61 $\displaystyle \bigforall_{D \in \py} D \not\isin C $.
62 ~ Informally, $C$ has none of the contents of $\p$.
63
64 \item[ $ C \zhaspatch \p $ ]
65 $\displaystyle \bigforall_{D \in \py} D \isin C \equiv D \le C $.
66 ~ Informally, $C$ has all the reachable contents of $\p$.
67
68 \item[ $ C \haspatch \p $ ]
69 $\displaystyle C \zhaspatch \p \land \exists_{F \in \py} F \le C $.
70 ~ Informally, $C$ nontrivially has all the reachable contents of $\p$.
71
72 Note that $\zhaspatch$ and $\nothaspatch$ are neither
73 mutually exclusive nor exhaustive.
74 $\haspatch$ and $\nothaspatch$ are mutually exclusive but not
75 necessarily exhaustive.
76
77 Commits on Non-Topbloke branches are $\nothaspatch \p$ for all $\p$.  This
78 includes commits on plain git branches made by applying a Topbloke
79 patch.  If a Topbloke
80 patch is applied to a non-Topbloke branch and then bubbles back to
81 the relevant Topbloke branches, we hope that
82 if the user still cares about the Topbloke patch,
83 git's merge algorithm will DTRT when trying to re-apply the changes.
84
85 \item[ $\displaystyle \mergeof{C}{L}{M}{R} $ ]
86 The contents of a git merge result:
87
88 $\displaystyle D \isin C \equiv
89   \begin{cases}
90     (D \isin L \land D \isin R) \lor D = C : & \true \\
91     (D \not\isin L \land D \not\isin R) \land D \neq C : & \false \\
92     \text{otherwise} : & D \not\isin M
93   \end{cases}
94 $
95
96 \end{basedescript}