chiark / gitweb /
3512d9c5418954713d1ea10b36c82c829ce29308
[topbloke-formulae.git] / article.tex
1 \documentclass[a4paper,leqno]{strayman}
2 \let\numberwithin=\notdef
3 \usepackage{amsmath}
4 \usepackage{mathabx}
5 \usepackage{txfonts}
6 \usepackage{amsfonts}
7 \usepackage{mdwlist}
8 %\usepackage{accents}
9
10 \renewcommand{\ge}{\geqslant}
11 \renewcommand{\le}{\leqslant}
12
13 \newcommand{\has}{\sqsupseteq}
14 \newcommand{\isin}{\sqsubseteq}
15
16 \newcommand{\nothaspatch}{\mathrel{\,\not\!\not\relax\haspatch}}
17 \newcommand{\notpatchisin}{\mathrel{\,\not\!\not\relax\patchisin}}
18 \newcommand{\haspatch}{\sqSupset}
19 \newcommand{\patchisin}{\sqSubset}
20
21 \newcommand{\set}[1]{\mathbb #1}
22 \newcommand{\pa}[1]{\varmathbb #1}
23 \newcommand{\pay}[1]{\pa{#1}^+}
24 \newcommand{\pan}[1]{\pa{#1}^-}
25
26 \newcommand{\p}{\pa{P}}
27 \newcommand{\py}{\pay{P}}
28 \newcommand{\pn}{\pan{P}}
29
30 %\newcommand{\hasparents}{\underaccent{1}{>}}
31 %\newcommand{\hasparents}{{%
32 %  \declareslashed{}{_{_1}}{0}{-0.8}{>}\slashed{>}}}
33 \newcommand{\hasparents}{>_{\mkern-7.0mu _1}}
34 \newcommand{\areparents}{<_{\mkern-14.0mu _1\mkern+5.0mu}}
35
36 \renewcommand{\implies}{\Rightarrow}
37 \renewcommand{\equiv}{\Leftrightarrow}
38 \renewcommand{\land}{\wedge}
39 \renewcommand{\lor}{\vee}
40
41 \newcommand{\pancs}[2]{{\mathcal A} ( #1 , #2 ) }
42 \newcommand{\pends}[2]{{\mathcal E} ( #1 , #2 ) }
43
44 \newcommand{\patchof}[1]{{\mathcal P} ( #1 ) }
45 \newcommand{\baseof}[1]{{\mathcal B} ( #1 ) }
46
47 \newcommand{\eqn}[2]{ #2 \tag*{\mbox{#1}} }
48
49 %\newcommand{\bigforall}{\mathop{\hbox{\huge$\forall$}}}
50 \newcommand{\bigforall}{%
51   \mathop{\mathchoice%
52     {\hbox{\huge$\forall$}}%
53     {\hbox{\Large$\forall$}}%
54     {\hbox{\normalsize$\forall$}}%
55     {\hbox{\scriptsize$\forall$}}}%
56 }
57
58 \begin{document}
59
60 \section{Notation}
61
62 \begin{basedescript}{
63 \desclabelwidth{5em}
64 \desclabelstyle{\nextlinelabel}
65 }
66 \item[ $ C \hasparents \set X $ ]
67 The parents of commit $C$ are exactly the set
68 $\set X$.
69
70 \item[ $ C \ge D $ ]
71 $C$ is a descendant of $D$ in the git commit
72 graph.  This is a partial order, namely the transitive closure of 
73 $ D \in \set X $ where $ C \hasparents \set X $.
74
75 \item[ $ C \has D $ ]
76 Informally, the tree at commit $C$ contains the change
77 made in commit $D$.  Does not take account of deliberate reversions by
78 the user or in non-Topbloke-controlled branches; these are considered
79 normal, forward, commits.  For merges and Topbloke-generated
80 anticommits, the ``change made'' is only to be thought of as any
81 conflict resolution.  This is not a partial order because it is not
82 transitive.
83
84 \item[ $ \p, \py, \pn $ ]
85 A patch $\p$ consists of two sets of commits $\pn$ and $\py$, which
86 are respectively the base and tip git branches.  $\p$ may be used
87 where the context requires a set, in which case the statement
88 is to be taken as applying to both $\py$ and $\pn$.
89 All these sets are distinct.  Hence:
90
91 \item[ $ \patchof{ C } $ ]
92 Either $\p$ s.t. $ C \in \p $, or $\bot$.  
93 A function from commits to sets $\p$.
94
95 \item[ $ \pancs{C}{\set P} $ ]
96 $ \{ A \; | \; A \le C \land A \in \set P \} $ 
97 i.e. all the ancestors of $C$
98 which are in $\set P$.
99
100 \item[ $ \pends{C}{\set P} $ ]
101 $ \{ E \; | \; E \in \pancs{C}{\set P}
102   \land \mathop{\not\exists}_{A \in \pancs{C}{\set P}}
103   A \neq E \land E \le A \} $ 
104 i.e. all $\le$-maximal commits in $\pancs{C}{\set P}$.
105
106 \item[ $ \baseof{C} $ ]
107 $ \pends{C}{\pn} = \{ \baseof{C} \} $ where $ C \in \py $.
108 A partial function from commits to commits.
109 See ``unique base'', below.
110
111 \item[ $ C \haspatch \p $ ]
112 $ \bigforall_{D \in \py} D \isin C \equiv D \le C $.
113 Informally, $C$ has the contents of $\p$.
114
115 \item[ $\displaystyle C \nothaspatch \p $ ]
116 $\displaystyle \bigforall_{D \in \py} D \not\isin C $.
117 ~ Informally, $C$ has none of the contents of $\p$.
118
119 \end{basedescript}
120
121 \section{Invariants}
122
123 \[ \eqn{No replay:}{
124   C \has D \implies C \ge D
125 }\]
126 \[\eqn{Unique base:}{
127  \bigforall_{C \in \py} \pends{C}{\pn} = \{ B \}
128 }\]
129 \[\eqn{Tip contents:}{
130   \bigforall_{C \in \py} D \isin C \equiv
131     { D \isin \baseof{C} \lor \atop
132       (D \in \py \land D \le C) }
133 }\]
134 \[\eqn{Base non-circ:}{
135   \bigforall_{B \in \pn} D \isin B \implies D \notin \py
136 }\]
137
138 \section{Test more symbols}
139
140 $ C \haspatch \p $
141
142 $ C \nothaspatch \p $
143
144 $ \p \patchisin C $
145
146 $ \p \notpatchisin C $
147
148 $ \{ B \} \areparents C $
149
150 \end{document}