% 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}

.
