chiark / gitweb /
strategy: move traversal proofs inline
[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).
35
36 \item[ $\foreign$ ]
37 The set of all commits which are not part of a Topbloke branch.  We
38 call these foreign commits.  Hence:
39
40 \item[ $ \patchof{ C } $ ]
41 Either $\p$ s.t. $ C \in \p $, or $\foreign$.
42 A function from commits to patches' sets $\p$.
43
44 \item[ $\set A$, $\set P$, $\ldots$ ]
45 Arbitrary sets of commits.  Maybe $\set P = \p$ i.e.\ some $\py$ or $\pn$, but
46 maybe not.
47
48 \item[ $ \pancsof{C}{\set P} $ ]
49 $ \{ A \; | \; A \le C \land A \in \set P \} $
50 i.e. all the ancestors of $C$
51 which are in $\set P$.
52
53 \item[ $ \pendsof{C}{\set P} $ ]
54 $ \{ E \; | \; E \in \pancsof{C}{\set P}
55   \land \mathop{\not\exists}_{A \in \pancsof{C}{\set P}}
56   E \neq A \land E \le A \} $
57 i.e. all $\le$-maximal commits in $\pancsof{C}{\set P}$.
58
59 \item[ $ \baseof{C} $ ]
60 $ \pendsof{C}{\pn} = \{ \baseof{C} \} $ where $ C \in \py $.
61 A partial function from commits to commits.
62 See Unique Base, below.
63
64 \item[ $ C \nothaspatch \p $ ]
65 $\displaystyle \bigforall_{D \in \py} D \not\isin C $.
66 ~ Informally, $C$ has none of the contents of $\p$.
67
68 \item[ $ C \zhaspatch \p $ ]
69 $\displaystyle \bigforall_{D \in \py} D \isin C \equiv D \le C $.
70 ~ Informally, $C$ has all the reachable contents of $\p$.
71
72 \item[ $ C \haspatch \p $ ]
73 $\displaystyle C \zhaspatch \p \land \exists_{F \in \py} F \le C $.
74 ~ Informally, $C$ nontrivially has all the reachable contents of $\p$.
75
76 Note that $\zhaspatch$ and $\nothaspatch$ are neither
77 mutually exclusive nor exhaustive.
78 $\haspatch$ and $\nothaspatch$ are mutually exclusive but not
79 necessarily exhaustive.
80
81 Commits on Non-Topbloke branches are $\nothaspatch \p$ for all $\p$.  This
82 includes commits on plain git branches made by applying a Topbloke
83 patch.  If a Topbloke
84 patch is applied to a non-Topbloke branch and then bubbles back to
85 the relevant Topbloke branches, we hope that
86 if the user still cares about the Topbloke patch,
87 git's merge algorithm will DTRT when trying to re-apply the changes.
88
89 \item[ $\displaystyle \stmtmergeof{L}{M}{R} $ ]
90 The proper results of a merge.  Formally,
91 where $L$, $M$ and $R$ are statements:
92 $$
93   \stmtmergeof{L}{M}{R}
94     \equiv
95   \begin{cases}
96          (L \land R)      : & \true \\
97     (\neg L \land \neg R) : & \false \\
98     \text{otherwise} : & \neg M
99   \end{cases}
100 $$
101
102 May also be used where $L$, $M$ and $R$ are sets, in which case
103 $$
104   \setmergeof{L}{M}{R}
105      =
106   \left\{
107     \;
108     D \; \middle| \;
109       \setmergeof{ D \in L }{ D \in M }{ D \in R }
110     \;
111   \right\}
112 $$
113
114 \item[ $\displaystyle \commitmergeof{C}{L}{M}{R} $ ]
115 $C$ has exactly the contents of a git merge result:
116
117 $\displaystyle D \isin C \equiv
118   \begin{cases}
119     D = C : & \true \\
120     D \neq C : & \stmtmergeof{ D \isin L }{ D \isin M }{ D \isin R }
121   \end{cases}
122 $
123
124 We will refer to this as \commitmergename.
125
126 \end{basedescript}