
% These mathligs can't go in the preamble or amsmath's \AtBeginDocument
% gives us latex errors on those that cause = or - (or possibly others)
% to be defined.

% Implies, if-and-only-if
\mathlig{=>}{\Rightarrow}
\mathlig{<=>}{\Leftrightarrow}

% Used for making singles and pairs:
\mathlig{<}{\left<}
\mathlig{>}{\right>}

% Use ^ for inverse
\catcode`^=11
\mathlig{^}{\inverted}
% this looks better to me in "forall p \in P . foo"
\mathlig{.}{\cdot}

% Patch commute
\mathlig{<->}{\xleftrightarrow{}}
% Patch commute-past
\mathlig{->}{\xrightarrow{}}
% Contexted patches don't commute
\mathlig{<X>}{\leftrightarrows}
% or \leftrightsquigarrow?
% Conflictor commute
\mathlig{<-C->}{\underset{C}{<->}}

\newcommand{\single}[1]{<#1>}
\newcommand{\pair}[2]{<#1, #2>}
\newcommand{\pairTwoLines}[2]{<\begin{array}[c]{@{}l@{}}
                               #1,\\
                               #2
                               \end{array}>}
\newcommand{\mkset}[1]{\left\{#1\right\}}
\newcommand{\union}{\cup}
\newcommand{\contextset}[1]{\mkset{#1}}
\newcommand{\namedset}[1]{\mathbf{#1}}
\newcommand{\patchesName}{P}
\newcommand{\patches}{\namedset{\patchesName}}
\newcommand{\patchseqsName}{\seq{P}}
\newcommand{\patchseqs}{\namedset{\patchseqsName}}
\newcommand{\catchesName}{C}
\newcommand{\catches}{\namedset{\catchesName}}
\newcommand{\reposName}{R}
\newcommand{\repos}{\namedset{\reposName}}
\newcommand{\emptyrepo}{\epsilon}
\newcommand{\fail}{\mathrm{fail}}
\newcommand{\nopatches}{\epsilon}
\newcommand{\nocatches}{\epsilon}
\newcommand{\noeffect}{\textrm{id}}
\newcommand{\effectofName}{\mathscr{E}}
\newcommand{\effectof}[1]{\mathop{\effectofName}\left(#1\right)}
\newcommand{\nameName}{n}
\newcommand{\name}[1]{\mathop{\nameName}\left(#1\right)}
\newcommand{\namesName}{N}
\newcommand{\names}[1]{\mathop{\namesName}\left(#1\right)}
\newcommand{\catchConflictsName}{\mathscr{C}}
\newcommand{\catchConflicts}[1]{\mathop{\catchConflictsName}\left(#1\right)}

% Contexts
\newcommand{\context}{\mathbb{C}}

% Conflictors notation
\newcommand{\conflictors}{\namedset{C}}
\newcommand{\patch}[1]{\left[#1\right]}
% \newcommand{\patch}[1]{\mathop{P} #1}
\newcommand{\conflictor}[3]{\left[#1, #2, #3\right]}
\newcommand{\invconflictor}[3]{\left\llbracket#1, #2, #3\right\rrbracket}
% This is for when we only want [name, effect]
\newcommand{\simpleconflictor}[2]{\left[#1, #2\right]}

