\subsection{More convenient notation for sigma types} We have defined dependent pairs with access operators and a type constructor in a way that allows simple typing rules. The disadvantage of this representation is that accessing components of large tuples cannot be done efficiently: obtaining the $n$th component of a tuple costs $n$ applications of the operators {\sf Snd} and {\sf Fst}. Therefore we suggest to generalize the notion of sigma types to obtain a record type-like representation. The basic idea is that each component in a tuple has a label in order to enable direct access. The grammar for generalized SigmaTypes} is as follows: \table {\bf data} SigmaItem} = {\sf SigmaItem}(\={\tt label}: Symbol},
\>{\tt type}: Math) <\table> \noindent {\bf data} SigmaType} = Sequence SigmaItem} \table {\bf data} GetComponent} = {\sf GetComponent}(\={\tt tuple}: Math
\>{\tt label}: Symbol}) <\table> \table {\bf data} Component} = {\sf Component}(\={\tt label}: Symbol},
\>{\tt value}: Math,
\>{\tt type}: Optional Math}) <\table> \noindent {\bf data} Tuple} = Sequence Component}
In this grammar the definition of the notion semi-group} is as follows: \noindent {\sf Definition}(
\hspace*{2mm}{\tt subject=} semi-group},
\hspace*{2mm}{\tt body=}{\sf SigmaType}(
\hspace*{4mm}{\sf SigmaItem}(
\hspace*{6mm}{\tt label=} Set},
\hspace*{6mm}{\tt type=} set})
\hspace*{4mm}{\sf SigmaItem}(
\hspace*{6mm}{\tt label=} Eq},
\hspace*{6mm}{\tt type=}{\sf PiType}(
\hspace*{8mm}{\tt domain=} Set},
\hspace*{8mm}{\tt range=}{\sf PiType}(
\hspace*{10mm}{\tt domain=} Set},
\hspace*{10mm}{\tt range=} prop}))),
\hspace*{4mm}{\sf SigmaItem}(
\hspace*{6mm}{\tt label=}$*$,
\hspace*{6mm}{\tt type=}{\sf PiType}(
\hspace*{8mm}{\tt domain=} Set},
\hspace*{8mm}{\tt range=}{\sf PiType}(
\hspace*{10mm}{\tt domain=} Set},
\hspace*{10mm}{\tt range=} Set}))),
\hspace*{4mm}{\sf SigmaItem}(
\hspace*{6mm}{\tt label=} Eq\_refl},
\hspace*{6mm}{\tt type=}\dots)
\hspace*{4mm}\dots)
A typical inhabitant of semi-group} is of form:
{\sf Tuple}(
\hspace*{2mm}{\sf Component}(
\hspace*{4mm}{\tt label=} Set},
\hspace*{4mm}{\tt value=} int})
\hspace*{2mm}{\sf Component}(
\hspace*{4mm}{\tt label=} Eq},
\hspace*{4mm}{\tt value=} eq},
\hspace*{4mm}{\tt type=}{\sf PiType}(
\hspace*{6mm}{\tt domain=} Set},
\hspace*{6mm}{\tt range=}{\sf PiType}(
\hspace*{8mm}{\tt domain=} Set},
\hspace*{8mm}{\tt range=} prop}))),
\hspace*{2mm}{\sf Component}(
\hspace*{4mm}{\tt label=}$*$,
\hspace*{4mm}{\tt value=} plus},
\hspace*{4mm}{\tt type=}{\sf PiType}(
\hspace*{6mm}{\tt domain=} Set},
\hspace*{6mm}{\tt range=}{\sf PiType}(
\hspace*{8mm}{\tt domain=} Set},
\hspace*{8mm}{\tt range=} Set}))),
\hspace*{2mm}{\sf Component}(
\hspace*{4mm}{\tt label=} Eq\_refl},
\hspace*{4mm}{\tt value=} eq\_refl},
\hspace*{4mm}{\tt type=}\dots)
\hspace*{2mm}\dots) Access to the proof of reflexivity of the equality of a tuple $t$ of type semi-group} can be obtained by {\sf GetComponent}({\tt tuple=}$t$,{\tt label=} Eq\_refl}). We will not give typing rules for this grammar, because it is only meant to obtain more notational convenience. Internally this notation will be transformed to the former representation to allow type checking.