\newcommand{\chaplabel}[1]{\label{chap:#1}}
\newcommand{\chapref}[1]{\ref{chap:#1}}

\newcommand{\seclabel}[2]{\label{chap:#1-sec:#2}}
\newcommand{\secref}[2]{\ref{chap:#1-sec:#2}}

\newcommand{\rulelabel}[2]{\ifthenelse{\equal{#2}{}}{}{\label{chap:#1-rule:#2}}}
\newcommand{\ruleref}[2]{\ref{chap:#1-rule:#2}}

\newenvironment{inferencerule}[2]{\begin{equation}\rulelabel{#1}{#2}}{\end{equation}}

%\newcounter{rulenumber}[chapter]
%\newenvironment{inferencerule}[2]{\refstepcounter{rulenumber}\rulelabel{#1}{#2}$$}{\relax\eqno(\ifnotes\therulenumber\else\thechapter.\therulenumber\fi)$$}

\newcommand{\thmlabel}[2]{\ifthenelse{\equal{#2}{}}{}{\label{chap:#1-thm:#2}}}
\newcommand{\thmref}[2]{\ref{chap:#1-thm:#2}}

\newcommand{\figlabel}[2]{\ifthenelse{\equal{#2}{}}{}{\label{chap:#1-fig:#2}}}
\newcommand{\figref}[2]{\ref{chap:#1-fig:#2}}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
