% Generic things for all CRS's.
\newcommand{\CRSVarSet}{\ensuremath{\mathrm{Var}}}
\newcommand{\CRSMVarSet}{\ensuremath{\mathrm{MVar}}}
\newcommand{\CRSBind}[2]{\ensuremath{\Bracks{#1}{#2}}}

% Sets determined by a set of function symbols.
\newcommand{\CRSMTerSet}[1]{\ensuremath{\mathrm{MTer}\Parens{#1}}}
\newcommand{\CRSTerSet}[1]{\ensuremath{\mathrm{Ter}\Parens{#1}}}

% Properties of a particular CRS.
\newcommand{\CRSFunSymSet}[1]{\ensuremath{\mathrm{Fun}\Parens{#1}}}
\newcommand{\CRSRedRuleSet}[1]{\ensuremath{\mathrm{Red}\Parens{#1}}}

\newcommand*{\CRSMetaVars}[1]{\ensuremath{\mathrm{MV}\Parens{#1}}}
\newcommand*{\CRSDisjointMetaVars}[2]{\ensuremath{\mathrm{DMV}(#1,#2)}}
\newcommand*{\CRSDisjointMetaVarsSet}[1]{\ensuremath{\mathrm{DMV}(#1)}}

\newcommand*{\CRSFreeVars}[1]{\ensuremath{\mathrm{FV}\Parens{#1}}}

\newcommand*{\CRSTreeSym}{\mathrm{Tree}}
\newcommand*{\CRSTree}[1]{\CRSTreeSym\Parens{#1}}
\newcommand*{\CRSTreeArg}[2]{\CRSTree{#1}\Parens{#2}}

\newcommand{\CRSAllFunSymSet}{\mathrm{Fun}}

\renewcommand{\CRSMTerSet}{\mathrm{MTer}}
\newcommand{\CRSContextSet}{\mathrm{Ctxt}}

%
% NB: The following macro ought to be named CRSContextSet but 
%     that name is used in the defn. above (which, for consistency 
%     with Ter, ought to be \CRSAllContextSet.
%
\newcommand{\CRSCtxtSet}[1]{\ensuremath{\mathrm{Ctxt}\Parens{#1}}}


\newcommand{\CRSAllTerSet}{\mathrm{Ter}}
\newcommand{\CRSPreTerSet}{\mathrm{PTer}}

\newcommand{\CRSBindPosSym}{\mathrm{BindPos}}
\newcommand*{\CRSBindPos}[2]{\CRSBindPosSym\Parens{{#1},{#2}}}
\newcommand{\NoVar}{\bullet}

\newcommand*{\CRSSkel}[1]{\mathrm{Skel}\Parens{#1}}

\newcommand*{\CRSSubtermAt}[2]{{#1}.{#2}}

\newcommand*{\CRSIntPosSet}[1]{\mathrm{Int}\Parens{#1}}

\newcommand*{\CRSRedex}[3]{\Parens{\CRSSubtermAt{#1}{#2},{#3}}}
\newcommand*{\CRSRedexNP}[3]{{\CRSSubtermAt{#1}{#2},{#3}}}

