chiark / gitweb /
no gather
[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
38 \newcommand{\pancs}[2]{{\mathcal A} ( #1 , #2 ) }
39 \newcommand{\pends}[2]{{\mathcal E} ( #1 , #2 ) }
40
41 \newcommand{\patchof}[1]{{\mathcal P} ( #1 ) }
42
43 \renewcommand{\land}{\wedge}
44
45 \newcommand{\eqn}[2]{ #2 \tag*{\mbox{#1}} }
46
47 \begin{document}
48
49 \section{Notation}
50
51 \begin{basedescript}{
52 \desclabelwidth{5em}
53 \desclabelstyle{\nextlinelabel}
54 }
55 \item[ $ C \hasparents \set X $ ]
56 The parents of commit $C$ are exactly the set
57 $\set X$.
58
59 \item[ $ C \ge D $ ]
60 $C$ is a descendant of $D$ in the git commit
61 graph.  This is a partial order, namely the transitive closure of 
62 $ D \in \set X $ where $ C \hasparents \set X $.
63
64 \item[ $ C \has D $ ]
65 Informally, the tree at commit $C$ contains the change
66 made in commit $D$.  Does not take account of deliberate reversions by
67 the user or in non-Topbloke-controlled branches; these are considered
68 normal, forward, commits.  For merges and Topbloke-generated
69 anticommits, the ``change made'' is only to be thought of as any
70 conflict resolution.  This is not a partial order because it is not
71 transitive.
72
73 \item[ $ \p, \py, \pn $ ]
74 A patch $\p$ consists of two sets of commits $\pn$ and $\py$, which
75 are respectively the base and tip git branches.  $\p$ may be used
76 where the context requires a set, in which case the statement
77 is to be taken as applying to both $\py$ and $\pn$.
78 All these sets are distinct.  Hence:
79
80 \item[ $ \patchof{ C } $ ]
81 Either $\p$ s.t. $ C \in \p $, or $\bot$.  
82 A function from commits to sets $\p$.
83
84 \item[ $ \pancs{C}{\set P} $ ]
85 $ \{ A \; | \; A \le C \land A \in \set P \} $ 
86 i.e. all the ancestors of $C$
87 which are in $\set P$.
88
89 \item[ $ \pends{C}{\set P} $ ]
90 $ \{ E \; | \; E \in \pancs{C}{\set P}
91   \land \mathop{\not\exists}_{A \in \pancs{C}{\set P}}
92   A \neq E \land E \le A \} $ 
93 i.e. all $\le$-maximal commits in $\pancs{C}{\set P}$.
94
95 \end{basedescript}
96
97 \section{Invariants}
98
99 \[ \eqn{No replay:}{
100   C \has D \implies C \ge D } \]
101 \[\eqn{Unique base:}{
102  \mathop{\forall}_{C \in \py} \pends{C}{\pn} = \{ B \} }\]
103
104 \section{Test more symbols}
105
106 $ C \haspatch \p $
107
108 $ C \nothaspatch \p $
109
110 $ \p \patchisin C $
111
112 $ \p \notpatchisin C $
113
114 $ \{ B \} \areparents C $
115
116 \end{document}