summaryrefslogtreecommitdiff
path: root/macros/generic/petri-nets/pntext.sty
blob: 1f337cfe5d729b38cf59e337efa8547798d94df2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
% This file is part of the Petri-nets packages. See file README for
% copyright notice.

\ProvidesPackage{pntext}

\typeout{ ** Petri-nets / text commands ** }

% numbers sets

\usepackage{amsfonts}

\newcommand{\mathset}[1]{\relax\ifmmode\mathbb #1\else$\mathbb #1$\fi}
\newcommand{\setN}{\mathset{N}}
\newcommand{\setZ}{\mathset{Z}}
\newcommand{\setQ}{\mathset{Q}}
\newcommand{\setR}{\mathset{R}}
\newcommand{\setC}{\mathset{C}}

% places status

\newcommand{\placestatus}[1]{{\sf #1}}
\newcommand{\eplace}{\placestatus{e}}
\newcommand{\iplace}{\placestatus{i}}
\newcommand{\xplace}{\placestatus{x}}

% synchronisation, restriction and tie

\newcommand{\sy}{\relax
  \ifmmode\mathop{\bf sy}\else{\bf sy}\fi}
\newcommand{\rs}{\relax
  \ifmmode\mathop{\bf rs}\else{\bf rs}\fi}
\newcommand{\tie}{\relax
  \ifmmode\mathop{\bf tie}\else{\bf tie}\fi}

% scoping

\newcommand{\lscope}{\relax
  \ifmmode\left[\mskip -2.05\thinmuskip\left[\else$\lscope$\fi}
\newcommand{\Lscope}{\relax\ifmmode\left.\left.\fi}
\newcommand{\rscope}{\relax
  \ifmmode\right]\mskip -2.05\thinmuskip\right]\else$\rscope$\fi}
\newcommand{\Rscope}{\relax\ifmmode\right.\right.\fi}
\newcommand{\scope}{} % just to test its existence
\def\scope #1#2{\relax
  \ifmmode\lscope#1:#2\rscope\else$\lscope#1:#2\rscope$\fi}

% choice operator

\newcommand{\choice}{\relax\ifmmode
  \mathop{\raise -.2ex\hbox{$\Box$}}\else{\raise -.2ex\hbox{$\Box$}}\fi}

% B(PB)^2 logo

\newcommand{\bpn}{\mbox{B(PN)$^2$}}

% B(PN)^2 syntax

\newcommand{\bpnkw}[1]{{\bf #1}} % keyword
\newcommand{\bpnnt}[1]{{\sf #1}} % non-terminal

% Mnet mapping function

\newcommand{\mnet}{\mbox{\sf Mnet}}

% Var and Val

\newcommand{\Val}{\relax\ifmmode{V\mskip-1.6\thinmuskip al}%
  \else{\it Val}\fi}
\newcommand{\Var}{\relax\ifmmode{V\mskip-1.5\thinmuskip ar}%
  \else{\it Var}\fi}