iris.sty 14.5 KB
Newer Older
1
2
3
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{iris}

Ralf Jung's avatar
Ralf Jung committed
4
\RequirePackage{faktor}
5
6
\RequirePackage{tikz}
\RequirePackage{scalerel}
7
8
9
\RequirePackage{array}
\RequirePackage{dashbox}
\RequirePackage{tensor}
Ralf Jung's avatar
Ralf Jung committed
10
\RequirePackage{xifthen}
11
12
13
\RequirePackage{xparse}
\RequirePackage{mathtools}

14
15
16
17
18
19
20
21
22
23
\usetikzlibrary{shapes}
%\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MATH SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

24
25
\newcommand{\nat}{\mathbb{N}}

Ralf Jung's avatar
Ralf Jung committed
26
\newcommand*{\Sep}[1][]{\scalerel*{\ast}{\sum}\ifthenelse{\isempty{#1}}{}{_{#1}\;}}
Ralf Jung's avatar
Ralf Jung committed
27
28
\newcommand*{\disj}[1][]{\mathrel{\#_{#1}}}
\newcommand\pord{\sqsubseteq}
Ralf Jung's avatar
Ralf Jung committed
29
30
31

\makeatletter%
\@ifundefined{dplus}{%
32
\newcommand\dplus{\mathbin{+\kern-1.0ex+}}
Ralf Jung's avatar
Ralf Jung committed
33
34
35
}{}
\makeatother%

36
37
38
\newcommand{\upclose}{\mathord{\uparrow}}
\newcommand{\ALT}{\ |\ }

39
\newcommand{\spac}{\hskip 0.2em plus 0.1em} % a space
40
41
42
43
44
45
46

\def\All #1.{\forall #1.\spac}%
\def\Exists #1.{\exists #1.\spac}%
\def\Ret #1.{#1.\spac}%

\newcommand{\any}{{\rule[-.2ex]{1ex}{.4pt}}}%

Ralf Jung's avatar
Ralf Jung committed
47
\newcommand{\judgment}[2][]{\paragraph{#1}\hspace{\stretch{1}}\fbox{$#2$}}
48
49
50

\newcommand{\pfn}{\rightharpoonup}
\newcommand\fpfn{\xrightharpoonup{\kern-0.25ex\textrm{fin}\kern-0.25ex}}
Ralf Jung's avatar
Ralf Jung committed
51
\newcommand{\la}{\leftarrow}
52
53
54
\newcommand{\ra}{\rightarrow}
\newcommand{\Ra}{\Rightarrow}
\newcommand{\Lra}{\Leftrightarrow}
55
\newcommand\monra{\xrightarrow{\kern-0.15ex\textrm{mon}\kern-0.05ex}}
Ralf Jung's avatar
Ralf Jung committed
56
\newcommand\monnra{\xrightarrow{\kern-0.15ex\textrm{mon,ne}\kern-0.05ex}}
57
\newcommand\nfn{\xrightarrow{\kern-0.15ex\textrm{ne}\kern-0.05ex}}
58
\newcommand{\eqdef}{\triangleq}
Ralf Jung's avatar
Ralf Jung committed
59
60
\newcommand{\bnfdef}{\vcentcolon\vcentcolon=}

Ralf Jung's avatar
Ralf Jung committed
61
62
\newcommand{\maybe}[1]{#1^?}

63
64
\newcommand*\setComp[2]{\left\{#1\spac\middle|\spac#2\right\}}
\newcommand*\set[1]{\left\{#1\right\}}
65
\newcommand*\record[1]{\left\{\spac#1\spac\right\}}
Ralf Jung's avatar
Ralf Jung committed
66
\newcommand*\recordComp[2]{\left\{\spac#1\spac\middle|\spac#2\spac\right\}}
67
68
69
70
71
72
73

\newenvironment{inbox}[1][]{
  \begin{array}[#1]{@{}l@{}}
}{
  \end{array}
}

Ralf Jung's avatar
Ralf Jung committed
74
\newcommand{\op}{\textrm{op}}
75
76
77
78
79
80
\newcommand{\dom}{\mathrm{dom}}
\newcommand{\cod}{\mathrm{cod}}
\newcommand{\chain}{\mathrm{chain}}

\newcommand{\pset}[1]{\wp(#1)} % Powerset
\newcommand{\psetdown}[1]{\wp^\downarrow(#1)}
Ralf Jung's avatar
Ralf Jung committed
81
\newcommand{\finpset}[1]{\wp^\mathrm{fin}(#1)}
Ralf Jung's avatar
Ralf Jung committed
82
83
\newcommand{\pmultiset}[1]{\wp^{+}(#1)}
\newcommand{\finpmultiset}[1]{\wp^{\mathrm{fin},+}(#1)}
84
85
86

\newcommand{\Func}{F} % functor

87
88
\newcommand{\subst}[3]{{#1}[{#3} / {#2}]}

Ralf Jung's avatar
Ralf Jung committed
89
90
91
92
93
94
\newcommand{\mapinsert}[3]{#3\left[#1\mathop{\la}#2\right]}
\newcommand{\mapsingleton}[2]{\mapinsert{#1}{#2}{}}
\newcommand{\mapinsertComp}[4]
  {\mapinsert{#1}{#2 \spac\middle|\spac #3}{#4}}
\newcommand{\mapComp}[3]
  {\mapinsertComp{#1}{#2}{#3}{}}
95
96
97

\newcommand{\nil}{\epsilon}

Robbert Krebbers's avatar
Robbert Krebbers committed
98
99
100
% displaced dot
\newcommand{\dispdot}[2][.2ex]{\dot{\raisebox{0pt}[\dimexpr\height+#1][\depth]{$#2$}}}% \dispdot[<displace>]{<stuff>}

101
102
103
104
105
106
107
108
109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MODEL-SPECIFIC SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textdom}[1]{\textit{#1}}

\newcommand{\wIso}{\xi}

\newcommand{\rs}{r}
\newcommand{\rsB}{s}
Ralf Jung's avatar
Ralf Jung committed
110
\newcommand{\rss}{R}
111
112
113
114
115
116

\newcommand{\pres}{\pi}
\newcommand{\wld}{w}
\newcommand{\ghostRes}{g}

%% Various pieces of syntax
Ralf Jung's avatar
Ralf Jung committed
117
118
\newcommand{\wsat}[3]{#1 \models_{#2} #3}
\newcommand{\wsatpre}{\textdom{pre-wsat}}
119
120
121
122

\newcommand{\wtt}[2]{#1 : #2} % well-typed term

\newcommand{\nequiv}[1]{\ensuremath{\mathrel{\stackrel{#1}{=}}}}
123
\newcommand{\nincl}[1]{\ensuremath{\mathrel{\stackrel{#1}{\subseteq}}}}
124
125
126
127
\newcommand{\notnequiv}[1]{\ensuremath{\mathrel{\stackrel{#1}{\neq}}}}
\newcommand{\nequivset}[2]{\ensuremath{\mathrel{\stackrel{#1}{=}_{#2}}}}
\newcommand{\nequivB}[1]{\ensuremath{\mathrel{\stackrel{#1}{\equiv}}}}
\newcommand{\latert}{\mathord{\blacktriangleright}}
Ralf Jung's avatar
Ralf Jung committed
128
\newcommand{\latertinj}{\textlog{next}}
129
130
131
132
133
134
135
136

\newcommand{\Sem}[1]{\llbracket #1 \rrbracket}

\newcommand{\sembox}[1]{\hfill \normalfont \mbox{\fbox{\(#1\)}}}
\newcommand{\typedsection}[2]{\subsubsection*{\rm\em #1 \sembox{#2}}}


%% Some commonly used identifiers
Ralf Jung's avatar
Ralf Jung committed
137
\newcommand{\SProp}{\textdom{SProp}}
138
\newcommand{\UPred}{\textdom{UPred}}
Ralf Jung's avatar
Ralf Jung committed
139
140
\newcommand{\mProp}{\textdom{Prop}} % meta-level prop
\newcommand{\iProp}{\textdom{iProp}}
Ralf Jung's avatar
Ralf Jung committed
141
\newcommand{\iPreProp}{\textdom{iPreProp}}
Ralf Jung's avatar
Ralf Jung committed
142
\newcommand{\Wld}{\textdom{Wld}}
Ralf Jung's avatar
Ralf Jung committed
143
\newcommand{\Res}{\textdom{Res}}
144

145
146
147
% List
\newcommand{\List}{\ensuremath{\textdom{List}}}

148
149
150
151
\newcommand{\ofe}{T}
\newcommand{\ofeB}{U}
\newcommand{\cofe}{\ofe}
\newcommand{\cofeB}{\ofeB}
152
153
\newcommand{\OFEs}{\mathbf{OFE}} % category of OFEs
\newcommand{\COFEs}{\mathbf{COFE}} % category of COFEs
154
\newcommand{\iFunc}{\Sigma}
Ralf Jung's avatar
Ralf Jung committed
155
\newcommand{\fix}{\textdom{fix}}
156
157
158
159
160
161
162

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CMRA (RESOURCE ALGEBRA) SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textmon}[1]{\textsc{#1}}

\newcommand{\monoid}{M}
Ralf Jung's avatar
Ralf Jung committed
163
\newcommand{\mval}{\mathcal{V}}
Ralf Jung's avatar
Ralf Jung committed
164
\newcommand{\mvalFull}{\overline{\mathcal{V}}}
165
166
167
168
169
170
171

\newcommand{\melt}{a}
\newcommand{\meltB}{b}
\newcommand{\meltC}{c}
\newcommand{\melts}{A}
\newcommand{\meltsB}{B}

Ralf Jung's avatar
Ralf Jung committed
172
173
\newcommand{\f}{\mathrm{f}} % for "frame"

174
\newcommand{\munit}{\varepsilon}
Ralf Jung's avatar
Ralf Jung committed
175
\newcommand{\mcore}[1]{{\mid}#1{\mid}} % using "|" here makes LaTeX diverge. WTF.
Ralf Jung's avatar
Ralf Jung committed
176
\newcommand{\bigmcore}[1]{{\big|}#1{\big|}} % using "|" here makes LaTeX diverge. WTF.
Ralf Jung's avatar
Ralf Jung committed
177
\newcommand{\mnocore}{\bot}
178
\newcommand{\mtimes}{\mathbin{\cdot}}
179
\newcommand{\mundef}{\lightning}
180

Ralf Jung's avatar
Ralf Jung committed
181
182
\newcommand{\exclusive}{\mathrm{exclusive}}

183
\newcommand{\mupd}{\rightsquigarrow}
Ralf Jung's avatar
Ralf Jung committed
184
185
186
187
188
189
190
\newcommand{\mincl}[1][]{%
  \ensuremath{\mathrel{\vbox{\offinterlineskip\ialign{%
    \hfil##\hfil\cr
    \ensuremath{\scriptstyle #1}\cr
    \noalign{\kern-0.25ex}
    $\preccurlyeq$\cr
}}}}}
191

192
\newcommand{\CMRAs}{\mathbf{Camera}}
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOGIC SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textlog}[1]{\textsf{#1}}

\newcommand{\Sig}{\mathcal{S}}
\newcommand{\SigType}{\mathcal{T}}
\newcommand{\SigFn}{\mathcal{F}}
\newcommand{\SigAx}{\mathcal{A}}
\newcommand{\sigtype}{T}
\newcommand{\sigfn}{F}
\newcommand{\sigax}{A}

\newcommand{\type}{\tau}
208
\newcommand{\typeB}{\sigma}
209
210
211
212
213
214
215
216

\newcommand{\var}{x}
\newcommand{\varB}{y}
\newcommand{\varC}{z}

\newcommand{\term}{t}
\newcommand{\termB}{u}

Robbert Krebbers's avatar
Robbert Krebbers committed
217
\newcommand{\venv}{\rho}
218
219
220
221
222
223
224
\newcommand{\vctx}{\Gamma}
\newcommand{\pfctx}{\Theta}

\newcommand{\prop}{P}
\newcommand{\propB}{Q}
\newcommand{\propC}{R}

225
226
227
228
229
230
231
% pure propositions
\newcommand{\pprop}{\phi}
\newcommand{\ppropB}{\psi}

\newcommand{\pred}{\varPhi}
\newcommand{\predB}{\Psi}
\newcommand{\predC}{\Zeta}
232
233
234
235
236
237

\newcommand{\gname}{\gamma}
\newcommand{\iname}{\iota}

\newcommand{\mask}{\mathcal{E}}
\newcommand{\namesp}{\mathcal{N}}
Ralf Jung's avatar
Ralf Jung committed
238
\newcommand{\namecl}[1]{{#1^{\kern0.2ex\uparrow}}}
239

Ralf Jung's avatar
Ralf Jung committed
240
241
\newcommand{\fixp}{\mathit{fix}}

242
%% various pieces of Syntax
Ralf Jung's avatar
Ralf Jung committed
243
244
\def\MU #1.{\mu\,#1.\spac}%
\def\Lam #1.{\lambda\,#1.\spac}%
245
246

\newcommand{\proves}{\vdash}
Ralf Jung's avatar
Ralf Jung committed
247
\newcommand{\provesIff}{\mathrel{\dashv\vdash}}
248

249
\newcommand{\wand}{\mathrel{-\!\!*}}
250
251

% oh my... I have to wrap the "-" in a \mathrm, otherwise all hell breaks lose...
252
\newcommand{\fmapsto}[1][]{\xmapsto{#1}}
253
254
255
\newcommand{\gmapsto}{\hookrightarrow}%
\newcommand{\fgmapsto}[1][\mathrm{-}]{\xhookrightarrow{#1}}%

Ralf Jung's avatar
Ralf Jung committed
256
257
\NewDocumentCommand\wpre{O{} m O{} m}%
  {\textlog{wp}^{#1}_{#3}\spac#2\spac{\left\{#4\right\}}}
258

Robbert Krebbers's avatar
Robbert Krebbers committed
259
260
\newcommand{\stateinterp}{S}

Ralf Jung's avatar
Ralf Jung committed
261
262
263
264
\newcommand\stuckness{s}
\newcommand\NotStuck{\textlog{NotStuck}}
\newcommand\MaybeStuck{\textlog{Stuck}}

Ralf Jung's avatar
Ralf Jung committed
265
266
\newcommand{\later}{\mathop{{\triangleright}}}
\newcommand*{\lateropt}[1]{\mathop{{\later}^{#1}}}
267
\newcommand{\always}{\mathop{\Box}}
Ralf Jung's avatar
Ralf Jung committed
268
\newcommand{\plainly}{\mathop{\blacksquare}}
269
270
271
272
273
274
275
276

%% Invariants and Ghost ownership
% PDS: Was 0pt inner, 2pt outer.
% \boxedassert [tikzoptions] contents [name]
\tikzstyle{boxedassert_border} = [sharp corners,line width=0.2pt]
\NewDocumentCommand \boxedassert {O{} m o}{%
	\tikz[baseline=(m.base)]{
		%	  \node[rectangle, draw,inner sep=0.8pt,anchor=base,#1] (m) {${#2}\mathstrut$};
277
		\node[rectangle,inner sep=0.8pt,outer sep=0.2pt,anchor=base] (m) {${\,#2\,}\mathstrut$};
278
279
280
281
282
		\draw[#1,boxedassert_border] ($(m.south west) + (0,0.65pt)$) rectangle ($(m.north east) + (0, 0.7pt)$);
	}\IfNoValueF{#3}{^{\,#3}}%
}
\newcommand*{\knowInv}[2]{\boxedassert{#2}[#1]}
\newcommand*{\ownGhost}[2]{\boxedassert[densely dashed]{#2}[#1]}
Ralf Jung's avatar
Ralf Jung committed
283
\newcommand*{\ownM}[1]{\textlog{Own}\left(#1\right)}
Ralf Jung's avatar
Ralf Jung committed
284
\newcommand*{\ownPhys}[1]{\textlog{Phy}(#1)}
285
286
287
288
289
290
291
292
293
294
295

%% View Shifts
\NewDocumentCommand \vsGen {O{} m O{}}%
  {\mathrel{%
    \ifthenelse{\equal{#3}{}}{%
      % Just one mask, or none
      {#2}_{#1}%
    }{%
      % Two masks
      \tensor*[^{#1}]{#2}{^{#3}}
    }%
Ralf Jung's avatar
Ralf Jung committed
296
  \kern0.2ex}}%
297
\NewDocumentCommand \vs {O{} O{}} {\vsGen[#1]{\Rrightarrow}[#2]}
Robbert Krebbers's avatar
Robbert Krebbers committed
298
\NewDocumentCommand \bvs {O{} O{}} {\vsGen[#1]{\dispdot[0.02ex]{\Rrightarrow}}[#2]}
299
\NewDocumentCommand \vsL {O{} O{}} {\vsGen[#1]{\Lleftarrow}[#2]}
300
\NewDocumentCommand \vsE {O{} O{}} %
301
  {\vsGen[#1]{\Lleftarrow\!\!\!\Rrightarrow}[#2]}
302
\NewDocumentCommand \pvs {O{} O{}} {\mathord{\vsGen[#1]{{\mid\kern-0.5ex\Rrightarrow\kern-0.25ex}}[#2]\kern0.2ex}}
303

304
\newcommand\vsWand{{\displaystyle\equiv\kern-1.6ex-\kern-1.5ex\smash{\scalerel*{\vphantom-\ast}{\sum}}\kern-0.2ex}}
Ralf Jung's avatar
Ralf Jung committed
305
306
\NewDocumentCommand \vsW {O{} O{}} {\vsGen[#1]{\vsWand}[#2]}

307
% for now, the update modality looks like a pvs without masks.
Robbert Krebbers's avatar
Robbert Krebbers committed
308
\NewDocumentCommand \upd {} {\mathop{\dispdot[-0.2ex]{\mid\kern-0.4ex\Rrightarrow\kern-0.25ex}}}
309

310
311
\NewDocumentCommand\Acc{O{} O{} m m}{\langle #3 \vsE #4  \rangle_{#1}^{#2}}

312
313
314
315
316
317
318
319
320
321
322

%% Hoare Triples
\newcommand*{\hoaresizebox}[1]{%
  \hbox{$\mathsurround=0pt{#1}\mathstrut$}}
\newcommand*{\hoarescalebox}[2]{%
  \hbox{\scalerel*[1ex]{#1}{#2}}}
\newcommand{\triple}[5]{%
  \setbox0=\hoaresizebox{{#3}{#5}}%
  \setbox1=\hoarescalebox{#1}{\copy0}%
  \setbox2=\hoarescalebox{#2}{\copy0}%
  \copy1{#3}\copy2%
323
  \; #4 \;%
324
325
326
327
328
329
330
331
332
333
  \copy1{#5}\copy2}

\newcommand{\bracket}[4][]{%
  \setbox0=\hbox{$\mathsurround=0pt{#1}{#4}\mathstrut$}%
  \scalerel*[1ex]{#2}{\copy0}%
  {#4}%
  \scalerel*[1ex]{#3}{\copy0}}
% \curlybracket[other] x
\newcommand{\curlybracket}[2][]{\bracket[{#1}]\{\}{#2}}
\newcommand{\anglebracket}[2][]{\bracket[{#1}]\langle\rangle{#2}}
334
335
336
337
338

\NewDocumentCommand \hoare {m m m O{}}{
	\curlybracket{#1}\spac #2 \spac \curlybracket{#3}_{#4}%
}

339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
% \hoareV[t] pre c post [mask]
\NewDocumentCommand \hoareV {O{c} m m m O{}}{
		{\begin{aligned}[#1]
		&\curlybracket{#2} \\
		&\quad{#3} \\
		&{\curlybracket{#4}}_{#5}
		\end{aligned}}%
}
% \hoareHV[t] pre c post [mask]
\NewDocumentCommand \hoareHV {O{c} m m m O{}}{
	{\begin{aligned}[#1]
	&\curlybracket{#2} \; {#3} \\
	&{\curlybracket{#4}}_{#5}
	\end{aligned}}%
}


%% Some commonly used identifiers
Ralf Jung's avatar
Ralf Jung committed
357
\newcommand{\inhabited}[1]{\textlog{inhabited}(#1)}
358
\newcommand{\timeless}[1]{\textlog{timeless}(#1)}
359
\newcommand{\persistent}[1]{\textlog{persistent}(#1)}
360
361
\newcommand{\infinite}{\textlog{infinite}}

362
363
364
\newcommand\InvName{\textdom{InvName}}
\newcommand\GName{\textdom{GName}}

Ralf Jung's avatar
Ralf Jung committed
365
\newcommand{\Prop}{\textlog{iProp}}
366
367
368
369
370
371
\newcommand{\Pred}{\textlog{Pred}}

\newcommand{\TRUE}{\textlog{True}}
\newcommand{\FALSE}{\textlog{False}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ralf Jung's avatar
Ralf Jung committed
372
% GENERIC LANGUAGE SYNTAX AND SEMANTICS
373
374
375
376
377
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\expr}{e}
\newcommand{\val}{v}
\newcommand{\valB}{w}
\newcommand{\state}{\sigma}
Ralf Jung's avatar
Ralf Jung committed
378
379
380
381
\newcommand{\step}[1][]{\xrightarrow{{#1}}_{\mathsf{t}}}
\newcommand{\hstep}[1][]{\xrightarrow{{#1}}_{\mathsf{h}}}
\newcommand{\tpstep}[1][]{\xrightarrow{{#1}}_{\mathsf{tp}}}
\newcommand{\tpsteps}[1][]{\xrightarrow{{#1}}\mathrel{\vphantom{\to}^{*}_{\mathsf{tp}}}}
382
\newcommand{\lctx}{K}
383
\newcommand{\Lctx}{\textdom{Ctx}}
Ralf Jung's avatar
Ralf Jung committed
384
385
386
387
388
389
390
391
392
\newcommand{\obs}{\kappa}

\newcommand{\State}{\textdom{State}}
\newcommand{\Val}{\textdom{Val}}
\newcommand{\Loc}{\textdom{Loc}}
\newcommand{\Expr}{\textdom{Expr}}
\newcommand{\Var}{\textdom{Var}}
\newcommand{\Obs}{\textdom{Obs}}
\newcommand{\ThreadPool}{\textdom{ThreadPool}}
393

394
395
\newcommand{\toval}{\mathrm{expr\any to\any val}}
\newcommand{\ofval}{\mathrm{val\any to\any expr}}
396
\newcommand{\atomic}{\mathrm{atomic}}
Ralf Jung's avatar
Ralf Jung committed
397
\newcommand{\stronglyAtomic}{\mathrm{strongly\any atomic}}
398
\newcommand{\red}{\mathrm{red}}
399
400
401
402
403
404
\newcommand{\Lang}{\Lambda}

\newcommand{\tpool}{T}

\newcommand{\cfg}[2]{{#1};{#2}}

405
\def\fillctx#1[#2]{#1 {[}\, #2\,{]} }
406

407
408
409
410
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% STANDARD DERIVED CONSTRUCTIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Ralf Jung's avatar
Ralf Jung committed
411
412
413
\newcommand{\unittt}{()}
\newcommand{\unit}{1}

414
415
% Agreement
\newcommand{\agm}{\ensuremath{\textmon{Ag}}}
Ralf Jung's avatar
Ralf Jung committed
416
\newcommand{\aginj}{\textlog{ag}}
417
418
419

% Fraction
\newcommand{\fracm}{\ensuremath{\textmon{Frac}}}
Ralf Jung's avatar
Ralf Jung committed
420
\newcommand{\fracinj}{\textlog{frac}}
421
422
423

% Exclusive
\newcommand{\exm}{\ensuremath{\textmon{Ex}}}
Ralf Jung's avatar
Ralf Jung committed
424
\newcommand{\exinj}{\textlog{ex}}
425
426
427
428
429
430
431
432
433

% Auth
\newcommand{\authm}{\textmon{Auth}}
\newcommand{\authfull}{\mathord{\bullet}\,}
\newcommand{\authfrag}{\mathord{\circ}\,}

\newcommand{\AuthInv}{\textsf{AuthInv}}
\newcommand{\Auth}{\textsf{Auth}}

Ralf Jung's avatar
Ralf Jung committed
434
% Sum
435
\newcommand{\csumm}{\mathrel{+_{\!\mundef}}}
Ralf Jung's avatar
Ralf Jung committed
436
437
438
\newcommand{\cinl}{\textsf{inl}}
\newcommand{\cinr}{\textsf{inr}}

Ralf Jung's avatar
Ralf Jung committed
439
440
441
442
443
444
% One-Shot
\newcommand{\oneshotm}{\ensuremath{\textmon{OneShot}}}
\newcommand{\ospending}{\textlog{pending}}
\newcommand{\osshot}{\textlog{shot}}

% STSs
445
446
\newcommand{\STSCtx}{\textlog{StsCtx}}
\newcommand{\STSSt}{\textlog{StsSt}}
447
448
449
\newcommand{\STSclsd}{\textlog{closed}}
\newcommand{\STSauth}{\textlog{auth}}
\newcommand{\STSfrag}{\textlog{frag}}
450
451
452
\newcommand{\STSS}{\mathcal{S}} % states
\newcommand{\STST}{\mathcal{T}} % tokens
\newcommand{\STSL}{\mathcal{L}} % labels
453
\newcommand{\stsstep}{\ra}
454
\newcommand{\ststrans}{\ra^{*}}%	the relation relevant to the STS rules
455
456
\newcommand{\stsfstep}[1]{\xrightarrow{#1}}
\newcommand{\stsftrans}[1]{\stsfstep{#1}^{*}}
457
458
459
460
461

\tikzstyle{sts} = [->,every node/.style={rectangle, rounded corners, draw, minimum size=1.2cm, align=center}]
\tikzstyle{sts_arrows} = [arrows={->[scale=1.5]},every node/.style={font=\sffamily\small}]

%% Stored Propositions
462
\newcommand{\mapstoprop}{\mathrel{\kern-0.5ex\tikz[baseline=(m)]{\node at (0,0) (m){}; \draw[line cap=round] (0,0.16) -- (0,-0.004);}\kern-1.5ex\Ra}}
463

Ralf Jung's avatar
Ralf Jung committed
464
465
466
467
%% Cancellable invariants
\newcommand\CInv[3]{\textlog{CInv}^{#1,#2}(#3)}
\newcommand*\CInvTok[2]{{[}\textrm{CInv}:#1{]}_{#2}}

Ralf Jung's avatar
Ralf Jung committed
468
%% Non-atomic invariants
469
470
\newcommand*\pid{p}
\newcommand\NaInv[3]{\textlog{NaInv}^{#1.#2}(#3)}
Ralf Jung's avatar
Ralf Jung committed
471

472
473
\newcommand*\NaTok[1]{{[}\textrm{NaInv}:#1{]}}
\newcommand*\NaTokE[2]{{[}\textrm{NaInv}:#1.#2{]}}
Ralf Jung's avatar
Ralf Jung committed
474

Ralf Jung's avatar
Ralf Jung committed
475
476
477
478
479
480
481
482
483
%% Boxes
\newcommand*\sname{i}
\newcommand*\BoxState{\textlog{BoxState}}
\newcommand*\BoxFull{\textlog{full}}
\newcommand*\BoxEmp{\textlog{empty}}
\newcommand*\BoxSlice[3]{\textlog{BoxSlice}(#1, #2, #3)}
\newcommand*\ABox[3]{\textlog{Box}(#1, #2, #3)}


484
\endinput
485