% Elements d'Infomatique Theorique
% Definitions pour le polycopie et les series d'exercices.
% Olivier Biberstein
% 96/10/18
% 97/01/08

\typeout{EIT V1.1 by O.Biberstein 97/01/08}

% set, multiset, tuple, eval
\newcommand{\set}[1]{{\{{#1}\}}}             % {.}
\newcommand{\mset}[1]{{[{#1}]}}              % [.]
\newcommand{\tuple}[1]{{\langle{#1}\rangle}} % <.>
\newcommand{\eval}[1]{\mbox{$[\![{#1}]\!]$}} % [[.]]
\newcommand{\st}{\mid}                       % |

% postscript courier
\newcommand{\pcrfamily}{\fontencoding{OT1}\fontfamily{pcr}\selectfont}
\newcommand{\textpcr}[1]{{\pcrfamily{#1}}}
\newcommand{\textpcrb}[1]{{\pcrfamily\bfseries{#1}}}
\newcommand{\textpcri}[1]{{\pcrfamily\itshape{#1}}}
\newcommand{\textpcrib}[1]{{\pcrfamily\bfseries\itshape{#1}}}
\DeclareMathAlphabet{\mathpcr}{OT1}{pcr}{m}{n}
\newcommand{\smallpcr}{\fontencoding{OT1}\fontfamily{pcr}\selectfont\small}
\newfont{\crr}{pcrr at 11pt}
\newfont{\crb}{pcrb at 11pt}
\newfont{\cro}{pcrro at 11pt}
\newfont{\crbo}{pcrbo at 11pt}
% new emptyset symbol
\DeclareMathSymbol{\emptyset}{\mathord}{AMSb}{"3F}
% symboles postscript
\newcommand{\co}[1]{$\mathpcr{#1}$}
\newcommand{\my}[1]{\mathpcr{#1}}
\newcommand{\sy}[1]{\mbox{\crr #1}}
\newcommand{\mco}[1]{\mbox{\crr #1}}

% new theorem like definitions
% version AAAaaax destinee aux exercices
\newtheorem{DEFthm}{\bf Définition}[section]
\newtheorem{DEFthmx}{\bf Définition}
\newtheorem{THMthm}{\bf Théorème}[section]
\newtheorem{THMthmx}{\bf Théorème}
\newtheorem{PROPthm}{\bf Proposition}[section]
\newtheorem{PROPthmx}{\bf Proposition}
\newtheorem{CORthm}{\bf Corollaire}[section]
\newtheorem{CORthmx}{\bf Corollaire}
\newtheorem{LEMthm}{\bf Lemme}[section]
\newtheorem{LEMthmx}{\bf Lemme}
\newtheorem{EXthm}{\bf Exemple\plural}[section]
\newtheorem{EXthmx}{\bf Exemple\plural}
\newenvironment{DEF}[1]{\begin{DEFthm}{\it\ #1}\rm\\}{\Close\end{DEFthm}}
\newenvironment{DEFx}[1]{\begin{DEFthmx}{\it\ #1}\rm\\}{\Close\end{DEFthmx}}
\newenvironment{THM}[1]{\begin{THMthm}{\it\ #1}\rm\\}{\end{THMthm}}
\newenvironment{THMx}[1]{\begin{THMthmx}{\it\ #1}\rm\\}{\end{THMthmx}}
\newenvironment{PROP}[1]{\begin{PROPthm}{\it\ #1}\rm\\}{\end{PROPthm}}
\newenvironment{PROPx}[1]{\begin{PROPthmx}{\it\ #1}\rm\\}{\end{PROPthmx}}
\newenvironment{COR}[1]{\begin{CORthm}{\it\ #1}\rm\\}{\end{CORthm}}
\newenvironment{CORx}[1]{\begin{CORthmx}{\it\ #1}\rm\\}{\end{CORthmx}}
\newenvironment{LEM}[1]{\begin{LEMthm}{\it\ #1}\rm\\}{\end{LEMthm}}
\newenvironment{LEMx}[1]{\begin{LEMthmx}{\it\ #1}\rm\\}{\end{LEMthmx}}
\newenvironment{PROOF}[1]{\noindent{\bf Preuve}{\it\ \ #1}\rm\\}{\Cqfd}
\newenvironment{EXAMPLE}[1]{\def\plural{}\begin{EXthm}{\it\ #1}\rm}%
{\end{EXthm}}
\newenvironment{EXAMPLEx}[1]{\def\plural{}\begin{EXthmx}{\it\ #1}\rm}%
{\end{EXthmx}}
\newenvironment{EXAMPLES}[1]{\def\plural{s}\begin{EXthm}{\it\ #1}\rm}%
{\end{EXthm}}
\newenvironment{EXAMPLESx}[1]{\def\plural{s}\begin{EXthmx}{\it\ #1}\rm}%
{\end{EXthmx}}
% end of proof and definition
\newcommand{\chclose}{\mbox{$\lozenge$}}
\newcommand{\chcqfd}{\mbox{$\Box$}}
\newcommand{\Cqfd}{\hfill\chcqfd}
\newcommand{\CQFD}{\hfill\chcqfd}
\newcommand{\Close}{\hfill\chclose}
\newcommand{\CLOSE}{\hfill\chclose}
\newcommand{\NOCLOSE}{\def\Close{}}
\newcommand{\NOCQFD}{\def\Cqfd{}}
\newcommand{\NEGCLOSE}{\def\Close{}\par\vspace*{-\baselineskip}\CLOSE}
\newcommand{\NEGCQFD}{\def\Cqfd{}\par\vspace*{-\baselineskip}\CQFD}
\newcommand{\NEGNEGCLOSE}{\def\Close{}\par\vspace*{-1.5\baselineskip}\CLOSE}
\newcommand{\NEGNEGCQFD}{\def\Cqfd{}\par\vspace*{-1.5\baselineskip}\CQFD}

\newenvironment{ENUMroman}{%
\begin{enumerate}%
\renewcommand{\theenumi}{\roman{enumi}}%
\renewcommand{\labelenumi}{{\small\theenumi)}}}%
{\end{enumerate}}

\newlength{\INDA}
\newlength{\INDB}
\newenvironment{IND}[1]{\underline{#1}\hspace{1mm}:\hspace{2mm}\settowidth{\INDA}{\underline{#1}\hspace{1mm}:\hspace{2mm}}\setlength{\INDB}{\linewidth}\addtolength{\INDB}{-\INDA}\begin{minipage}[t]{\INDB}}{\end{minipage}\par\addvspace{2mm}}

\newenvironment{INDS}[1]{
\underline{#1}\hspace{1mm}:\hspace{2mm}\settowidth{\INDA}{\underline{#1}\hspace{1mm}:\hspace{2mm}}\setlength{\INDB}{\linewidth}\addtolength{\INDB}{-\INDA}\begin{minipage}[t]{\INDB}\begin{MYITEM}{\arabic{ITEMCOUNTER})}{5mm}{4mm}{1mm}{0mm}{0mm}{1mm}{1mm}{0mm}
}{\end{MYITEM}\end{minipage}\par\addvspace{2mm}}

\newenvironment{EEXS}{
\underline{Exemples}\hspace{1mm}:\begin{MYITEM}{\arabic{ITEMCOUNTER})}{10mm}{4mm}{2mm}{0mm}{\parskip}{1mm}{1mm}{0mm}
}{\end{MYITEM}}

% tt font, parskip = 0, smallskip at the beginning and the end

% pour les grammaires 
% nt = non terminal, mt = mot terminal, st = symbole terminal,
% al = alternative, alsp = alternative avec epacement,
% op = optionnel, pl = zero ou plusieurs fois,
% un = une ou plusieurs fois.
\newcommand{\nt}[1]{{\it #1}\,\,}
\newcommand{\mt}[1]{{\bf #1}\,\,}
\newcommand{\ste}[1]{`#1'\,\,}
\newcommand{\al}{$\mid$}
\newcommand{\alsp}{$\mid$\,\,\,}
\newcommand{\op}[1]{[\, #1 ]\,\,}

\newcommand{\pl}[1]{(\, #1 $)^*$\,\,}
\newcommand{\un}[1]{(\, #1 $)^+$\,\,}
%\newcommand{\pl}[1]{\{\, #1 \}\,\,}
%\newcommand{\un}[1]{\{\, #1 $\}^+$\,\,}

\newcommand{\AF}{{AF}}
\newcommand{\AFN}{{AFN}}
\newcommand{\AFD}{{AFD}}

\newcommand{\DTIME}{{\rm DTIME}}
\newcommand{\NTIME}{{\rm NTIME}}
\newcommand{\NSPACE}{{\rm NSPACE}}
\newcommand{\DSPACE}{{\rm DSPACE}}
\newcommand{\PSPACE}{{\rm PSPACE}}
\newcommand{\ktapeDSPACE}{\mbox{k-tape-DSPACE}\,}
\newcommand{\onetapeDSPACE}{\mbox{1-tape-DSPACE}\,}
\newcommand{\coDTIME}{\mbox{co-DTIME}\,}
\def\P{\mbox{$\mathcal{P}$}}
\newcommand{\NP}{\mbox{$\mathcal{NP}$}}
\newcommand{\coP}{\mbox{co-$\mathcal{P}$}}
\newcommand{\coNP}{\mbox{co-$\mathcal{NP}$}}

% examens, controles, exercices, corriges, hors series
\newcounter{serie}
\newcounter{horserie}
\newcounter{exercice}
\newcounter{question}
% entete generale
\newcommand{\entete}[1]{
\noindent%
Éléments d'Informatique Théorique\hfill #1\\
Département d'Informatique\\
Université de Genève\hfill José Rolim, Thierry Zwissig\\
\raisebox{1ex}{\makebox[\linewidth]{\hrulefill}}}

\newcommand{\controle}[1]{
\begin{center}
\huge Contrôle continu #1
\end{center}
}

\newcommand{\ecrit}{
\begin{center}
\LARGE Examen écrit
\end{center}
}

\newcommand{\serie}[1]{%
\entete{#1}%
\addtocounter{serie}{10}%
\setcounter{exercice}{0}%	
\setcounter{page}{1}%
\begin{center}%
\huge Série \arabic{serie}%
\end{center}%
}

\newcommand{\corrige}[1]{%
\entete{#1}%
\setcounter{exercice}{0}%
\setcounter{page}{1}%
\begin{center}%
\huge Corrigé \arabic{serie}%
\end{center}%
}

\newcommand{\horserie}[1]{%
\entete{#1}%
\addtocounter{horserie}{1}%
\setcounter{exercice}{0}%
\setcounter{page}{1}%
\begin{center}%
\huge Hors Série \arabic{horserie}%
\end{center}%
}

\newenvironment{exercice}%
{\bigskip\smallskip\par\noindent\addtocounter{exercice}{1}%
{\large\textbf{Exercice\ \arabic{exercice}}\,:\,}}%
{}

\newenvironment{question}%
{\bigskip\par\noindent\addtocounter{question}{1}%
{\large\textbf{Question\ \arabic{question}}\,:\,}}%
{}

\newcommand{\eps}{\epsilon}
\newcommand{\into}{\rightarrow}
\newcommand{\der}{\Rightarrow}

\newcommand{\PROPER}{\vspace{2mm}\noindent\underline{Propri\'et\'e}\,:\,\,}
\newcommand{\REM}{\vspace{2mm}\noindent\underline{Remarque}\,:\,\,}
\newcommand{\RAP}{\vspace{2mm}\noindent\underline{Rappel}\,:\:}
\newcommand{\NOT}{\vspace{2mm}\noindent\underline{Notation}\,:\,\,}
\newcommand{\PROPERS}{\vspace{2mm}\noindent\underline{Propri\'et\'es}\,:\,\,}
\newcommand{\REMS}{\vspace{2mm}\noindent\underline{Remarques}\,:\,\,}
\newcommand{\RAPS}{\vspace{2mm}\noindent\underline{Rappels}\,:\,\,}
\newcommand{\NOTS}{\vspace{2mm}\noindent\underline{Notations}\,:\,\,}

\newcommand{\NN}{{\bf N}}
\newcommand{\BB}{{\bf B}}
\newcommand{\ZZ}{{\bf Z}}
\newcommand{\PP}{{\bf P}}

\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}
\newcommand{\rw}{\rightarrow}
\newcommand{\Rw}{\Rightarrow}
\newcommand{\lw}{\leftarrow}
\newcommand{\Lw}{\Leftarrow}
\newcommand{\es}{\triangleleft}
\newcommand{\bk}{\Box}
\newcommand{\ua}{\!\uparrow\!}
\newcommand{\dotminus}{-\!\!\!\!\!\circ\,\,}
%\newcommand{\dotminus}{-\!\!\!\!\!\raisebox{1mm}{$\circ$}}
\newcommand{\subtitle}[1]{\medskip\noindent{\sc #1 \medskip}}

\newcommand{\To}{\Rightarrow}

% Abreviations pour la complexite
\newcommand{\dtime}{{\rm DTIME}} \newcommand{\ntime}{{\rm NTIME}}
\newcommand{\nspace}{{\rm NSPACE}} \newcommand{\dspace}{{\rm DSPACE}}
\newcommand{\pspace}{{\rm PSPACE}}
\newcommand{\ktapedspace}{\mbox{k-tape-DSPACE}\,}
\newcommand{\onetapedspace}{\mbox{1-tape-DSPACE}\,}
\newcommand{\codtime}{\mbox{co-DTIME}\,}
\newcommand{\p}{\mbox{$\mathcal{P}$}}
\newcommand{\np}{\mbox{$\mathcal{NP}$}}
\newcommand{\cop}{\mbox{co-$\mathcal{P}$}}
\newcommand{\conp}{\mbox{co-$\mathcal{NP}$}}

\newcommand{\partie}[1]{\mbox{\bf P}(#1)}

