Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/refrat/refrat.tex

    re945826 ra752883  
    1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
    2 %%
    3 %% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    4 %%
    5 %% The contents of this file are covered under the licence agreement in the
    6 %% file "LICENCE" distributed with Cforall.
    7 %%
    8 %% refrat.tex --
    9 %%
    10 %% Author           : Peter A. Buhr
    11 %% Created On       : Wed Apr  6 14:52:25 2016
    12 %% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sat Apr 30 13:45:40 2016
    14 %% Update Count     : 29
    15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    16 
    171% requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended
    18 
    19 % red highlighting ®...® (registered trademark sumbol)
    20 % blue highlighting ©...© (copyright symbol)
    21 % latex escape §...§ (section symbol)
    22 % keyword escape ¶...¶ (pilcrow symbol)
    23 % math escape $...$ (dollar symbol)
    242
    253\documentclass[openright,twoside]{report}
     
    275
    286% Latex packages used in the document.
     7
    298\usepackage{fullpage,times}
    309\usepackage{xspace}
     
    3211\usepackage{listings}
    3312\usepackage{comment}
    34 \usepackage{latexsym}                                   % \Box
    35 \usepackage{mathptmx}                                   % better math font with "times"
     13\usepackage{latexsym}                                   % \Box
     14\usepackage{mathptmx}                                   % better math font with "times"
    3615\usepackage[pagewise]{lineno}
    3716\renewcommand{\linenumberfont}{\scriptsize\sffamily}
     
    4221%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    4322
     23% Names used in the document.
     24
     25\newcommand{\CFA}{C$\forall$\xspace}    % set language symbolic name
     26\newcommand{\CFL}{Cforall\xspace}               % set language text name
     27\newcommand{\CC}{C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name
     28\def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)
     29
     30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     31
    4432% Bespoke macros used in the document.
    45 \input{common}
    46 
    47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    48 
    49 \setcounter{secnumdepth}{3}                             % number subsubsections
    50 \setcounter{tocdepth}{3}                                % subsubsections in table of contents
     33
     34\makeatletter
     35% allow escape sequence in lstinline
     36%\usepackage{etoolbox}
     37%\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
     38
     39\renewcommand\small{%
     40   \@setfontsize\small{8.5}{11}%
     41   \abovedisplayskip 8.5pt \@plus 3pt \@minus 4pt
     42   \abovedisplayshortskip \z@ \@plus 2pt
     43   \belowdisplayshortskip 4pt \@plus 2pt \@minus 2pt
     44   \def\@listi{\leftmargin\leftmargini
     45               \topsep 4pt \@plus 2pt \@minus 2pt
     46               \parsep 2pt \@pluspt \@minuspt
     47               \itemsep \parsep}%
     48   \belowdisplayskip \abovedisplayskip
     49}
     50\usepackage{relsize}            % must be after change to small
     51
     52\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
     53\renewenvironment{itemize}{\begin{list}{\labelitemi}{\topsep=5pt\itemsep=5pt\parsep=0pt}}{\end{list}}
     54
     55%  Reduce size of chapter/section titles
     56\def\@makechapterhead#1{%
     57  \vspace*{50\p@}%
     58  {\parindent \z@ \raggedright \normalfont
     59    \ifnum \c@secnumdepth >\m@ne
     60        \large\bfseries \@chapapp\space \thechapter
     61        \par\nobreak
     62        \vskip 5\p@
     63    \fi
     64    \interlinepenalty\@M
     65    \Large \bfseries #1\par\nobreak
     66    \vskip 50\p@
     67  }}
     68\def\@makeschapterhead#1{%
     69  \vspace*{50\p@}%
     70  {\parindent \z@ \raggedright
     71    \normalfont
     72    \interlinepenalty\@M
     73    \Large \bfseries  #1\par\nobreak
     74    \vskip 50\p@
     75  }}
     76\renewcommand\section{\@startsection{section}{1}{\z@}{-3.0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\large\bfseries}}
     77\renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
     78\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
     79\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}{-2.0ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries}}
     80
     81% index macros
     82\newcommand{\italic}[1]{\emph{\hyperpage{#1}}}
     83\newcommand{\definition}[1]{\textbf{\hyperpage{#1}}}
     84\newcommand{\see}[1]{\emph{see} #1}
     85
     86% Define some commands that produce formatted index entries suitable for cross-references.
     87% ``\spec'' produces entries for specifications of entities.  ``\impl'' produces entries for their
     88% implementations, and ``\use'' for their uses.
     89
     90%  \newcommand{\bold}[1]{{\bf #1}}
     91%  \def\spec{\@bsphack\begingroup
     92%             \def\protect##1{\string##1\space}\@sanitize
     93%             \@wrxref{|bold}}
     94\def\impl{\@bsphack\begingroup
     95          \def\protect##1{\string##1\space}\@sanitize
     96          \@wrxref{|definition}}
     97\newcommand{\indexcode}[1]{{\lstinline$#1$}}
     98\def\use{\@bsphack\begingroup
     99         \def\protect##1{\string##1\space}\@sanitize
     100         \@wrxref{|hyperpage}}
     101\def\@wrxref#1#2{\let\thepage\relax
     102    \xdef\@gtempa{\write\@indexfile{\string
     103    \indexentry{#2@{\lstinline$#2$}#1}{\thepage}}}\endgroup\@gtempa
     104    \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
     105%\newcommand{\use}[1]{\index{#1@{\lstinline$#1$}}}
     106%\newcommand{\impl}[1]{\index{\protect#1@{\lstinline$\protect#1$}|definition}}
     107
     108% inline text and lowercase index: \Index{inline and lowercase index text}
     109% inline text and as-in index: \Index[as-is index text]{inline text}
     110% inline text but index with different as-is text: \Index[index text]{inline text}
     111\newcommand{\Index}{\@ifstar\@sIndex\@Index}
     112\newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
     113\newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
     114\makeatother
     115
     116% blocks and titles
     117\newenvironment{rationale}{%
     118  \begin{quotation}\noindent$\Box$\enspace
     119}{%
     120  \hfill\enspace$\Box$\end{quotation}
     121}%
     122\newcommand{\define}[1]{\emph{#1\/}\index{#1}}
     123\newcommand{\rewrite}{\(\Rightarrow\)}
     124\newcommand{\rewriterules}{\paragraph{Rewrite Rules}~\par\noindent}
     125\newcommand{\examples}{\paragraph{Examples}~\par\noindent}
     126\newcommand{\semantics}{\paragraph{Semantics}~\par\noindent}
     127\newcommand{\constraints}{\paragraph{Constraints}~\par\noindent}
     128\newcommand{\predefined}{\paragraph{Predefined Identifiers}~\par\noindent}
     129
     130% BNF macros
     131\def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]}
     132\let\endsyntax=\endtrivlist
     133\newcommand{\lhs}[1]{\par{\emph{#1:}}\index{#1@{\emph{#1}}|italic}}
     134\newcommand{\rhs}{\hfil\break\hbox{\hskip1in}}
     135\newcommand{\oldlhs}[1]{\emph{#1: \ldots}\index{#1@{\emph{#1}}|italic}}
     136\newcommand{\nonterm}[1]{\emph{#1\/}\index{#1@{\emph{#1}}|italic}}
     137\newcommand{\opt}{$_{opt}$\ }
     138
     139% adjust varioref package with default "section" and "page" titles, and optional title with faraway page numbers
     140% \VRef{label} => Section 2.7, \VPageref{label} => page 17
     141% \VRef[Figure]{label} => Figure 3.4, \VPageref{label} => page 17
     142\renewcommand{\reftextfaceafter}{\unskip}
     143\renewcommand{\reftextfacebefore}{\unskip}
     144\renewcommand{\reftextafter}{\unskip}
     145\renewcommand{\reftextbefore}{\unskip}
     146\renewcommand{\reftextfaraway}[1]{\unskip, p.~\pageref{#1}}
     147\renewcommand{\reftextpagerange}[2]{\unskip, pp.~\pageref{#1}--\pageref{#2}}
     148\newcommand{\VRef}[2][Section]{\ifx#1\@empty\else{#1}\nobreakspace\fi\vref{#2}}
     149\newcommand{\VPageref}[2][page]{\ifx#1\@empty\else{#1}\nobreakspace\fi\pageref{#2}}
     150
     151% CFA based on ANSI C
     152\lstdefinelanguage{CFA}[ANSI]{C}%
     153{morekeywords={asm,_Alignas,_Alignof,_At,_Atomic,_Bool,catch,catchResume,choose,_Complex,trait,disable,dtype,enable,
     154        fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,lvalue,_Noreturn,otype,restrict,_Static_assert,
     155        _Thread_local,throw,throwResume,try,},
     156}%
     157
     158\lstset{
     159language=CFA,
     160columns=flexible,
     161basicstyle=\sf\relsize{-1},
     162tabsize=4,
     163xleftmargin=\parindent,
     164escapechar=@,
     165keepspaces=true,
     166showstringspaces=false,
     167showlines=true,
     168}%
     169
     170\makeatletter
     171% replace/adjust listings characters that look bad in sanserif
     172\lst@CCPutMacro
     173\lst@ProcessOther{"2D}{\lst@ttfamily{-{}}{{\ttfamily\upshape -}}} % replace minus
     174\lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than
     175\lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than
     176\lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex
     177\lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore
     178\lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde
     179%\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde
     180\@empty\z@\@empty
     181\makeatother
     182
     183\setcounter{secnumdepth}{3}     % number subsubsections
     184\setcounter{tocdepth}{3}                % subsubsections in table of contents
    51185\makeindex
    52186
     
    55189\begin{document}
    56190\pagestyle{headings}
    57 \linenumbers                                            % comment out to turn off line numbering
     191\linenumbers                                    % comment out to turn off line numbering
    58192
    59193\title{\Huge
    60 \vspace*{1in}
    61194\CFA (\CFL) Reference Manual and Rationale
    62195}% title
     
    93226
    94227This document is a reference manual and rationale for \CFA, a polymorphic extension of the C programming language.
    95 It makes frequent reference to the {\c11} standard \cite{C11}, and occasionally compares \CFA to {\CC} \cite{C++}.
     228It makes frequent reference to the {\c11} standard \cite{ANS:C11}, and occasionally compares \CFA to {\CC} \cite{c++}.
    96229
    97230The manual deliberately imitates the ordering of the {\c11} standard (although the section numbering differs).
     
    131264\CFA's scope rules differ from C's in one major respect: a declaration of an identifier may overload\index{overloading} outer declarations of lexically identical identifiers in the same
    132265\Index{name space}, instead of hiding them.
    133 The outer declaration is hidden if the two declarations have \Index{compatible type}, or if one declares an array type and the other declares a pointer type and the element type and pointed-at type are compatible, or if one has function type and the other is a pointer to a compatible function type, or if one declaration is a \lstinline@type@\use{type} or
    134 \lstinline@typedef@\use{typedef} declaration and the other is not.  The outer declaration becomes
     266The outer declaration is hidden if the two declarations have \Index{compatible type}, or if one declares an array type and the other declares a pointer type and the element type and pointed-at type are compatible, or if one has function type and the other is a pointer to a compatible function type, or if one declaration is a \lstinline$type$\use{type} or
     267\lstinline$typedef$\use{typedef} declaration and the other is not.  The outer declaration becomes
    135268\Index{visible} when the scope of the inner declaration terminates.
    136269\begin{rationale}
    137 Hence, a \CFA program can declare an \lstinline@int v@ and a \lstinline@float v@ in the same scope;
     270Hence, a \CFA program can declare an \lstinline$int v$ and a \lstinline$float v$ in the same scope;
    138271a {\CC} program can not.
    139272\end{rationale}
     
    149282Identifiers with \Index{no linkage} always denote unique entities.
    150283\begin{rationale}
    151 A \CFA program can declare an \lstinline@extern int v@ and an \lstinline@extern float v@;
     284A \CFA program can declare an \lstinline$extern int v$ and an \lstinline$extern float v$;
    152285a C program cannot.
    153286\end{rationale}
     
    172305\end{lstlisting}
    173306
    174 The type parameters in an instantiation of a generic type must satisfy any constraints in the forall specifier on the type generator declaration, e.g., \lstinline@sumable@.
     307The type parameters in an instantiation of a generic type must satisfy any constraints in the forall specifier on the type generator declaration, e.g., \lstinline$sumable$.
    175308The instantiation then has the semantics that would result if the type parameters were substituted into the type generator declaration by macro substitution.
    176309
     
    233366In \CFA, these conversions play a role in overload resolution, and collectively are called the \define{safe arithmetic conversion}s.
    234367
    235 Let \lstinline@int$_r$@ and \lstinline@unsigned$_r$@ be the signed and unsigned integer types with integer conversion rank\index{integer conversion rank}\index{rank|see{integer conversion rank}} $r$.
    236 Let \lstinline@unsigned$_{mr}$@ be the unsigned integer type with maximal rank.
     368Let \(int_r\) and \(unsigned_r\) be the signed and unsigned integer types with integer conversion rank\index{integer conversion rank}\index{rank|see{integer conversion rank}} $r$.
     369Let \(unsigned_{mr}\) be the unsigned integer type with maximal rank.
    237370
    238371The following conversions are \emph{direct} safe arithmetic conversions.
     
    241374The \Index{integer promotion}s.
    242375\item
    243 For every rank $r$ greater than or equal to the rank of \lstinline@int@, conversion from \lstinline@int$_r$@ to \lstinline@unsigned$_r$@.
    244 \item
    245 For every rank $r$ greater than or equal to the rank of \lstinline@int@, where \lstinline@int$_{r+1}$@ exists and can represent all values of \lstinline@unsigned$_r$@, conversion from \lstinline@unsigned$_r$@ to \lstinline@int$_{r+1}$@.
    246 \item
    247 Conversion from \lstinline@unsigned$_{mr}$@ to \lstinline@float@.
     376For every rank $r$ greater than or equal to the rank of \lstinline$int$, conversion from \(int_r\) to \(unsigned_r\).
     377\item
     378For every rank $r$ greater than or equal to the rank of \lstinline$int$, where \(int_{r+1}\) exists and can represent all values of \(unsigned_r\), conversion from \(unsigned_r\) to \(int_{r+1}\).
     379\item
     380Conversion from \(unsigned_{mr}\) to \lstinline$float$.
    248381\item
    249382Conversion from an enumerated type to its compatible integer type.
    250383\item
    251 Conversion from \lstinline@float@ to \lstinline@double@, and from \lstinline@double@ to \lstinline@long double@.
    252 \item
    253 Conversion from \lstinline@float _Complex@ to \lstinline@double _Complex@, and from \lstinline@double _Complex@ to \lstinline@long double _Complex@.
     384Conversion from \lstinline$float$ to \lstinline$double$, and from \lstinline$double$ to \lstinline$long double$.
     385\item
     386Conversion from \lstinline$float _Complex$ to \lstinline$double _Complex$, and from \lstinline$double _Complex$ to \lstinline$long double _Complex$.
    254387\begin{sloppypar}
    255388\item
    256 Conversion from \lstinline@float _Imaginary@ to \lstinline@double _Imaginary@, and from \lstinline@double _Imaginary@ to \lstinline@long double _Imaginary@, if the implementation supports imaginary types.
     389Conversion from \lstinline$float _Imaginary$ to \lstinline$double _Imaginary$, and from \lstinline$double _Imaginary$ to \lstinline$long double$ \lstinline$_Imaginary$, if the implementation supports imaginary types.
    257390\end{sloppypar}
    258391\end{itemize}
    259392
    260 If type \lstinline@T@ can be converted to type \lstinline@U@ by a safe direct arithmetic conversion and type \lstinline@U@ can be converted to type \lstinline@V@ by a safe arithmetic conversion, then the conversion from \lstinline@T@ to type \lstinline@V@ is an \emph{indirect} safe arithmetic conversion.
     393If type \lstinline$T$ can be converted to type \lstinline$U$ by a safe direct arithmetic conversion and type \lstinline$U$ can be converted to type \lstinline$V$ by a safe arithmetic conversion, then the conversion from \lstinline$T$ to type \lstinline$V$ is an \emph{indirect} safe arithmetic conversion.
    261394
    262395\begin{rationale}
     
    281414        int x, y;
    282415};
    283 void move_by( struct point * p1, struct point * p2 ) {§\impl{move_by}§
     416void move_by( struct point * p1, struct point * p2 ) {@\impl{move_by}@
    284417        p1->x += p2.x;
    285418        p1->y += p2.y;
     
    291424move_to( &cp1, &cp2 );
    292425\end{lstlisting}
    293 Thanks to implicit conversion, the two arguments that \lstinline@move_by()@ receives are pointers to
    294 \lstinline@cp1@'s second member and \lstinline@cp2@'s second member.
     426Thanks to implicit conversion, the two arguments that \lstinline$move_by()$ receives are pointers to
     427\lstinline$cp1$'s second member and \lstinline$cp2$'s second member.
    295428
    296429
     
    334467a direct safe arithmetic conversion;
    335468\item
    336 from any object type or incomplete type to \lstinline@void@;
    337 \item
    338 from a pointer to any non-\lstinline@void@ type to a pointer to \lstinline@void@;
     469from any object type or incomplete type to \lstinline$void$;
     470\item
     471from a pointer to any non-\lstinline$void$ type to a pointer to \lstinline$void$;
    339472\item
    340473from a pointer to any type to a pointer to a more qualified version of the type\index{qualified type};
     
    347480Conversions that are not safe conversions are \define{unsafe conversion}s.
    348481\begin{rationale}
    349 As in C, there is an implicit conversion from \lstinline@void *@ to any pointer type.
     482As in C, there is an implicit conversion from \lstinline$void *$ to any pointer type.
    350483This is clearly dangerous, and {\CC} does not have this implicit conversion.
    351484\CFA\index{deficiencies!void * conversion} keeps it, in the interest of remaining as pure a superset of C as possible, but discourages it by making it unsafe.
     
    373506\begin{itemize}
    374507\item
    375 The cost of an implicit conversion from \lstinline@int@ to \lstinline@long@ is 1.
    376 The cost of an implicit conversion from \lstinline@long@ to \lstinline@double@ is 3, because it is defined in terms of conversions from \lstinline@long@ to \lstinline@unsigned long@, then to \lstinline@float@, and then to \lstinline@double@.
    377 
    378 \item
    379 If \lstinline@int@ can represent all the values of \lstinline@unsigned short@, then the cost of an implicit conversion from \lstinline@unsigned short@ to \lstinline@unsigned@ is 2:
    380 \lstinline@unsigned short@ to \lstinline@int@ to \lstinline@unsigned@.
    381 Otherwise, \lstinline@unsigned short@ is converted directly to \lstinline@unsigned@, and the cost is 1.
    382 
    383 \item
    384 If \lstinline@long@ can represent all the values of \lstinline@unsigned@, then the conversion cost of \lstinline@unsigned@ to \lstinline@long@ is 1.
     508The cost of an implicit conversion from \lstinline$int$ to \lstinline$long$ is 1.
     509The cost of an implicit conversion from \lstinline$long$ to \lstinline$double$ is 3, because it is defined in terms of conversions from \lstinline$long$ to \lstinline$unsigned long$, then to \lstinline$float$, and then to \lstinline$double$.
     510
     511\item
     512If \lstinline$int$ can represent all the values of \lstinline$unsigned short$, then the cost of an implicit conversion from \lstinline$unsigned short$ to \lstinline$unsigned$ is 2:
     513\lstinline$unsigned short$ to \lstinline$int$ to \lstinline$unsigned$.
     514Otherwise, \lstinline$unsigned short$ is converted directly to \lstinline$unsigned$, and the cost is 1.
     515
     516\item
     517If \lstinline$long$ can represent all the values of \lstinline$unsigned$, then the conversion cost of \lstinline$unsigned$ to \lstinline$long$ is 1.
    385518Otherwise, the conversion is an unsafe conversion, and its conversion cost is undefined.
    386519\end{itemize}
     
    390523\begin{syntax}
    391524\oldlhs{keyword}
    392         \rhs \lstinline@forall@
    393         \rhs \lstinline@lvalue@
    394         \rhs \lstinline@trait@
    395         \rhs \lstinline@dtype@
    396         \rhs \lstinline@ftype@
    397         \rhs \lstinline@otype@
     525        \rhs \lstinline$forall$
     526        \rhs \lstinline$lvalue$
     527        \rhs \lstinline$trait$
     528        \rhs \lstinline$dtype$
     529        \rhs \lstinline$ftype$
     530        \rhs \lstinline$type$
    398531\end{syntax}
    399532
     
    402535
    403536\CFA allows operator \Index{overloading} by associating operators with special function identifiers.
    404 Furthermore, the constants ``\lstinline@0@'' and ``\lstinline@1@'' have special status for many of C's data types (and for many programmer-defined data types as well), so \CFA treats them as overloadable identifiers.
     537Furthermore, the constants ``\lstinline$0$'' and ``\lstinline$1$'' have special status for many of C's data types (and for many programmer-defined data types as well), so \CFA treats them as overloadable identifiers.
    405538Programmers can use these identifiers to declare functions and objects that implement operators and constants for their own types.
    406539
     
    411544\begin{syntax}
    412545\oldlhs{identifier}
    413 \rhs \lstinline@0@
    414 \rhs \lstinline@1@
     546\rhs \lstinline$0$
     547\rhs \lstinline$1$
    415548\end{syntax}
    416549
    417 \index{constant identifiers}\index{identifiers!for constants} The tokens ``\lstinline@0@''\impl{0} and ``\lstinline@1@''\impl{1} are identifiers.
     550\index{constant identifiers}\index{identifiers!for constants} The tokens ``\lstinline$0$''\impl{0} and ``\lstinline$1$''\impl{1} are identifiers.
    418551No other tokens defined by the rules for integer constants are considered to be identifiers.
    419552\begin{rationale}
    420 Why ``\lstinline@0@'' and ``\lstinline@1@''? Those integers have special status in C.
     553Why ``\lstinline$0$'' and ``\lstinline$1$''? Those integers have special status in C.
    421554All scalar types can be incremented and decremented, which is defined in terms of adding or subtracting 1.
    422 The operations ``\lstinline@&&@'', ``\lstinline@||@'', and ``\lstinline@!@'' can be applied to any scalar arguments, and are defined in terms of comparison against 0.
     555The operations ``\lstinline$&&$'', ``\lstinline$||$'', and ``\lstinline$!$'' can be applied to any scalar arguments, and are defined in terms of comparison against 0.
    423556A \nonterm{constant-expression} that evaluates to 0 is effectively compatible with every pointer type.
    424557
    425558In C, the integer constants 0 and 1 suffice because the integer promotion rules can convert them to any arithmetic type, and the rules for pointer expressions treat constant expressions evaluating to 0 as a special case.
    426559However, user-defined arithmetic types often need the equivalent of a 1 or 0 for their functions or operators, polymorphic functions often need 0 and 1 constants of a type matching their polymorphic parameters, and user-defined pointer-like types may need a null value.
    427 Defining special constants for a user-defined type is more efficient than defining a conversion to the type from \lstinline@_Bool@.
    428 
    429 Why \emph{just} ``\lstinline@0@'' and ``\lstinline@1@''? Why not other integers? No other integers have special status in C.
    430 A facility that let programmers declare specific constants---``\lstinline@const Rational 12@'', for instance---would not be much of an improvement.
     560Defining special constants for a user-defined type is more efficient than defining a conversion to the type from \lstinline$_Bool$.
     561
     562Why \emph{just} ``\lstinline$0$'' and ``\lstinline$1$''? Why not other integers? No other integers have special status in C.
     563A facility that let programmers declare specific constants---``\lstinline$const Rational 12$'', for instance---would not be much of an improvement.
    431564Some facility for defining the creation of values of programmer-defined types from arbitrary integer tokens would be needed.
    432565The complexity of such a feature doesn't seem worth the gain.
     
    444577\begin{tabular}[t]{ll}
    445578%identifier & operation \\ \hline
    446 \lstinline@?[?]@ & subscripting \impl{?[?]}\\
    447 \lstinline@?()@ & function call \impl{?()}\\
    448 \lstinline@?++@ & postfix increment \impl{?++}\\
    449 \lstinline@?--@ & postfix decrement \impl{?--}\\
    450 \lstinline@++?@ & prefix increment \impl{++?}\\
    451 \lstinline@--?@ & prefix decrement \impl{--?}\\
    452 \lstinline@*?@ & dereference \impl{*?}\\
    453 \lstinline@+?@ & unary plus \impl{+?}\\
    454 \lstinline@-?@ & arithmetic negation \impl{-?}\\
    455 \lstinline@~?@ & bitwise negation \impl{~?}\\
    456 \lstinline@!?@ & logical complement \impl{"!?}\\
    457 \lstinline@?*?@ & multiplication \impl{?*?}\\
    458 \lstinline@?/?@ & division \impl{?/?}\\
     579\lstinline$?[?]$ & subscripting \impl{?[?]}\\
     580\lstinline$?()$ & function call \impl{?()}\\
     581\lstinline$?++$ & postfix increment \impl{?++}\\
     582\lstinline$?--$ & postfix decrement \impl{?--}\\
     583\lstinline$++?$ & prefix increment \impl{++?}\\
     584\lstinline$--?$ & prefix decrement \impl{--?}\\
     585\lstinline$*?$ & dereference \impl{*?}\\
     586\lstinline$+?$ & unary plus \impl{+?}\\
     587\lstinline$-?$ & arithmetic negation \impl{-?}\\
     588\lstinline$~?$ & bitwise negation \impl{~?}\\
     589\lstinline$!?$ & logical complement \impl{"!?}\\
     590\lstinline$?*?$ & multiplication \impl{?*?}\\
     591\lstinline$?/?$ & division \impl{?/?}\\
    459592\end{tabular}\hfil
    460593\begin{tabular}[t]{ll}
    461594%identifier & operation \\ \hline
    462 \lstinline@?%?@ & remainder \impl{?%?}\\
    463 \lstinline@?+?@ & addition \impl{?+?}\\
    464 \lstinline@?-?@ & subtraction \impl{?-?}\\
    465 \lstinline@?<<?@ & left shift \impl{?<<?}\\
    466 \lstinline@?>>?@ & right shift \impl{?>>?}\\
    467 \lstinline@?<?@ & less than \impl{?<?}\\
    468 \lstinline@?<=?@ & less than or equal \impl{?<=?}\\
    469 \lstinline@?>=?@ & greater than or equal \impl{?>=?}\\
    470 \lstinline@?>?@ & greater than \impl{?>?}\\
    471 \lstinline@?==?@ & equality \impl{?==?}\\
    472 \lstinline@?!=?@ & inequality \impl{?"!=?}\\
    473 \lstinline@?&?@ & bitwise AND \impl{?&?}\\
     595\lstinline$?%?$ & remainder \impl{?%?}\\
     596\lstinline$?+?$ & addition \impl{?+?}\\
     597\lstinline$?-?$ & subtraction \impl{?-?}\\
     598\lstinline$?<<?$ & left shift \impl{?<<?}\\
     599\lstinline$?>>?$ & right shift \impl{?>>?}\\
     600\lstinline$?<?$ & less than \impl{?<?}\\
     601\lstinline$?<=?$ & less than or equal \impl{?<=?}\\
     602\lstinline$?>=?$ & greater than or equal \impl{?>=?}\\
     603\lstinline$?>?$ & greater than \impl{?>?}\\
     604\lstinline$?==?$ & equality \impl{?==?}\\
     605\lstinline$?!=?$ & inequality \impl{?"!=?}\\
     606\lstinline$?&?$ & bitwise AND \impl{?&?}\\
    474607\end{tabular}\hfil
    475608\begin{tabular}[t]{ll}
    476609%identifier & operation \\ \hline
    477 \lstinline@?^?@ & exclusive OR \impl{?^?}\\
    478 \lstinline@?|?@ & inclusive OR \impl{?"|?}\\
    479 \lstinline@?=?@ & simple assignment \impl{?=?}\\
    480 \lstinline@?*=?@ & multiplication assignment \impl{?*=?}\\
    481 \lstinline@?/=?@ & division assignment \impl{?/=?}\\
    482 \lstinline@?%=?@ & remainder assignment \impl{?%=?}\\
    483 \lstinline@?+=?@ & addition assignment \impl{?+=?}\\
    484 \lstinline@?-=?@ & subtraction assignment \impl{?-=?}\\
    485 \lstinline@?<<=?@ & left-shift assignment \impl{?<<=?}\\
    486 \lstinline@?>>=?@ & right-shift assignment \impl{?>>=?}\\
    487 \lstinline@?&=?@ & bitwise AND assignment \impl{?&=?}\\
    488 \lstinline@?^=?@ & exclusive OR assignment \impl{?^=?}\\
    489 \lstinline@?|=?@ & inclusive OR assignment \impl{?"|=?}\\
     610\lstinline$?^?$ & exclusive OR \impl{?^?}\\
     611\lstinline$?|?$ & inclusive OR \impl{?"|?}\\
     612\lstinline$?=?$ & simple assignment \impl{?=?}\\
     613\lstinline$?*=?$ & multiplication assignment \impl{?*=?}\\
     614\lstinline$?/=?$ & division assignment \impl{?/=?}\\
     615\lstinline$?%=?$ & remainder assignment \impl{?%=?}\\
     616\lstinline$?+=?$ & addition assignment \impl{?+=?}\\
     617\lstinline$?-=?$ & subtraction assignment \impl{?-=?}\\
     618\lstinline$?<<=?$ & left-shift assignment \impl{?<<=?}\\
     619\lstinline$?>>=?$ & right-shift assignment \impl{?>>=?}\\
     620\lstinline$?&=?$ & bitwise AND assignment \impl{?&=?}\\
     621\lstinline$?^=?$ & exclusive OR assignment \impl{?^=?}\\
     622\lstinline$?|=?$ & inclusive OR assignment \impl{?"|=?}\\
    490623\end{tabular}
    491624\hfil
     
    502635
    503636\begin{rationale}
    504 The use of ``\lstinline@?@'' in identifiers means that some C programs are not \CFA programs.  For instance, the sequence of characters ``\lstinline@(i < 0)?--i:i@'' is legal in a C program, but a
    505 \CFA compiler detects a syntax error because it treats ``\lstinline@?--@'' as an identifier, not as the two tokens ``\lstinline@?@'' and ``\lstinline@--@''.
     637The use of ``\lstinline$?$'' in identifiers means that some C programs are not \CFA programs.  For instance, the sequence of characters ``\lstinline$(i < 0)?--i:i$'' is legal in a C program, but a
     638\CFA compiler detects a syntax error because it treats ``\lstinline$?--$'' as an identifier, not as the two tokens ``\lstinline$?$'' and ``\lstinline$--$''.
    506639\end{rationale}
    507640
     
    510643\begin{itemize}
    511644\item
    512 The logical operators ``\lstinline@&&@'' and ``\lstinline@||@'', and the conditional operator
    513 ``\lstinline@?:@''.
     645The logical operators ``\lstinline$&&$'' and ``\lstinline$||$'', and the conditional operator
     646``\lstinline$?:$''.
    514647These operators do not always evaluate their operands, and hence can not be properly defined by functions unless some mechanism like call-by-name is added to the language.
    515 Note that the definitions of ``\lstinline@&&@'' and ``\lstinline@||@'' say that they work by checking that their arguments are unequal to 0, so defining ``\lstinline@!=@'' and ``\lstinline@0@'' for user-defined types is enough to allow them to be used in logical expressions.
     648Note that the definitions of ``\lstinline$&&$'' and ``\lstinline$||$'' say that they work by checking that their arguments are unequal to 0, so defining ``\lstinline$!=$'' and ``\lstinline$0$'' for user-defined types is enough to allow them to be used in logical expressions.
    516649
    517650\item
     
    522655\item
    523656The ``address of'' operator.
    524 It would seem useful to define a unary ``\lstinline@&@'' operator that returns values of some programmer-defined pointer-like type.
     657It would seem useful to define a unary ``\lstinline$&$'' operator that returns values of some programmer-defined pointer-like type.
    525658The problem lies with the type of the operator.
    526 Consider the expression ``\lstinline@p = &x@'', where \lstinline@x@ is of type
    527 \lstinline@T@ and \lstinline@p@ has the programmer-defined type \lstinline@T_ptr@.
    528 The expression might be treated as a call to the unary function ``\lstinline@&?@''.
    529 Now what is the type of the function's parameter? It can not be \lstinline@T@, because then \lstinline@x@ would be passed by value, and there is no way to create a useful pointer-like result from a value.
    530 Hence the parameter must have type \lstinline@T *@.
    531 But then the expression must be rewritten as ``\lstinline@p = &?( &x )@''
     659Consider the expression ``\lstinline$p = &x$'', where \lstinline$x$ is of type
     660\lstinline$T$ and \lstinline$p$ has the programmer-defined type \lstinline$T_ptr$.
     661The expression might be treated as a call to the unary function ``\lstinline$&?$''.
     662Now what is the type of the function's parameter? It can not be \lstinline$T$, because then \lstinline$x$ would be passed by value, and there is no way to create a useful pointer-like result from a value.
     663Hence the parameter must have type \lstinline$T *$.
     664But then the expression must be rewritten as ``\lstinline$p = &?( &x )$''
    532665---which doesn't seem like progress!
    533666
    534667The rule for address-of expressions would have to be something like ``keep applying address-of functions until you get one that takes a pointer argument, then use the built-in operator and stop''.
    535 It seems simpler to define a conversion function from \lstinline@T *@ to \lstinline@T_ptr@.
    536 
    537 \item
    538 The \lstinline@sizeof@ operator.
     668It seems simpler to define a conversion function from \lstinline$T *$ to \lstinline$T_ptr$.
     669
     670\item
     671The \lstinline$sizeof$ operator.
    539672It is already defined for every object type, and intimately tied into the language's storage allocation model.
    540673Redefining it seems pointless.
    541674
    542675\item
    543 The ``member of'' operators ``\lstinline@.@'' and ``\lstinline@->@''.
     676The ``member of'' operators ``\lstinline$.$'' and ``\lstinline$->$''.
    544677These are not really infix operators, since their right ``operand'' is not a value or object.
    545678
     
    578711The ``fewest unsafe conversions'' rule ensures that the usual conversions are done, if possible.
    579712The ``lowest total expression cost'' rule chooses the proper common type.
    580 The odd-looking ``highest argument conversion cost'' rule ensures that, when unary expressions must be converted, conversions of function results are preferred to conversion of function arguments: \lstinline@(double)-i@ will be preferred to \lstinline@-(double)i@.
     713The odd-looking ``highest argument conversion cost'' rule ensures that, when unary expressions must be converted, conversions of function results are preferred to conversion of function arguments: \lstinline$(double)-i$ will be preferred to \lstinline$-(double)i$.
    581714
    582715The ``least polymorphic'' rule reduces the number of polymorphic function calls, since such functions are presumably more expensive than monomorphic functions and since the more specific function is presumably more appropriate.
    583716It also gives preference to monomorphic values (such as the
    584 \lstinline@int@ \lstinline@0@) over polymorphic values (such as the \Index{null pointer}
    585 \lstinline@0@\use{0}).
     717\lstinline$int$ \lstinline$0$) over polymorphic values (such as the \Index{null pointer}
     718\lstinline$0$\use{0}).
    586719However, interpretations that call polymorphic functions are preferred to interpretations that perform unsafe conversions, because those conversions potentially lose accuracy or violate strong typing.
    587720
    588721There are two notable differences between \CFA's overload resolution rules and the rules for
    589 {\CC} defined in \cite{C++}.
     722{\CC} defined in \cite{c++}.
    590723First, the result type of a function plays a role.
    591724In {\CC}, a function call must be completely resolved based on the arguments to the call in most circumstances.
     
    603736\begin{rationale}
    604737Predefined functions and constants have internal linkage because that simplifies optimization in traditional compile-and-link environments.
    605 For instance, ``\lstinline@an_int + an_int@'' is equivalent to ``\lstinline@?+?(an_int, an_int)@''.
     738For instance, ``\lstinline$an_int + an_int$'' is equivalent to ``\lstinline$?+?(an_int, an_int)$''.
    606739If integer addition has not been redefined in the current scope, a compiler can generate code to perform the addition directly.
    607740If predefined functions had external linkage, this optimization would be difficult.
     
    629762\rhs \nonterm{constant}
    630763\rhs \nonterm{string-literal}
    631 \rhs \lstinline@(@ \nonterm{expression} \lstinline@)@
     764\rhs \lstinline$($ \nonterm{expression} \lstinline$)$
    632765\rhs \nonterm{generic-selection}
    633766\end{syntax}
     
    635768\predefined
    636769\begin{lstlisting}
    637 const int 1;§\use{1}§
    638 const int 0;§\use{0}§
     770const int 1;@\use{1}@
     771const int 0;@\use{0}@
    639772forall( dtype DT ) DT * const 0;
    640773forall( ftype FT ) FT * const 0;
     
    645778
    646779A \nonterm{constant} or \nonterm{string-literal} has one valid interpretation, which has the type and value defined by {\c11}.
    647 The predefined integer identifiers ``\lstinline@1@'' and ``\lstinline@0@'' have the integer values 1 and 0, respectively.
    648 The other two predefined ``\lstinline@0@'' identifiers are bound to polymorphic pointer values that, when specialized\index{specialization} with a data type or function type respectively, produce a null pointer of that type.
     780The predefined integer identifiers ``\lstinline$1$'' and ``\lstinline$0$'' have the integer values 1 and 0, respectively.
     781The other two predefined ``\lstinline$0$'' identifiers are bound to polymorphic pointer values that, when specialized\index{specialization} with a data type or function type respectively, produce a null pointer of that type.
    649782
    650783A parenthesised expression has the same interpretations as the contained \nonterm{expression}.
    651784
    652785\examples
    653 The expression \lstinline@(void *)0@\use{0} specializes the (polymorphic) null pointer to a null pointer to \lstinline@void@. \lstinline@(const void *)0@ does the same, and also uses a safe conversion from \lstinline@void *@ to \lstinline@const void *@.
     786The expression \lstinline$(void *)0$\use{0} specializes the (polymorphic) null pointer to a null pointer to \lstinline$void$. \lstinline$(const void *)0$ does the same, and also uses a safe conversion from \lstinline$void *$ to \lstinline$const void *$.
    654787In each case, the null pointer conversion is better\index{best valid interpretations} than the unsafe conversion of the integer
    655 \lstinline@0@ to a pointer.
     788\lstinline$0$ to a pointer.
    656789
    657790\begin{rationale}
     
    659792
    660793\CFA does not have C's concept of ``null pointer constants'', which are not typed values but special strings of tokens.
    661 The C token ``\lstinline@0@'' is an expression of type \lstinline@int@ with the value ``zero'', and it \emph{also} is a null pointer constant.
     794The C token ``\lstinline$0$'' is an expression of type \lstinline$int$ with the value ``zero'', and it \emph{also} is a null pointer constant.
    662795Similarly,
    663 ``\lstinline@(void *)0@ is an expression of type \lstinline@(void *)@ whose value is a null pointer, and it also is a null pointer constant.
    664 However, in C, ``\lstinline@(void *)(void *)0@'' is
     796``\lstinline$(void *)0$ is an expression of type \lstinline$(void *)$ whose value is a null pointer, and it also is a null pointer constant.
     797However, in C, ``\lstinline$(void *)(void *)0$'' is
    665798\emph{not} a null pointer constant, even though it is null-valued, a pointer, and constant! The semantics of C expressions contain many special cases to deal with subexpressions that are null pointer constants.
    666799
     
    669802\begin{lstlisting}
    670803forall( dtype DT ) DT * const 0;
    671 \end{lstlisting} means that \lstinline@0@ is a polymorphic object, and contains a value that can have \emph{any} pointer-to-object type or pointer-to-incomplete type.
     804\end{lstlisting} means that \lstinline$0$ is a polymorphic object, and contains a value that can have \emph{any} pointer-to-object type or pointer-to-incomplete type.
    672805The only such value is the null pointer.
    673806Therefore the type \emph{alone} is enough to identify a null pointer.
     
    679812
    680813\constraints The best interpretation of the controlling expression shall be unambiguous\index{ambiguous interpretation}, and shall have type compatible with at most one of the types named in its generic association list.
    681 If a generic selection has no \lstinline@default@ generic association, the best interpretation of its controlling expression shall have type compatible with exactly one of the types named in its generic association list.
     814If a generic selection has no \lstinline$default$ generic association, the best interpretation of its controlling expression shall have type compatible with exactly one of the types named in its generic association list.
    682815
    683816\semantics
     
    690823\lhs{postfix-expression}
    691824\rhs \nonterm{primary-expression}
    692 \rhs \nonterm{postfix-expression} \lstinline@[@ \nonterm{expression} \lstinline@]@
    693 \rhs \nonterm{postfix-expression} \lstinline@(@
    694          \nonterm{argument-expression-list}\opt \lstinline@)@
    695 \rhs \nonterm{postfix-expression} \lstinline@.@ \nonterm{identifier}
    696 \rhs \nonterm{postfix-expression} \lstinline@->@ \nonterm{identifier}
    697 \rhs \nonterm{postfix-expression} \lstinline@++@
    698 \rhs \nonterm{postfix-expression} \lstinline@--@
    699 \rhs \lstinline@(@ \nonterm{type-name} \lstinline@)@ \lstinline@{@ \nonterm{initializer-list} \lstinline@}@
    700 \rhs \lstinline@(@ \nonterm{type-name} \lstinline@)@ \lstinline@{@ \nonterm{initializer-list} \lstinline@,@ \lstinline@}@
     825\rhs \nonterm{postfix-expression} \lstinline$[$ \nonterm{expression} \lstinline$]$
     826\rhs \nonterm{postfix-expression} \lstinline$($
     827         \nonterm{argument-expression-list}\opt \lstinline$)$
     828\rhs \nonterm{postfix-expression} \lstinline$.$ \nonterm{identifier}
     829\rhs \nonterm{postfix-expression} \lstinline$->$ \nonterm{identifier}
     830\rhs \nonterm{postfix-expression} \lstinline$++$
     831\rhs \nonterm{postfix-expression} \lstinline$--$
     832\rhs \lstinline$($ \nonterm{type-name} \lstinline$)$ \lstinline${$ \nonterm{initializer-list} \lstinline$}$
     833\rhs \lstinline$($ \nonterm{type-name} \lstinline$)$ \lstinline${$ \nonterm{initializer-list} \lstinline$,$ \lstinline$}$
    701834\lhs{argument-expression-list}
    702835\rhs \nonterm{assignment-expression}
    703 \rhs \nonterm{argument-expression-list} \lstinline@,@
     836\rhs \nonterm{argument-expression-list} \lstinline$,$
    704837         \nonterm{assignment-expression}
    705838\end{syntax}
     
    707840\rewriterules
    708841\begin{lstlisting}
    709 a[b] §\rewrite§ ?[?]( b, a ) // if a has integer type§\use{?[?]}§
    710 a[b] §\rewrite§ ?[?]( a, b ) // otherwise
    711 a( §\emph{arguments}§ ) §\rewrite§ ?()( a, §\emph{arguments}§ )§\use{?()}§
    712 a++ §\rewrite§ ?++(&( a ))§\use{?++}§
    713 a-- §\rewrite§ ?--(&( a ))§\use{?--}§
     842a[b] @\rewrite@ ?[?]( b, a ) // if a has integer type@\use{?[?]}@
     843a[b] @\rewrite@ ?[?]( a, b ) // otherwise
     844a( @\emph{arguments}@ ) @\rewrite@ ?()( a, @\emph{arguments}@ )@\use{?()}@
     845a++ @\rewrite@ ?++(&( a ))@\use{?++}@
     846a-- @\rewrite@ ?--(&( a ))@\use{?--}@
    714847\end{lstlisting}
    715848
     
    719852\predefined
    720853\begin{lstlisting}
    721 forall( otype T ) lvalue T ?[?]( T *, ptrdiff_t );§\use{ptrdiff_t}§
     854forall( otype T ) lvalue T ?[?]( T *, ptrdiff_t );@\use{ptrdiff_t}@
    722855forall( otype T ) lvalue _Atomic T ?[?]( _Atomic T *, ptrdiff_t );
    723856forall( otype T ) lvalue const T ?[?]( const T *, ptrdiff_t );
     
    739872The interpretations of subscript expressions are the interpretations of the corresponding function call expressions.
    740873\begin{rationale}
    741 C defines subscripting as pointer arithmetic in a way that makes \lstinline@a[i]@ and
    742 \lstinline@i[a]@ equivalent. \CFA provides the equivalence through a rewrite rule to reduce the number of overloadings of \lstinline@?[?]@.
     874C defines subscripting as pointer arithmetic in a way that makes \lstinline$a[i]$ and
     875\lstinline$i[a]$ equivalent. \CFA provides the equivalence through a rewrite rule to reduce the number of overloadings of \lstinline$?[?]$.
    743876
    744877Subscript expressions are rewritten as function calls that pass the first parameter by value.
    745878This is somewhat unfortunate, since array-like types tend to be large.
    746 The alternative is to use the rewrite rule ``\lstinline@a[b]@ \rewrite \lstinline@?[?](&(a), b)@''.
    747 However, C semantics forbid this approach: the \lstinline@a@ in ``\lstinline@a[b]@'' can be an arbitrary pointer value, which does not have an address.
     879The alternative is to use the rewrite rule ``\lstinline$a[b]$ \rewrite \lstinline$?[?](&(a), b)$''.
     880However, C semantics forbid this approach: the \lstinline$a$ in ``\lstinline$a[b]$'' can be an arbitrary pointer value, which does not have an address.
    748881
    749882The repetitive form of the predefined identifiers shows up a deficiency\index{deficiencies!pointers
     
    760893\nonterm{postfix-expression} in a function call may have some interpretations that are function designators and some that are not.
    761894
    762 For those interpretations of the \nonterm{postfix-expression} that are not function designators, the expression is rewritten and becomes a call of a function named ``\lstinline@?()@''.
     895For those interpretations of the \nonterm{postfix-expression} that are not function designators, the expression is rewritten and becomes a call of a function named ``\lstinline$?()$''.
    763896The valid interpretations of the rewritten expression are determined in the manner described below.
    764897
     
    768901\item if the argument corresponds to a parameter in the function designator's prototype, the argument interpretation must have the same type as the corresponding parameter, or be implicitly convertible to the parameter's type
    769902\item if the function designator's type does not include a prototype or if the argument corresponds to
    770 ``\lstinline@...@'' in a prototype, a \Index{default argument promotion} is applied to it.
     903``\lstinline$...$'' in a prototype, a \Index{default argument promotion} is applied to it.
    771904\end{itemize}
    772905The type of the valid interpretation is the return type of the function designator.
     
    776909\begin{itemize}
    777910\item
    778 If the declaration of the implicit parameter uses \Index{type-class} \lstinline@type@\use{type}, the implicit argument must be an object type;
    779 if it uses \lstinline@dtype@, the implicit argument must be an object type or an incomplete type;
    780 and if it uses \lstinline@ftype@, the implicit argument must be a function type.
     911If the declaration of the implicit parameter uses \Index{type-class} \lstinline$type$\use{type}, the implicit argument must be an object type;
     912if it uses \lstinline$dtype$, the implicit argument must be an object type or an incomplete type;
     913and if it uses \lstinline$ftype$, the implicit argument must be a function type.
    781914
    782915\item if an explicit parameter's type uses any implicit parameters, then the corresponding explicit argument must have a type that is (or can be safely converted\index{safe conversion} to) the type produced by substituting the implicit arguments for the implicit parameters in the explicit parameter type.
     
    797930\begin{rationale}
    798931One desirable property of a polymorphic programming language is \define{generalizability}: the ability to replace an abstraction with a more general but equivalent abstraction without requiring changes in any of the uses of the original\cite{Cormack90}.
    799 For instance, it should be possible to replace a function ``\lstinline@int f( int );@'' with ``\lstinline@forall( otype T ) T f( T );@'' without affecting any calls of \lstinline@f@.
     932For instance, it should be possible to replace a function ``\lstinline$int f( int );$'' with ``\lstinline$forall( otype T ) T f( T );$'' without affecting any calls of \lstinline$f$.
    800933
    801934\CFA\index{deficiencies!generalizability} does not fully possess this property, because
     
    811944f = g( d, f );          // (3) (unsafe conversion to float)
    812945\end{lstlisting}
    813 If \lstinline@g@ was replaced by ``\lstinline@forall( otype T ) T g( T, T );@'', the first and second calls would be unaffected, but the third would change: \lstinline@f@ would be converted to
    814 \lstinline@double@, and the result would be a \lstinline@double@.
    815 
    816 Another example is the function ``\lstinline@void h( int *);@''.
     946If \lstinline$g$ was replaced by ``\lstinline$forall( otype T ) T g( T, T );$'', the first and second calls would be unaffected, but the third would change: \lstinline$f$ would be converted to
     947\lstinline$double$, and the result would be a \lstinline$double$.
     948
     949Another example is the function ``\lstinline$void h( int *);$''.
    817950This function can be passed a
    818 \lstinline@void *@ argument, but the generalization ``\lstinline@forall( otype T ) void h( T *);@'' can not.
    819 In this case, \lstinline@void@ is not a valid value for \lstinline@T@ because it is not an object type.
    820 If unsafe conversions were allowed, \lstinline@T@ could be inferred to be \emph{any} object type, which is undesirable.
     951\lstinline$void *$ argument, but the generalization ``\lstinline$forall( otype T ) void h( T *);$'' can not.
     952In this case, \lstinline$void$ is not a valid value for \lstinline$T$ because it is not an object type.
     953If unsafe conversions were allowed, \lstinline$T$ could be inferred to be \emph{any} object type, which is undesirable.
    821954\end{rationale}
    822955
    823956\examples
    824 A function called ``\lstinline@?()@'' might be part of a numerical differentiation package.
     957A function called ``\lstinline$?()$'' might be part of a numerical differentiation package.
    825958\begin{lstlisting}
    826959extern otype Derivative;
     
    833966d = sin_dx( 12.9 );
    834967\end{lstlisting}
    835 Here, the only interpretation of \lstinline@sin_dx@ is as an object of type \lstinline@Derivative@.
    836 For that interpretation, the function call is treated as ``\lstinline@?()( sin_dx, 12.9 )@''.
     968Here, the only interpretation of \lstinline$sin_dx$ is as an object of type \lstinline$Derivative$.
     969For that interpretation, the function call is treated as ``\lstinline$?()( sin_dx, 12.9 )$''.
    837970\begin{lstlisting}
    838971int f( long );          // (1)
     
    841974int i = f( 5 );         // calls (1)
    842975\end{lstlisting}
    843 Function (1) provides a valid interpretation of ``\lstinline@f( 5 )@'', using an implicit \lstinline@int@ to \lstinline@long@ conversion.
    844 The other functions do not, since the second requires two arguments, and since there is no implicit conversion from \lstinline@int@ to \lstinline@int *@ that could be used with the third function.
     976Function (1) provides a valid interpretation of ``\lstinline$f( 5 )$'', using an implicit \lstinline$int$ to \lstinline$long$ conversion.
     977The other functions do not, since the second requires two arguments, and since there is no implicit conversion from \lstinline$int$ to \lstinline$int *$ that could be used with the third function.
    845978
    846979\begin{lstlisting}
     
    848981double d = h( 1.5 );
    849982\end{lstlisting}
    850 ``\lstinline@1.5@'' is a \lstinline@double@ constant, so \lstinline@T@ is inferred to be
    851 \lstinline@double@, and the result of the function call is a \lstinline@double@.
     983``\lstinline$1.5$'' is a \lstinline$double$ constant, so \lstinline$T$ is inferred to be
     984\lstinline$double$, and the result of the function call is a \lstinline$double$.
    852985
    853986\begin{lstlisting}
     
    864997g( i, p );                      // calls (4)
    865998\end{lstlisting}
    866 The first call has valid interpretations for all four versions of \lstinline@g@. (6) and (7) are discarded because they involve unsafe \lstinline@double@-to-\lstinline@long@ conversions. (5) is chosen because it is less polymorphic than (4).
     999The first call has valid interpretations for all four versions of \lstinline$g$. (6) and (7) are discarded because they involve unsafe \lstinline$double$-to-\lstinline$long$ conversions. (5) is chosen because it is less polymorphic than (4).
    8671000
    8681001For the second call, (7) is again discarded.
    869 Of the remaining interpretations for (4), (5), and (6) (with \lstinline@i@ converted to \lstinline@long@), (6) is chosen because it is the least polymorphic.
     1002Of the remaining interpretations for (4), (5), and (6) (with \lstinline$i$ converted to \lstinline$long$), (6) is chosen because it is the least polymorphic.
    8701003
    8711004The third call has valid interpretations for all of the functions;
     
    8761009forall( otype T ) T min( T, T );
    8771010double max( double, double );
    878 trait min_max( T ) {§\impl{min_max}§
     1011trait min_max( T ) {@\impl{min_max}@
    8791012        T min( T, T );
    8801013        T max( T, T );
     
    8831016shuffle( 9, 10 );
    8841017\end{lstlisting}
    885 The only possibility for \lstinline@U@ is \lstinline@double@, because that is the type used in the only visible \lstinline@max@ function. 9 and 10 must be converted to \lstinline@double@, and
    886 \lstinline@min@ must be specialized with \lstinline@T@ bound to \lstinline@double@.
     1018The only possibility for \lstinline$U$ is \lstinline$double$, because that is the type used in the only visible \lstinline$max$ function. 9 and 10 must be converted to \lstinline$double$, and
     1019\lstinline$min$ must be specialized with \lstinline$T$ bound to \lstinline$double$.
    8871020\begin{lstlisting}
    8881021extern void q( int );           // (8)
     
    8921025r( 0 );
    8931026\end{lstlisting}
    894 The \lstinline@int 0@ could be passed to (8), or the \lstinline@(void *)@ \Index{specialization} of the null pointer\index{null pointer} \lstinline@0@\use{0} could be passed to (9).
    895 The former is chosen because the \lstinline@int@ \lstinline@0@ is \Index{less polymorphic}.
    896 For the same reason, \lstinline@int@ \lstinline@0@ is passed to \lstinline@r()@, even though it has \emph{no} declared parameter types.
     1027The \lstinline$int 0$ could be passed to (8), or the \lstinline$(void *)$ \Index{specialization} of the null pointer\index{null pointer} \lstinline$0$\use{0} could be passed to (9).
     1028The former is chosen because the \lstinline$int$ \lstinline$0$ is \Index{less polymorphic}.
     1029For the same reason, \lstinline$int$ \lstinline$0$ is passed to \lstinline$r()$, even though it has \emph{no} declared parameter types.
    8971030
    8981031
    8991032\subsubsection{Structure and union members}
    9001033
    901 \semantics In the member selection expression ``\lstinline@s@.\lstinline@m@'', there shall be at least one interpretation of \lstinline@s@ whose type is a structure type or union type containing a member named \lstinline@m@.
    902 If two or more interpretations of \lstinline@s@ have members named
    903 \lstinline@m@ with mutually compatible types, then the expression has an \Index{ambiguous interpretation} whose type is the composite type of the types of the members.
    904 If an interpretation of \lstinline@s@ has a member \lstinline@m@ whose type is not compatible with any other
    905 \lstinline@s@'s \lstinline@m@, then the expression has an interpretation with the member's type.
     1034\semantics In the member selection expression ``\lstinline$s$.\lstinline$m$'', there shall be at least one interpretation of \lstinline$s$ whose type is a structure type or union type containing a member named \lstinline$m$.
     1035If two or more interpretations of \lstinline$s$ have members named
     1036\lstinline$m$ with mutually compatible types, then the expression has an \Index{ambiguous interpretation} whose type is the composite type of the types of the members.
     1037If an interpretation of \lstinline$s$ has a member \lstinline$m$ whose type is not compatible with any other
     1038\lstinline$s$'s \lstinline$m$, then the expression has an interpretation with the member's type.
    9061039The expression has no other interpretations.
    9071040
    908 The expression ``\lstinline@p->m@'' has the same interpretations as the expression ``\lstinline@(*p).m@''.
     1041The expression ``\lstinline$p->m$'' has the same interpretations as the expression
     1042``\lstinline$(*p).m$''.
    9091043
    9101044
     
    10011135        * ?--( _Atomic const restrict volatile T * _Atomic restrict volatile * );
    10021136\end{lstlisting}
    1003 For every extended integer type \lstinline@X@ there exist
     1137For every extended integer type \lstinline$X$ there exist
    10041138% Don't use predefined: keep this out of prelude.cf.
    10051139\begin{lstlisting}
     
    10071141  ?--( volatile X * ), ?--( _Atomic volatile X * );
    10081142\end{lstlisting}
    1009 For every complete enumerated type \lstinline@E@ there exist
     1143For every complete enumerated type \lstinline$E$ there exist
    10101144% Don't use predefined: keep this out of prelude.cf.
    10111145\begin{lstlisting}
     
    10151149
    10161150\begin{rationale}
    1017 Note that ``\lstinline@++@'' and ``\lstinline@--@'' are rewritten as function calls that are given a pointer to that operand. (This is true of all operators that modify an operand.) As Hamish Macdonald has pointed out, this forces the modified operand of such expressions to be an lvalue.
     1151Note that ``\lstinline$++$'' and ``\lstinline$--$'' are rewritten as function calls that are given a pointer to that operand. (This is true of all operators that modify an operand.) As Hamish Macdonald has pointed out, this forces the modified operand of such expressions to be an lvalue.
    10181152This partially enforces the C semantic rule that such operands must be \emph{modifiable} lvalues.
    10191153\end{rationale}
     
    10211155\begin{rationale}
    10221156In C, a semantic rule requires that pointer operands of increment and decrement be pointers to object types.
    1023 Hence, \lstinline@void *@ objects cannot be incremented.
    1024 In \CFA, the restriction follows from the use of a \lstinline@type@ parameter in the predefined function definitions, as opposed to \lstinline@dtype@, since only object types can be inferred arguments corresponding to the type parameter \lstinline@T@.
     1157Hence, \lstinline$void *$ objects cannot be incremented.
     1158In \CFA, the restriction follows from the use of a \lstinline$type$ parameter in the predefined function definitions, as opposed to \lstinline$dtype$, since only object types can be inferred arguments corresponding to the type parameter \lstinline$T$.
    10251159\end{rationale}
    10261160
    10271161\semantics
    10281162First, each interpretation of the operand of an increment or decrement expression is considered separately.
    1029 For each interpretation that is a bit-field or is declared with the \Indexc{register}\index{storage-class specifier}, the expression has one valid interpretation, with the type of the operand, and the expression is ambiguous if the operand is.
     1163For each interpretation that is a bit-field or is declared with the
     1164\lstinline$register$\index{register@{\lstinline$register$}} \index{Itorage-class specifier}, the expression has one valid interpretation, with the type of the operand, and the expression is ambiguous if the operand is.
    10301165
    10311166For the remaining interpretations, the expression is rewritten, and the interpretations of the expression are the interpretations of the corresponding function call.
     
    10401175\end{lstlisting}
    10411176\begin{sloppypar}
    1042 Since \lstinline@&(vs)@ has type \lstinline@volatile short int *@, the best valid interpretation of
    1043 \lstinline@vs++@ calls the \lstinline@?++@ function with the \lstinline@volatile short *@ parameter.
    1044 \lstinline@s++@ does the same, applying the safe conversion from \lstinline@short int *@ to \lstinline@volatile short int *@.
    1045 Note that there is no conversion that adds an \lstinline@_Atomic@ qualifier, so the \lstinline@_Atomic volatile short int@ overloading does not provide a valid interpretation.
     1177Since \lstinline$&(vs)$ has type \lstinline$volatile short int *$, the best valid interpretation of
     1178\lstinline$vs++$ calls the \lstinline$?++$ function with the \lstinline$volatile short *$ parameter.
     1179\lstinline$s++$ does the same, applying the safe conversion from \lstinline$short int *$ to
     1180\lstinline$volatile short int *$.
     1181Note that there is no conversion that adds an \lstinline$_Atomic$ qualifier, so the \lstinline$_Atomic volatile short int$ overloading does not provide a valid interpretation.
    10461182\end{sloppypar}
    10471183
    1048 There is no safe conversion from \lstinline@const short int *@ to \lstinline@volatile short int *@, and no \lstinline@?++@ function that accepts a \lstinline@const *@ parameter, so \lstinline@cs++@ has no valid interpretations.
    1049 
    1050 The best valid interpretation of \lstinline@as++@ calls the \lstinline@short ?++@ function with the \lstinline@_Atomic volatile short int *@ parameter, applying a safe conversion to add the \lstinline@volatile@ qualifier.
     1184There is no safe conversion from \lstinline$const short int *$ to \lstinline$volatile short int *$, and no \lstinline$?++$ function that accepts a \lstinline$const *$ parameter, so \lstinline$cs++$ has no valid interpretations.
     1185
     1186The best valid interpretation of \lstinline$as++$ calls the \lstinline$short ?++$ function with the \lstinline$_Atomic volatile short int *$ parameter, applying a safe conversion to add the \lstinline$volatile$ qualifier.
    10511187\begin{lstlisting}
    10521188char * const restrict volatile * restrict volatile pqpc;
     
    10551191ppc++;
    10561192\end{lstlisting}
    1057 Since \lstinline@&(pqpc)@ has type \lstinline@char * const restrict volatile * restrict volatile *@, the best valid interpretation of \lstinline@pqpc++@ calls the polymorphic \lstinline@?++@ function with the \lstinline@const restrict volatile T * restrict volatile *@ parameter, inferring \lstinline@T@ to be \lstinline@char *@.
    1058 
    1059 \lstinline@ppc++@ calls the same function, again inferring \lstinline@T@ to be \lstinline@char *@, and using the safe conversions from \lstinline@T@ to \lstinline@T const@ \lstinline@restrict volatile@.
     1193Since \lstinline$&(pqpc)$ has type \lstinline$char * const restrict volatile * restrict volatile *$, the best valid interpretation of \lstinline$pqpc++$ calls the polymorphic \lstinline$?++$ function with the \lstinline$const restrict volatile T * restrict volatile *$ parameter, inferring \lstinline$T$ to be \lstinline$char *$.
     1194
     1195\lstinline$ppc++$ calls the same function, again inferring \lstinline$T$ to be \lstinline$char *$, and using the safe conversions from \lstinline$T$ to \lstinline$T const$ \lstinline$restrict volatile$.
    10601196
    10611197\begin{rationale}
     
    10711207\begin{enumerate}
    10721208\item
    1073 ``\lstinline@char * p; p++;@''.
    1074 The argument to \lstinline@?++@ has type \lstinline@char * *@, and the result has type \lstinline@char *@.
    1075 The expression would be valid if \lstinline@?++@ were declared by
     1209``\lstinline$char * p; p++;$''.
     1210The argument to \lstinline$?++$ has type \lstinline$char * *$, and the result has type \lstinline$char *$.
     1211The expression would be valid if \lstinline$?++$ were declared by
    10761212\begin{lstlisting}
    10771213forall( otype T ) T * ?++( T * * );
    1078 \end{lstlisting} with \lstinline@T@ inferred to be \lstinline@char@.
    1079 
    1080 \item
    1081 ``\lstinline@char *restrict volatile qp; qp++@''.
    1082 The result again has type \lstinline@char *@, but the argument now has type \lstinline@char *restrict volatile *@, so it cannot be passed to the hypothetical function declared in point 1.
     1214\end{lstlisting} with \lstinline$T$ inferred to be \lstinline$char$.
     1215
     1216\item
     1217``\lstinline$char *restrict volatile qp; qp++$''.
     1218The result again has type \lstinline$char *$, but the argument now has type \lstinline$char *restrict volatile *$, so it cannot be passed to the hypothetical function declared in point 1.
    10831219Hence the actual predefined function is
    10841220\begin{lstlisting}
    10851221forall( otype T ) T * ?++( T * restrict volatile * );
    1086 \end{lstlisting} which also accepts a \lstinline@char * *@ argument, because of the safe conversions that add
    1087 \lstinline@volatile@ and \lstinline@restrict@ qualifiers. (The parameter is not const-qualified, so constant pointers cannot be incremented.)
    1088 
    1089 \item
    1090 ``\lstinline@char *_Atomic ap; ap++@''.
    1091 The result again has type \lstinline@char *@, but no safe conversion adds an \lstinline@_Atomic@ qualifier, so the function in point 2 is not applicable.
    1092 A separate overloading of \lstinline@?++@ is required.
    1093 
    1094 \item
    1095 ``\lstinline@char const volatile * pq; pq++@''.
     1222\end{lstlisting} which also accepts a \lstinline$char * *$ argument, because of the safe conversions that add
     1223\lstinline$volatile$ and \lstinline$restrict$ qualifiers. (The parameter is not const-qualified, so constant pointers cannot be incremented.)
     1224
     1225\item
     1226``\lstinline$char *_Atomic ap; ap++$''.
     1227The result again has type \lstinline$char *$, but no safe conversion adds an \lstinline$_Atomic$ qualifier, so the function in point 2 is not applicable.
     1228A separate overloading of \lstinline$?++$ is required.
     1229
     1230\item
     1231``\lstinline$char const volatile * pq; pq++$''.
    10961232Here the result has type
    1097 \lstinline@char const volatile *@, so a new overloading is needed:
     1233\lstinline$char const volatile *$, so a new overloading is needed:
    10981234\begin{lstlisting}
    10991235forall( otype T ) T const volatile * ?++( T const volatile *restrict volatile * );
     
    11021238 
    11031239\item
    1104 ``\lstinline@float *restrict * prp; prp++@''.
    1105 The \lstinline@restrict@ qualifier is handled just like \lstinline@const@ and \lstinline@volatile@ in the previous case:
     1240``\lstinline$float *restrict * prp; prp++$''.
     1241The \lstinline$restrict$ qualifier is handled just like \lstinline$const$ and \lstinline$volatile$ in the previous case:
    11061242\begin{lstlisting}
    11071243forall( otype T ) T restrict * ?++( T restrict *restrict volatile * );
    1108 \end{lstlisting} with \lstinline@T@ inferred to be \lstinline@float *@.
    1109 This looks odd, because {\c11} contains a constraint that requires restrict-qualified types to be pointer-to-object types, and \lstinline@T@ is not syntactically a pointer type. \CFA loosens the constraint.
     1244\end{lstlisting} with \lstinline$T$ inferred to be \lstinline$float *$.
     1245This looks odd, because {\c11} contains a constraint that requires restrict-qualified types to be pointer-to-object types, and \lstinline$T$ is not syntactically a pointer type. \CFA loosens the constraint.
    11101246\end{enumerate}
    11111247\end{rationale}
     
    11231259\lhs{unary-expression}
    11241260\rhs \nonterm{postfix-expression}
    1125 \rhs \lstinline@++@ \nonterm{unary-expression}
    1126 \rhs \lstinline@--@ \nonterm{unary-expression}
     1261\rhs \lstinline$++$ \nonterm{unary-expression}
     1262\rhs \lstinline$--$ \nonterm{unary-expression}
    11271263\rhs \nonterm{unary-operator} \nonterm{cast-expression}
    1128 \rhs \lstinline@sizeof@ \nonterm{unary-expression}
    1129 \rhs \lstinline@sizeof@ \lstinline@(@ \nonterm{type-name} \lstinline@)@
    1130 \lhs{unary-operator} one of \rhs \lstinline@&@ \lstinline@*@ \lstinline@+@ \lstinline@-@ \lstinline@~@ \lstinline@!@
     1264\rhs \lstinline$sizeof$ \nonterm{unary-expression}
     1265\rhs \lstinline$sizeof$ \lstinline$($ \nonterm{type-name} \lstinline$)$
     1266\lhs{unary-operator} one of \rhs \lstinline$&$ \lstinline$*$ \lstinline$+$ \lstinline$-$ \lstinline$~$ \lstinline$!$
    11311267\end{syntax}
    11321268
    11331269\rewriterules
    11341270\begin{lstlisting}
    1135 *a      §\rewrite§ *?( a ) §\use{*?}§
    1136 +a      §\rewrite§ +?( a ) §\use{+?}§
    1137 -a      §\rewrite§ -?( a ) §\use{-?}§
    1138 ~a      §\rewrite§ ~?( a ) §\use{~?}§
    1139 !a      §\rewrite§ !?( a ) §\use{"!?}§
    1140 ++a     §\rewrite§ ++?(&( a )) §\use{++?}§
    1141 --a     §\rewrite§ --?(&( a )) §\use{--?}§
     1271*a      @\rewrite@ *?( a ) @\use{*?}@
     1272+a      @\rewrite@ +?( a ) @\use{+?}@
     1273-a      @\rewrite@ -?( a ) @\use{-?}@
     1274~a      @\rewrite@ ~?( a ) @\use{~?}@
     1275!a      @\rewrite@ !?( a ) @\use{"!?}@
     1276++a     @\rewrite@ ++?(&( a )) @\use{++?}@
     1277--a     @\rewrite@ --?(&( a )) @\use{--?}@
    11421278\end{lstlisting}
    11431279
     
    12351371        * --?( _Atomic const restrict volatile T * _Atomic restrict volatile * );
    12361372\end{lstlisting}
    1237 For every extended integer type \lstinline@X@ there exist
     1373For every extended integer type \lstinline$X$ there exist
    12381374% Don't use predefined: keep this out of prelude.cf.
    12391375\begin{lstlisting}
     
    12431379        --?( _Atomic volatile X * );
    12441380\end{lstlisting}
    1245 For every complete enumerated type \lstinline@E@ there exist
     1381For every complete enumerated type \lstinline$E$ there exist
    12461382% Don't use predefined: keep this out of prelude.cf.
    12471383\begin{lstlisting}
     
    12801416
    12811417\constraints
    1282 The operand of the unary ``\lstinline@&@'' operator shall have exactly one
     1418The operand of the unary ``\lstinline$&$'' operator shall have exactly one
    12831419\Index{interpretation}\index{ambiguous interpretation}, which shall be unambiguous.
    12841420
    12851421\semantics
    1286 The ``\lstinline@&@'' expression has one interpretation which is of type \lstinline@T *@, where
    1287 \lstinline@T@ is the type of the operand.
     1422The ``\lstinline$&$'' expression has one interpretation which is of type \lstinline$T *$, where
     1423\lstinline$T$ is the type of the operand.
    12881424
    12891425The interpretations of an indirection expression are the interpretations of the corresponding function call.
     
    13141450forall( ftype FT ) int !?( FT * );
    13151451\end{lstlisting}
    1316 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1452For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    13171453% Don't use predefined: keep this out of prelude.cf.
    13181454\begin{lstlisting}
     
    13271463\begin{lstlisting}
    13281464long int li;
    1329 void eat_double( double );§\use{eat_double}§
    1330 eat_double(-li ); // §\rewrite§ eat_double( -?( li ) );
    1331 \end{lstlisting}
    1332 The valid interpretations of ``\lstinline@-li@'' (assuming no extended integer types exist) are
     1465void eat_double( double );@\use{eat_double}@
     1466eat_double(-li ); // @\rewrite@ eat_double( -?( li ) );
     1467\end{lstlisting}
     1468The valid interpretations of ``\lstinline$-li$'' (assuming no extended integer types exist) are
    13331469\begin{center}
    13341470\begin{tabular}{llc} interpretation & result type & expression conversion cost \\
    13351471\hline
    1336 \lstinline@-?( (int)li )@                                       & \lstinline@int@                                       & (unsafe) \\
    1337 \lstinline@-?( (unsigned)li)@                           & \lstinline@unsigned int@                      & (unsafe) \\
    1338 \lstinline@-?( (long)li)@                                       & \lstinline@long@                                      & 0 \\
    1339 \lstinline@-?( (long unsigned int)li)@          & \lstinline@long unsigned int@         & 1 \\
    1340 \lstinline@-?( (long long int)li)@                      & \lstinline@long long int@                     & 2 \\
    1341 \lstinline@-?( (long long unsigned int)li)@     & \lstinline@long long unsigned int@& 3 \\
    1342 \lstinline@-?( (float)li)@                                      & \lstinline@float@                                     & 4 \\
    1343 \lstinline@-?( (double)li)@                                     & \lstinline@double@                            & 5 \\
    1344 \lstinline@-?( (long double)li)@                        & \lstinline@long double@                       & 6 \\
    1345 \lstinline@-?( (_Complex float)li)@                     & \lstinline@float@                                     & (unsafe) \\
    1346 \lstinline@-?( (_Complex double)li)@            & \lstinline@double@                            & (unsafe) \\
    1347 \lstinline@-?( (_Complex long double)li)@       & \lstinline@long double@                       & (unsafe) \\
     1472\lstinline$-?( (int)li )$                                       & \lstinline$int$                                       & (unsafe) \\
     1473\lstinline$-?( (unsigned)li)$                           & \lstinline$unsigned int$                      & (unsafe) \\
     1474\lstinline$-?( (long)li)$                                       & \lstinline$long$                                      & 0 \\
     1475\lstinline$-?( (long unsigned int)li)$          & \lstinline$long unsigned int$         & 1 \\
     1476\lstinline$-?( (long long int)li)$                      & \lstinline$long long int$                     & 2 \\
     1477\lstinline$-?( (long long unsigned int)li)$     & \lstinline$long long unsigned int$& 3 \\
     1478\lstinline$-?( (float)li)$                                      & \lstinline$float$                                     & 4 \\
     1479\lstinline$-?( (double)li)$                                     & \lstinline$double$                            & 5 \\
     1480\lstinline$-?( (long double)li)$                        & \lstinline$long double$                       & 6 \\
     1481\lstinline$-?( (_Complex float)li)$                     & \lstinline$float$                                     & (unsafe) \\
     1482\lstinline$-?( (_Complex double)li)$            & \lstinline$double$                            & (unsafe) \\
     1483\lstinline$-?( (_Complex long double)li)$       & \lstinline$long double$                       & (unsafe) \\
    13481484\end{tabular}
    13491485\end{center}
    1350 The valid interpretations of the \lstinline@eat_double@ call, with the cost of the argument conversion and the cost of the entire expression, are
     1486The valid interpretations of the \lstinline$eat_double$ call, with the cost of the argument conversion and the cost of the entire expression, are
    13511487\begin{center}
    13521488\begin{tabular}{lcc} interpretation & argument cost & expression cost \\
    13531489\hline
    1354 \lstinline@eat_double( (double)-?( (int)li) )@                                  & 7                     & (unsafe) \\
    1355 \lstinline@eat_double( (double)-?( (unsigned)li) )@                             & 6                     & (unsafe) \\
    1356 \lstinline@eat_double( (double)-?(li) )@                                                & 5                     & \(0+5=5\) \\
    1357 \lstinline@eat_double( (double)-?( (long unsigned int)li) )@    & 4                     & \(1+4=5\) \\
    1358 \lstinline@eat_double( (double)-?( (long long int)li) )@                & 3                     & \(2+3=5\) \\
    1359 \lstinline@eat_double( (double)-?( (long long unsigned int)li) )@& 2            & \(3+2=5\) \\
    1360 \lstinline@eat_double( (double)-?( (float)li) )@                                & 1                     & \(4+1=5\) \\
    1361 \lstinline@eat_double( (double)-?( (double)li) )@                               & 0                     & \(5+0=5\) \\
    1362 \lstinline@eat_double( (double)-?( (long double)li) )@                  & (unsafe)      & (unsafe) \\
    1363 \lstinline@eat_double( (double)-?( (_Complex float)li) )@               & (unsafe)      & (unsafe) \\
    1364 \lstinline@eat_double( (double)-?( (_Complex double)li) )@              & (unsafe)      & (unsafe) \\
    1365 \lstinline@eat_double( (double)-?( (_Complex long double)li) )@ & (unsafe)      & (unsafe) \\
     1490\lstinline$eat_double( (double)-?( (int)li) )$                                  & 7                     & (unsafe) \\
     1491\lstinline$eat_double( (double)-?( (unsigned)li) )$                             & 6                     & (unsafe) \\
     1492\lstinline$eat_double( (double)-?(li) )$                                                & 5                     & \(0+5=5\) \\
     1493\lstinline$eat_double( (double)-?( (long unsigned int)li) )$    & 4                     & \(1+4=5\) \\
     1494\lstinline$eat_double( (double)-?( (long long int)li) )$                & 3                     & \(2+3=5\) \\
     1495\lstinline$eat_double( (double)-?( (long long unsigned int)li) )$& 2            & \(3+2=5\) \\
     1496\lstinline$eat_double( (double)-?( (float)li) )$                                & 1                     & \(4+1=5\) \\
     1497\lstinline$eat_double( (double)-?( (double)li) )$                               & 0                     & \(5+0=5\) \\
     1498\lstinline$eat_double( (double)-?( (long double)li) )$                  & (unsafe)      & (unsafe) \\
     1499\lstinline$eat_double( (double)-?( (_Complex float)li) )$               & (unsafe)      & (unsafe) \\
     1500\lstinline$eat_double( (double)-?( (_Complex double)li) )$              & (unsafe)      & (unsafe) \\
     1501\lstinline$eat_double( (double)-?( (_Complex long double)li) )$ & (unsafe)      & (unsafe) \\
    13661502\end{tabular}
    13671503\end{center}
    1368 Each has result type \lstinline@void@, so the best must be selected.
     1504Each has result type \lstinline$void$, so the best must be selected.
    13691505The interpretations involving unsafe conversions are discarded.
    13701506The remainder have equal expression conversion costs, so the
    13711507``highest argument conversion cost'' rule is invoked, and the chosen interpretation is
    1372 \lstinline@eat_double( (double)-?(li) )@.
    1373 
    1374 
    1375 \subsubsection[The sizeof and \_Alignof operators]{The \lstinline@sizeof@ and \lstinline@_Alignof@ operators}
     1508\lstinline$eat_double( (double)-?(li) )$.
     1509
     1510
     1511\subsubsection{The \lstinline$sizeof$ and \lstinline$_Alignof$ operators}
    13761512
    13771513\constraints
    1378 The operand of \lstinline@sizeof@ or \lstinline@_Alignof@ shall not be \lstinline@type@, \lstinline@dtype@, or \lstinline@ftype@.
    1379 
    1380 When the \lstinline@sizeof@\use{sizeof} operator is applied to an expression, the expression shall have exactly one \Index{interpretation}\index{ambiguous interpretation}, which shall be unambiguous. \semantics A \lstinline@sizeof@ or \lstinline@_Alignof@ expression has one interpretation, of type \lstinline@size_t@.
    1381 
    1382 When \lstinline@sizeof@ is applied to an identifier declared by a \nonterm{type-declaration} or a
     1514The operand of \lstinline$sizeof$ or \lstinline$_Alignof$ shall not be \lstinline$type$,
     1515\lstinline$dtype$, or \lstinline$ftype$.
     1516
     1517When the \lstinline$sizeof$\use{sizeof} operator is applied to an expression, the expression shall have exactly one \Index{interpretation}\index{ambiguous interpretation}, which shall be unambiguous. \semantics A \lstinline$sizeof$ or \lstinline$_Alignof$ expression has one interpretation, of type \lstinline$size_t$.
     1518
     1519When \lstinline$sizeof$ is applied to an identifier declared by a \nonterm{type-declaration} or a
    13831520\nonterm{type-parameter}, it yields the size in bytes of the type that implements the operand.
    13841521When the operand is an opaque type or an inferred type parameter\index{inferred parameter}, the expression is not a constant expression.
    13851522
    1386 When \lstinline@_Alignof@ is applied to an identifier declared by a \nonterm{type-declaration} or a
     1523When \lstinline$_Alignof$ is applied to an identifier declared by a \nonterm{type-declaration} or a
    13871524\nonterm{type-parameter}, it yields the alignment requirement of the type that implements the operand.
    13881525When the operand is an opaque type or an inferred type parameter\index{inferred parameter}, the expression is not a constant expression.
     
    13911528otype Pair = struct { int first, second; };
    13921529size_t p_size = sizeof(Pair);           // constant expression
    1393 extern otype Rational;§\use{Rational}§
     1530extern otype Rational;@\use{Rational}@
    13941531size_t c_size = sizeof(Rational);       // non-constant expression
    13951532forall(type T) T f(T p1, T p2) {
     
    13981535}
    13991536\end{lstlisting}
    1400 ``\lstinline@sizeof Rational@'', although not statically known, is fixed.
    1401 Within \lstinline@f()@,
    1402 ``\lstinline@sizeof(T)@'' is fixed for each call of \lstinline@f()@, but may vary from call to call.
     1537``\lstinline$sizeof Rational$'', although not statically known, is fixed.
     1538Within \lstinline$f()$,
     1539``\lstinline$sizeof(T)$'' is fixed for each call of \lstinline$f()$, but may vary from call to call.
    14031540\end{rationale}
    14041541
     
    14091546\lhs{cast-expression}
    14101547\rhs \nonterm{unary-expression}
    1411 \rhs \lstinline@(@ \nonterm{type-name} \lstinline@)@ \nonterm{cast-expression}
     1548\rhs \lstinline$($ \nonterm{type-name} \lstinline$)$ \nonterm{cast-expression}
    14121549\end{syntax}
    14131550
    14141551\constraints
    1415 The \nonterm{type-name} in a \nonterm{cast-expression} shall not be \lstinline@type@,
    1416 \lstinline@dtype@, or \lstinline@ftype@.
     1552The \nonterm{type-name} in a \nonterm{cast-expression} shall not be \lstinline$type$,
     1553\lstinline$dtype$, or \lstinline$ftype$.
    14171554
    14181555\semantics
    14191556
    1420 In a \Index{cast expression} ``\lstinline@(@\nonterm{type-name}\lstinline@)e@'', if
    1421 \nonterm{type-name} is the type of an interpretation of \lstinline@e@, then that interpretation is the only interpretation of the cast expression;
    1422 otherwise, \lstinline@e@ shall have some interpretation that can be converted to \nonterm{type-name}, and the interpretation of the cast expression is the cast of the interpretation that can be converted at the lowest cost.
     1557In a \Index{cast expression} ``\lstinline$($\nonterm{type-name}\lstinline$)e$'', if
     1558\nonterm{type-name} is the type of an interpretation of \lstinline$e$, then that interpretation is the only interpretation of the cast expression;
     1559otherwise, \lstinline$e$ shall have some interpretation that can be converted to \nonterm{type-name}, and the interpretation of the cast expression is the cast of the interpretation that can be converted at the lowest cost.
    14231560The cast expression's interpretation is ambiguous\index{ambiguous interpretation} if more than one interpretation can be converted at the lowest cost or if the selected interpretation is ambiguous.
    14241561
     
    14331570\lhs{multiplicative-expression}
    14341571\rhs \nonterm{cast-expression}
    1435 \rhs \nonterm{multiplicative-expression} \lstinline@*@ \nonterm{cast-expression}
    1436 \rhs \nonterm{multiplicative-expression} \lstinline@/@ \nonterm{cast-expression}
    1437 \rhs \nonterm{multiplicative-expression} \lstinline@%@ \nonterm{cast-expression}
     1572\rhs \nonterm{multiplicative-expression} \lstinline$*$ \nonterm{cast-expression}
     1573\rhs \nonterm{multiplicative-expression} \lstinline$/$ \nonterm{cast-expression}
     1574\rhs \nonterm{multiplicative-expression} \lstinline$%$ \nonterm{cast-expression}
    14381575\end{syntax}
    14391576
    14401577\rewriterules
    14411578\begin{lstlisting}
    1442 a * b §\rewrite§ ?*?( a, b )§\use{?*?}§
    1443 a / b §\rewrite§ ?/?( a, b )§\use{?/?}§
    1444 a % b §\rewrite§ ?%?( a, b )§\use{?%?}§
     1579a * b @\rewrite@ ?*?( a, b )@\use{?*?}@
     1580a / b @\rewrite@ ?/?( a, b )@\use{?/?}@
     1581a % b @\rewrite@ ?%?( a, b )@\use{?%?}@
    14451582\end{lstlisting}
    14461583
     
    14691606        ?*?( _Complex long double, _Complex long double ), ?/?( _Complex long double, _Complex long double );
    14701607\end{lstlisting}
    1471 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1608For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    14721609% Don't use predefined: keep this out of prelude.cf.
    14731610\begin{lstlisting}
     
    14871624int i;
    14881625long li;
    1489 void eat_double( double );§\use{eat_double}§
     1626void eat_double( double );@\use{eat_double}@
    14901627eat_double( li % i );
    14911628\end{lstlisting}
    1492 ``\lstinline@li % i@'' is rewritten as ``\lstinline@?%?(li, i )@''.
    1493 The valid interpretations of \lstinline@?%?(li, i )@, the cost\index{conversion cost} of converting their arguments, and the cost of converting the result to \lstinline@double@ (assuming no extended integer types are present ) are
     1629``\lstinline$li % i$'' is rewritten as ``\lstinline$?%?(li, i )$''.
     1630The valid interpretations of \lstinline$?%?(li, i )$, the cost\index{conversion cost} of converting their arguments, and the cost of converting the result to \lstinline$double$ (assuming no extended integer types are present ) are
    14941631\begin{center}
    14951632\begin{tabular}{lcc} interpretation & argument cost & result cost \\
    14961633\hline
    1497 \lstinline@ ?%?( (int)li, i )@                                                                          & (unsafe)      & 6     \\
    1498 \lstinline@ ?%?( (unsigned)li,(unsigned)i )@                                            & (unsafe)      & 5     \\
    1499 \lstinline@ ?%?( li, (long)i )@                                                                         & 1                     & 4     \\
    1500 \lstinline@ ?%?( (long unsigned)li,(long unsigned)i )@                          & 3                     & 3     \\
    1501 \lstinline@ ?%?( (long long)li,(long long)i )@                                          & 5                     & 2     \\
    1502 \lstinline@ ?%?( (long long unsigned)li, (long long unsigned)i )@       & 7                     & 1     \\
     1634\lstinline$ ?%?( (int)li, i )$                                                                          & (unsafe)      & 6     \\
     1635\lstinline$ ?%?( (unsigned)li,(unsigned)i )$                                            & (unsafe)      & 5     \\
     1636\lstinline$ ?%?( li, (long)i )$                                                                         & 1                     & 4     \\
     1637\lstinline$ ?%?( (long unsigned)li,(long unsigned)i )$                          & 3                     & 3     \\
     1638\lstinline$ ?%?( (long long)li,(long long)i )$                                          & 5                     & 2     \\
     1639\lstinline$ ?%?( (long long unsigned)li, (long long unsigned)i )$       & 7                     & 1     \\
    15031640\end{tabular}
    15041641\end{center}
    1505 The best interpretation of \lstinline@eat_double( li, i )@ is
    1506 \lstinline@eat_double( (double)?%?(li, (long)i ))@, which has no unsafe conversions and the lowest total cost.
    1507 
    1508 \begin{rationale}
    1509 {\c11} defines most arithmetic operations to apply an \Index{integer promotion} to any argument that belongs to a type that has an \Index{integer conversion rank} less than that of \lstinline@int@.If
    1510 \lstinline@s@ is a \lstinline@short int@, ``\lstinline@s *s@'' does not have type \lstinline@short int@;
    1511 it is treated as ``\lstinline@( (int)s ) * ( (int)s )@'', and has type \lstinline@int@. \CFA matches that pattern;
    1512 it does not predefine ``\lstinline@short ?*?( short, short )@''.
     1642The best interpretation of \lstinline$eat_double( li, i )$ is
     1643\lstinline$eat_double( (double)?%?(li, (long)i ))$, which has no unsafe conversions and the lowest total cost.
     1644
     1645\begin{rationale}
     1646{\c11} defines most arithmetic operations to apply an \Index{integer promotion} to any argument that belongs to a type that has an \Index{integer conversion rank} less than that of \lstinline$int$.If
     1647\lstinline$s$ is a \lstinline$short int$, ``\lstinline$s *s$'' does not have type \lstinline$short int$;
     1648it is treated as ``\lstinline$( (int)s ) * ( (int)s )$'', and has type \lstinline$int$. \CFA matches that pattern;
     1649it does not predefine ``\lstinline$short ?*?( short, short )$''.
    15131650
    15141651These ``missing'' operators limit polymorphism.
     
    15191656square( s );
    15201657\end{lstlisting}
    1521 Since \CFA does not define a multiplication operator for \lstinline@short int@,
    1522 \lstinline@square( s )@ is treated as \lstinline@square( (int)s )@, and the result has type
    1523 \lstinline@int@.
     1658Since \CFA does not define a multiplication operator for \lstinline$short int$,
     1659\lstinline$square( s )$ is treated as \lstinline$square( (int)s )$, and the result has type
     1660\lstinline$int$.
    15241661This is mildly surprising, but it follows the {\c11} operator pattern.
    15251662
     
    15311668\end{lstlisting}
    15321669This has no valid interpretations, because \CFA has no conversion from ``array of
    1533 \lstinline@short int@'' to ``array of \lstinline@int@''.
     1670\lstinline$short int$'' to ``array of \lstinline$int$''.
    15341671The alternatives in such situations include
    15351672\begin{itemize}
    15361673\item
    1537 Defining monomorphic overloadings of \lstinline@product@ for \lstinline@short@ and the other
     1674Defining monomorphic overloadings of \lstinline$product$ for \lstinline$short$ and the other
    15381675``small'' types.
    15391676\item
    1540 Defining ``\lstinline@short ?*?( short, short )@'' within the scope containing the call to
    1541 \lstinline@product@.
    1542 \item
    1543 Defining \lstinline@product@ to take as an argument a conversion function from the ``small'' type to the operator's argument type.
     1677Defining ``\lstinline$short ?*?( short, short )$'' within the scope containing the call to
     1678\lstinline$product$.
     1679\item
     1680Defining \lstinline$product$ to take as an argument a conversion function from the ``small'' type to the operator's argument type.
    15441681\end{itemize}
    15451682\end{rationale}
     
    15511688\lhs{additive-expression}
    15521689\rhs \nonterm{multiplicative-expression}
    1553 \rhs \nonterm{additive-expression} \lstinline@+@ \nonterm{multiplicative-expression}
    1554 \rhs \nonterm{additive-expression} \lstinline@-@ \nonterm{multiplicative-expression}
     1690\rhs \nonterm{additive-expression} \lstinline$+$ \nonterm{multiplicative-expression}
     1691\rhs \nonterm{additive-expression} \lstinline$-$ \nonterm{multiplicative-expression}
    15551692\end{syntax}
    15561693
    15571694\rewriterules
    15581695\begin{lstlisting}
    1559 a + b §\rewrite§ ?+?( a, b )§\use{?+?}§
    1560 a - b §\rewrite§ ?-?( a, b )§\use{?-?}§
     1696a + b @\rewrite@ ?+?( a, b )@\use{?+?}@
     1697a - b @\rewrite@ ?-?( a, b )@\use{?-?}@
    15611698\end{lstlisting}
    15621699
     
    16111748        * ?-?( _Atomic const restrict volatile T *, _Atomic const restrict volatile T * );
    16121749\end{lstlisting}
    1613 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1750For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    16141751% Don't use predefined: keep this out of prelude.cf.
    16151752\begin{lstlisting}
     
    16211758
    16221759\begin{rationale}
    1623 \lstinline@ptrdiff_t@ is an implementation-defined identifier defined in \lstinline@<stddef.h>@ that is synonymous with a signed integral type that is large enough to hold the difference between two pointers.
     1760\lstinline$ptrdiff_t$ is an implementation-defined identifier defined in \lstinline$<stddef.h>$ that is synonymous with a signed integral type that is large enough to hold the difference between two pointers.
    16241761It seems reasonable to use it for pointer addition as well. (This is technically a difference between \CFA and C, which only specifies that pointer addition uses an \emph{integral} argument.) Hence it is also used for subscripting, which is defined in terms of pointer addition.
    1625 The {\c11} standard uses \lstinline@size_t@ in several cases where a library function takes an argument that is used as a subscript, but \lstinline@size_t@ is unsuitable here because it is an unsigned type.
     1762The {\c11} standard uses \lstinline$size_t$ in several cases where a library function takes an argument that is used as a subscript, but \lstinline$size_t$ is unsuitable here because it is an unsigned type.
    16261763\end{rationale}
    16271764
     
    16321769\lhs{shift-expression}
    16331770\rhs \nonterm{additive-expression}
    1634 \rhs \nonterm{shift-expression} \lstinline@<<@ \nonterm{additive-expression}
    1635 \rhs \nonterm{shift-expression} \lstinline@>>@ \nonterm{additive-expression}
     1771\rhs \nonterm{shift-expression} \lstinline$<<$ \nonterm{additive-expression}
     1772\rhs \nonterm{shift-expression} \lstinline$>>$ \nonterm{additive-expression}
    16361773\end{syntax}
    16371774
    16381775\rewriterules \use{?>>?}%use{?<<?}
    16391776\begin{lstlisting}
    1640 a << b §\rewrite§ ?<<?( a, b )
    1641 a >> b §\rewrite§ ?>>?( a, b )
     1777a << b @\rewrite@ ?<<?( a, b )
     1778a >> b @\rewrite@ ?>>?( a, b )
    16421779\end{lstlisting}
    16431780
     
    16511788long long unsigned int ?<<?( long long unsigned int, int ), ?>>?( long long unsigned int, int);
    16521789\end{lstlisting}
    1653 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1790For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    16541791% Don't use predefined: keep this out of prelude.cf.
    16551792\begin{lstlisting}
     
    16711808\lhs{relational-expression}
    16721809\rhs \nonterm{shift-expression}
    1673 \rhs \nonterm{relational-expression} \lstinline@< @ \nonterm{shift-expression}
    1674 \rhs \nonterm{relational-expression} \lstinline@> @ \nonterm{shift-expression}
    1675 \rhs \nonterm{relational-expression} \lstinline@<=@ \nonterm{shift-expression}
    1676 \rhs \nonterm{relational-expression} \lstinline@>=@ \nonterm{shift-expression}
     1810\rhs \nonterm{relational-expression} \lstinline$< $ \nonterm{shift-expression}
     1811\rhs \nonterm{relational-expression} \lstinline$> $ \nonterm{shift-expression}
     1812\rhs \nonterm{relational-expression} \lstinline$<=$ \nonterm{shift-expression}
     1813\rhs \nonterm{relational-expression} \lstinline$>=$ \nonterm{shift-expression}
    16771814\end{syntax}
    16781815
    16791816\rewriterules\use{?>?}\use{?>=?}%use{?<?}%use{?<=?}
    16801817\begin{lstlisting}
    1681 a < b §\rewrite§ ?<?( a, b )
    1682 a > b §\rewrite§ ?>?( a, b )
    1683 a <= b §\rewrite§ ?<=?( a, b )
    1684 a >= b §\rewrite§ ?>=?( a, b )
     1818a < b @\rewrite@ ?<?( a, b )
     1819a > b @\rewrite@ ?>?( a, b )
     1820a <= b @\rewrite@ ?<=?( a, b )
     1821a >= b @\rewrite@ ?>=?( a, b )
    16851822\end{lstlisting}
    16861823
     
    17141851        ?>=?( _Atomic const restrict volatile DT *, _Atomic const restrict volatile DT * );
    17151852\end{lstlisting}
    1716 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1853For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    17171854% Don't use predefined: keep this out of prelude.cf.
    17181855\begin{lstlisting}
     
    17321869\lhs{equality-expression}
    17331870\rhs \nonterm{relational-expression}
    1734 \rhs \nonterm{equality-expression} \lstinline@==@ \nonterm{relational-expression}
    1735 \rhs \nonterm{equality-expression} \lstinline@!=@ \nonterm{relational-expression}
     1871\rhs \nonterm{equality-expression} \lstinline$==$ \nonterm{relational-expression}
     1872\rhs \nonterm{equality-expression} \lstinline$!=$ \nonterm{relational-expression}
    17361873\end{syntax}
    17371874
    17381875\rewriterules
    17391876\begin{lstlisting}
    1740 a == b §\rewrite§ ?==?( a, b )§\use{?==?}§
    1741 a != b §\rewrite§ ?!=?( a, b )§\use{?"!=?}§
     1877a == b @\rewrite@ ?==?( a, b )@\use{?==?}@
     1878a != b @\rewrite@ ?!=?( a, b )@\use{?"!=?}@
    17421879\end{lstlisting}
    17431880
     
    17921929        ?==?( forall( ftype FT2) FT2*, forall( ftype FT3) FT3 * ), ?!=?( forall( ftype FT2) FT2*, forall( ftype FT3) FT3 * );
    17931930\end{lstlisting}
    1794 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1931For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    17951932% Don't use predefined: keep this out of prelude.cf.
    17961933\begin{lstlisting}
     
    18001937
    18011938\begin{rationale}
    1802 The polymorphic equality operations come in three styles: comparisons between pointers of compatible types, between pointers to \lstinline@void@ and pointers to object types or incomplete types, and between the \Index{null pointer} constant and pointers to any type.
     1939The polymorphic equality operations come in three styles: comparisons between pointers of compatible types, between pointers to \lstinline$void$ and pointers to object types or incomplete types, and between the \Index{null pointer} constant and pointers to any type.
    18031940In the last case, a special constraint rule for null pointer constant operands has been replaced by a consequence of the \CFA type system.
    18041941\end{rationale}
     
    18211958\lhs{AND-expression}
    18221959\rhs \nonterm{equality-expression}
    1823 \rhs \nonterm{AND-expression} \lstinline@&@ \nonterm{equality-expression}
     1960\rhs \nonterm{AND-expression} \lstinline$&$ \nonterm{equality-expression}
    18241961\end{syntax}
    18251962
    18261963\rewriterules
    18271964\begin{lstlisting}
    1828 a & b §\rewrite§ ?&?( a, b )§\use{?&?}§
     1965a & b @\rewrite@ ?&?( a, b )@\use{?&?}@
    18291966\end{lstlisting}
    18301967
     
    18381975long long unsigned int ?&?( long long unsigned int, long long unsigned int );
    18391976\end{lstlisting}
    1840 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     1977For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    18411978% Don't use predefined: keep this out of prelude.cf.
    18421979\begin{lstlisting}
     
    18531990\lhs{exclusive-OR-expression}
    18541991\rhs \nonterm{AND-expression}
    1855 \rhs \nonterm{exclusive-OR-expression} \lstinline@^@ \nonterm{AND-expression}
     1992\rhs \nonterm{exclusive-OR-expression} \lstinline$^$ \nonterm{AND-expression}
    18561993\end{syntax}
    18571994
    18581995\rewriterules
    18591996\begin{lstlisting}
    1860 a ^ b §\rewrite§ ?^?( a, b )§\use{?^?}§
     1997a ^ b @\rewrite@ ?^?( a, b )@\use{?^?}@
    18611998\end{lstlisting}
    18621999
     
    18702007long long unsigned int ?^?( long long unsigned int, long long unsigned int );
    18712008\end{lstlisting}
    1872 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     2009For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    18732010% Don't use predefined: keep this out of prelude.cf.
    18742011\begin{lstlisting}
     
    18852022\lhs{inclusive-OR-expression}
    18862023\rhs \nonterm{exclusive-OR-expression}
    1887 \rhs \nonterm{inclusive-OR-expression} \lstinline@|@ \nonterm{exclusive-OR-expression}
     2024\rhs \nonterm{inclusive-OR-expression} \lstinline$|$ \nonterm{exclusive-OR-expression}
    18882025\end{syntax}
    18892026
    18902027\rewriterules\use{?"|?}
    18912028\begin{lstlisting}
    1892 a | b §\rewrite§ ?|?( a, b )
     2029a | b @\rewrite@ ?|?( a, b )
    18932030\end{lstlisting}
    18942031
     
    19022039long long unsigned int ?|?( long long unsigned int, long long unsigned int );
    19032040\end{lstlisting}
    1904 For every extended integer type \lstinline@X@ with \Index{integer conversion rank} greater than the rank of \lstinline@int@ there exist
     2041For every extended integer type \lstinline$X$ with \Index{integer conversion rank} greater than the rank of \lstinline$int$ there exist
    19052042% Don't use predefined: keep this out of prelude.cf.
    19062043\begin{lstlisting}
     
    19172054\lhs{logical-AND-expression}
    19182055\rhs \nonterm{inclusive-OR-expression}
    1919 \rhs \nonterm{logical-AND-expression} \lstinline@&&@ \nonterm{inclusive-OR-expression}
     2056\rhs \nonterm{logical-AND-expression} \lstinline$&&$ \nonterm{inclusive-OR-expression}
    19202057\end{syntax}
    19212058
    1922 \semantics The operands of the expression ``\lstinline@a && b@'' are treated as
    1923 ``\lstinline@(int)((a)!=0)@'' and ``\lstinline@(int)((b)!=0)@'', which shall both be unambiguous.
    1924 The expression has only one interpretation, which is of type \lstinline@int@.
    1925 \begin{rationale}
    1926 When the operands of a logical expression are values of built-in types, and ``\lstinline@!=@'' has not been redefined for those types, the compiler can optimize away the function calls.
    1927 
    1928 A common C idiom omits comparisons to \lstinline@0@ in the controlling expressions of loops and
    1929 \lstinline@if@ statements.
    1930 For instance, the loop below iterates as long as \lstinline@rp@ points at a \lstinline@Rational@ value that is non-zero.
    1931 
    1932 \begin{lstlisting}
    1933 extern otype Rational;§\use{Rational}§
    1934 extern const Rational 0;§\use{0}§
     2059\semantics The operands of the expression ``\lstinline$a && b$'' are treated as
     2060``\lstinline$(int)((a)!=0)$'' and ``\lstinline$(int)((b)!=0)$'', which shall both be unambiguous.
     2061The expression has only one interpretation, which is of type \lstinline$int$.
     2062\begin{rationale}
     2063When the operands of a logical expression are values of built-in types, and ``\lstinline$!=$'' has not been redefined for those types, the compiler can optimize away the function calls.
     2064
     2065A common C idiom omits comparisons to \lstinline$0$ in the controlling expressions of loops and
     2066\lstinline$if$ statements.
     2067For instance, the loop below iterates as long as \lstinline$rp$ points at a \lstinline$Rational$ value that is non-zero.
     2068
     2069\begin{lstlisting}
     2070extern otype Rational;@\use{Rational}@
     2071extern const Rational 0;@\use{0}@
    19352072extern int ?!=?( Rational, Rational );
    19362073Rational *rp;
    19372074while ( rp && *rp ) { ... }
    19382075\end{lstlisting}
    1939 The logical expression calls the \lstinline@Rational@ inequality operator, passing it \lstinline@*rp@ and the \lstinline@Rational 0@, and getting a 1 or 0 as a result.
    1940 In contrast, {\CC} would apply a programmer-defined \lstinline@Rational@-to-\lstinline@int@ conversion to \lstinline@*rp@ in the equivalent situation.
    1941 The conversion to \lstinline@int@ would produce a general integer value, which is unfortunate, and possibly dangerous if the conversion was not written with this situation in mind.
     2076The logical expression calls the \lstinline$Rational$ inequality operator, passing it \lstinline$*rp$ and the \lstinline$Rational 0$, and getting a 1 or 0 as a result.
     2077In contrast, {\CC} would apply a programmer-defined \lstinline$Rational$-to-\lstinline$int$ conversion to \lstinline$*rp$ in the equivalent situation.
     2078The conversion to \lstinline$int$ would produce a general integer value, which is unfortunate, and possibly dangerous if the conversion was not written with this situation in mind.
    19422079\end{rationale}
    19432080
     
    19482085\lhs{logical-OR-expression}
    19492086\rhs \nonterm{logical-AND-expression}
    1950 \rhs \nonterm{logical-OR-expression} \lstinline@||@ \nonterm{logical-AND-expression}
     2087\rhs \nonterm{logical-OR-expression} \lstinline$||$ \nonterm{logical-AND-expression}
    19512088\end{syntax}
    19522089
    19532090\semantics
    19542091
    1955 The operands of the expression ``\lstinline@a || b@'' are treated as ``\lstinline@(int)((a)!=0)@'' and ``\lstinline@(int)((b))!=0)@'', which shall both be unambiguous.
    1956 The expression has only one interpretation, which is of type \lstinline@int@.
     2092The operands of the expression ``\lstinline$a || b$'' are treated as ``\lstinline$(int)((a)!=0)$'' and ``\lstinline$(int)((b))!=0)$'', which shall both be unambiguous.
     2093The expression has only one interpretation, which is of type \lstinline$int$.
    19572094
    19582095
     
    19622099\lhs{conditional-expression}
    19632100\rhs \nonterm{logical-OR-expression}
    1964 \rhs \nonterm{logical-OR-expression} \lstinline@?@ \nonterm{expression}
    1965          \lstinline@:@ \nonterm{conditional-expression}
     2101\rhs \nonterm{logical-OR-expression} \lstinline$?$ \nonterm{expression}
     2102         \lstinline$:$ \nonterm{conditional-expression}
    19662103\end{syntax}
    19672104
    19682105\semantics
    1969 In the conditional expression\use{?:} ``\lstinline@a?b:c@'', if the second and third operands both have an interpretation with \lstinline@void@ type, then the expression has an interpretation with type \lstinline@void@, equivalent to
     2106In the conditional expression\use{?:} ``\lstinline$a?b:c$'', if the second and third operands both have an interpretation with \lstinline$void$ type, then the expression has an interpretation with type \lstinline$void$, equivalent to
    19702107\begin{lstlisting}
    19712108( int)(( a)!=0) ? ( void)( b) : ( void)( c)
    19722109\end{lstlisting}
    19732110
    1974 If the second and third operands both have interpretations with non-\lstinline@void@ types, the expression is treated as if it were the call ``\lstinline@cond((a)!=0, b, c)@'', with \lstinline@cond@ declared as
     2111If the second and third operands both have interpretations with non-\lstinline$void$ types, the expression is treated as if it were the call ``\lstinline$cond((a)!=0, b, c)$'', with \lstinline$cond$ declared as
    19752112\begin{lstlisting}
    19762113forall( otype T ) T cond( int, T, T );
     
    20242161rand() ? i : l;
    20252162\end{lstlisting}
    2026 The best interpretation infers the expression's type to be \lstinline@long@ and applies the safe
    2027 \lstinline@int@-to-\lstinline@long@ conversion to \lstinline@i@.
     2163The best interpretation infers the expression's type to be \lstinline$long$ and applies the safe
     2164\lstinline$int$-to-\lstinline$long$ conversion to \lstinline$i$.
    20282165
    20292166\begin{lstlisting}
     
    20322169rand() ? cip : vip;
    20332170\end{lstlisting}
    2034 The expression has type \lstinline@const volatile int *@, with safe conversions applied to the second and third operands to add \lstinline@volatile@ and \lstinline@const@ qualifiers, respectively.
     2171The expression has type \lstinline$const volatile int *$, with safe conversions applied to the second and third operands to add \lstinline$volatile$ and \lstinline$const$ qualifiers, respectively.
    20352172
    20362173\begin{lstlisting}
    20372174rand() ? cip : 0;
    20382175\end{lstlisting}
    2039 The expression has type \lstinline@const int *@, with a specialization conversion applied to
    2040 \lstinline@0@.
     2176The expression has type \lstinline$const int *$, with a specialization conversion applied to
     2177\lstinline$0$.
    20412178
    20422179
     
    20492186         \nonterm{assignment-expression}
    20502187\lhs{assignment-operator} one of
    2051 \rhs \lstinline@=@\ \ \lstinline@*=@\ \ \lstinline@/=@\ \ \lstinline@%=@\ \ \lstinline@+=@\ \ \lstinline@-=@\ \ 
    2052          \lstinline@<<=@\ \ \lstinline@>>=@\ \ \lstinline@&=@\ \ \lstinline@^=@\ \ \lstinline@|=@
     2188\rhs \lstinline$=$\ \ \lstinline$*=$\ \ \lstinline$/=$\ \ \lstinline$%=$\ \ \lstinline$+=$\ \ \lstinline$-=$\ \ 
     2189         \lstinline$<<=$\ \ \lstinline$>>=$\ \ \lstinline$&=$\ \ \lstinline$^=$\ \ \lstinline$|=$
    20532190\end{syntax}
    20542191
     
    20592196\use{?>>=?}\use{?&=?}\use{?^=?}\use{?"|=?}%use{?<<=?}
    20602197\begin{lstlisting}
    2061 a §$\leftarrow$§ b §\rewrite§ ?§$\leftarrow$§?( &( a ), b )
     2198a @$\leftarrow$@ b @\rewrite@ ?@$\leftarrow$@?( &( a ), b )
    20622199\end{lstlisting}
    20632200
    20642201\semantics
    20652202Each interpretation of the left operand of an assignment expression is considered separately.
    2066 For each interpretation that is a bit-field or is declared with the \lstinline@register@ storage class specifier, the expression has one valid interpretation, with the type of the left operand.
     2203For each interpretation that is a bit-field or is declared with the \lstinline$register$ storage class specifier, the expression has one valid interpretation, with the type of the left operand.
    20672204The right operand is cast to that type, and the assignment expression is ambiguous if either operand is.
    20682205For the remaining interpretations, the expression is rewritten, and the interpretations of the assignment expression are the interpretations of the corresponding function call.
     
    22972434\end{lstlisting}
    22982435\begin{rationale}
    2299 The pattern of overloadings for simple assignment resembles that of pointer increment and decrement, except that the polymorphic pointer assignment functions declare a \lstinline@dtype@ parameter, instead of a \lstinline@type@ parameter, because the left operand may be a pointer to an incomplete type.
    2300 \end{rationale}
    2301 
    2302 For every complete structure or union type \lstinline@S@ there exist
     2436The pattern of overloadings for simple assignment resembles that of pointer increment and decrement, except that the polymorphic pointer assignment functions declare a \lstinline$dtype$ parameter, instead of a \lstinline$type$ parameter, because the left operand may be a pointer to an incomplete type.
     2437\end{rationale}
     2438
     2439For every complete structure or union type \lstinline$S$ there exist
    23032440% Don't use predefined: keep this out of prelude.cf.
    23042441\begin{lstlisting}
     
    23062443\end{lstlisting}
    23072444
    2308 For every extended integer type \lstinline@X@ there exist
     2445For every extended integer type \lstinline$X$ there exist
    23092446% Don't use predefined: keep this out of prelude.cf.
    23102447\begin{lstlisting}
     
    23122449\end{lstlisting}
    23132450
    2314 For every complete enumerated type \lstinline@E@ there exist
     2451For every complete enumerated type \lstinline$E$ there exist
    23152452% Don't use predefined: keep this out of prelude.cf.
    23162453\begin{lstlisting}
     
    23182455\end{lstlisting}
    23192456\begin{rationale}
    2320 The right-hand argument is \lstinline@int@ because enumeration constants have type \lstinline@int@.
     2457The right-hand argument is \lstinline$int$ because enumeration constants have type \lstinline$int$.
    23212458\end{rationale}
    23222459
     
    25792716\end{lstlisting}
    25802717
    2581 For every extended integer type \lstinline@X@ there exist
     2718For every extended integer type \lstinline$X$ there exist
    25822719% Don't use predefined: keep this out of prelude.cf.
    25832720\begin{lstlisting}
     
    25942731\end{lstlisting}
    25952732
    2596 For every complete enumerated type \lstinline@E@ there exist
     2733For every complete enumerated type \lstinline$E$ there exist
    25972734% Don't use predefined: keep this out of prelude.cf.
    25982735\begin{lstlisting}
     
    26152752\lhs{expression}
    26162753\rhs \nonterm{assignment-expression}
    2617 \rhs \nonterm{expression} \lstinline@,@ \nonterm{assignment-expression}
     2754\rhs \nonterm{expression} \lstinline$,$ \nonterm{assignment-expression}
    26182755\end{syntax}
    26192756
    26202757\semantics
    2621 In the comma expression ``\lstinline@a, b@'', the first operand is interpreted as
    2622 ``\lstinline@( void )(a)@'', which shall be unambiguous\index{ambiguous interpretation}.
     2758In the comma expression ``\lstinline$a, b$'', the first operand is interpreted as
     2759``\lstinline$( void )(a)$'', which shall be unambiguous\index{ambiguous interpretation}.
    26232760The interpretations of the expression are the interpretations of the second operand.
    26242761
     
    26552792{ ... }
    26562793\end{lstlisting}
    2657 Without the rule, \lstinline@Complex@ would be a type in the first case, and a parameter name in the second.
     2794Without the rule, \lstinline$Complex$ would be a type in the first case, and a parameter name in the second.
    26582795\end{rationale}
    26592796
     
    26812818\examples
    26822819\begin{lstlisting}
    2683 struct point {§\impl{point}§
     2820struct point {@\impl{point}@
    26842821        int x, y;
    26852822};
    2686 struct color_point {§\impl{color_point}§
     2823struct color_point {@\impl{color_point}@
    26872824        enum { RED, BLUE, GREEN } color;
    26882825        struct point;
     
    26912828cp.x = 0;
    26922829cp.color = RED;
    2693 struct literal {§\impl{literal}§
     2830struct literal {@\impl{literal}@
    26942831        enum { NUMBER, STRING } tag;
    26952832        union {
     
    27122849\begin{syntax}
    27132850\lhs{forall-specifier}
    2714 \rhs \lstinline@forall@ \lstinline@(@ \nonterm{type-parameter-list} \lstinline@)@
     2851\rhs \lstinline$forall$ \lstinline$($ \nonterm{type-parameter-list} \lstinline$)$
    27152852\end{syntax}
    27162853
     
    27242861} mkPair( T, T ); // illegal
    27252862\end{lstlisting}
    2726 If an instance of \lstinline@struct Pair@ was declared later in the current scope, what would the members' type be?
     2863If an instance of \lstinline$struct Pair$ was declared later in the current scope, what would the members' type be?
    27272864\end{rationale}
    27282865\end{comment}
     
    27312868The \nonterm{type-parameter-list}s and assertions of the \nonterm{forall-specifier}s declare type identifiers, function and object identifiers with \Index{no linkage}.
    27322869
    2733 If, in the declaration ``\lstinline@T D@'', \lstinline@T@ contains \nonterm{forall-specifier}s and
    2734 \lstinline@D@ has the form
    2735 \begin{lstlisting}
    2736 D( §\normalsize\nonterm{parameter-type-list}§ )
    2737 \end{lstlisting} then a type identifier declared by one of the \nonterm{forall-specifier}s is an \define{inferred parameter} of the function declarator if and only if it is not an inferred parameter of a function declarator in \lstinline@D@, and it is used in the type of a parameter in the following
     2870If, in the declaration ``\lstinline$T D$'', \lstinline$T$ contains \nonterm{forall-specifier}s and
     2871\lstinline$D$ has the form
     2872\begin{lstlisting}
     2873D( @\normalsize\nonterm{parameter-type-list}@ )
     2874\end{lstlisting} then a type identifier declared by one of the \nonterm{forall-specifier}s is an \define{inferred parameter} of the function declarator if and only if it is not an inferred parameter of a function declarator in \lstinline$D$, and it is used in the type of a parameter in the following
    27382875\nonterm{type-parameter-list} or it and an inferred parameter are used as arguments of a
    27392876\Index{specification} in one of the \nonterm{forall-specifier}s.
     
    27462883If this restriction were lifted, it would be possible to write
    27472884\begin{lstlisting}
    2748 forall( otype T ) T * alloc( void );§\use{alloc}§ int *p = alloc();
    2749 \end{lstlisting}
    2750 Here \lstinline@alloc()@ would receive \lstinline@int@ as an inferred argument, and return an
    2751 \lstinline@int *@.
    2752 In general, if a call to \lstinline@alloc()@ is a subexpression of an expression involving polymorphic functions and overloaded identifiers, there could be considerable distance between the call and the subexpression that causes \lstinline@T@ to be bound.
    2753 
    2754 With the current restriction, \lstinline@alloc()@ must be given an argument that determines
    2755 \lstinline@T@:
    2756 \begin{lstlisting}
    2757 forall( otype T ) T * alloc( T initial_value );§\use{alloc}§
     2885forall( otype T ) T * alloc( void );@\use{alloc}@ int *p = alloc();
     2886\end{lstlisting}
     2887Here \lstinline$alloc()$ would receive \lstinline$int$ as an inferred argument, and return an
     2888\lstinline$int *$.
     2889In general, if a call to \lstinline$alloc()$ is a subexpression of an expression involving polymorphic functions and overloaded identifiers, there could be considerable distance between the call and the subexpression that causes \lstinline$T$ to be bound.
     2890
     2891With the current restriction, \lstinline$alloc()$ must be given an argument that determines
     2892\lstinline$T$:
     2893\begin{lstlisting}
     2894forall( otype T ) T * alloc( T initial_value );@\use{alloc}@
    27582895\end{lstlisting}
    27592896\end{rationale}
     
    27802917forall( otype T ) T fT( T );
    27812918\end{lstlisting}
    2782 \lstinline@fi()@ takes an \lstinline@int@ and returns an \lstinline@int@. \lstinline@fT()@ takes a
    2783 \lstinline@T@ and returns a \lstinline@T@, for any type \lstinline@T@.
     2919\lstinline$fi()$ takes an \lstinline$int$ and returns an \lstinline$int$. \lstinline$fT()$ takes a
     2920\lstinline$T$ and returns a \lstinline$T$, for any type \lstinline$T$.
    27842921\begin{lstlisting}
    27852922int (*pfi )( int ) = fi;
    27862923forall( otype T ) T (*pfT )( T ) = fT;
    27872924\end{lstlisting}
    2788 \lstinline@pfi@ and \lstinline@pfT@ are pointers to functions. \lstinline@pfT@ is not polymorphic, but the function it points at is.
     2925\lstinline$pfi$ and \lstinline$pfT$ are pointers to functions. \lstinline$pfT$ is not polymorphic, but the function it points at is.
    27892926\begin{lstlisting}
    27902927int (*fvpfi( void ))( int ) {
     
    27952932}
    27962933\end{lstlisting}
    2797 \lstinline@fvpfi()@ and \lstinline@fvpfT()@ are functions taking no arguments and returning pointers to functions. \lstinline@fvpfT()@ is monomorphic, but the function that its return value points at is polymorphic.
     2934\lstinline$fvpfi()$ and \lstinline$fvpfT()$ are functions taking no arguments and returning pointers to functions. \lstinline$fvpfT()$ is monomorphic, but the function that its return value points at is polymorphic.
    27982935\begin{lstlisting}
    27992936forall( otype T ) int ( *fTpfi( T ) )( int );
     
    28012938forall( otype T, otype U ) U ( *fTpfU( T ) )( U );
    28022939\end{lstlisting}
    2803 \lstinline@fTpfi()@ is a polymorphic function that returns a pointer to a monomorphic function taking an integer and returning an integer.
    2804 It could return \lstinline@pfi@. \lstinline@fTpfT()@ is subtle: it is a polymorphic function returning a \emph{monomorphic} function taking and returning
    2805 \lstinline@T@, where \lstinline@T@ is an inferred parameter of \lstinline@fTpfT()@.
    2806 For instance, in the expression ``\lstinline@fTpfT(17)@'', \lstinline@T@ is inferred to be \lstinline@int@, and the returned value would have type \lstinline@int ( * )( int )@. ``\lstinline@fTpfT(17)(13)@'' and
    2807 ``\lstinline@fTpfT("yes")("no")@'' are legal, but ``\lstinline@fTpfT(17)("no")@'' is illegal.
    2808 \lstinline@fTpfU()@ is polymorphic ( in type \lstinline@T@), and returns a pointer to a function that is polymorphic ( in type \lstinline@U@). ``\lstinline@f5(17)("no")@'' is a legal expression of type
    2809 \lstinline@char *@.
     2940\lstinline$fTpfi()$ is a polymorphic function that returns a pointer to a monomorphic function taking an integer and returning an integer.
     2941It could return \lstinline$pfi$. \lstinline$fTpfT()$ is subtle: it is a polymorphic function returning a \emph{monomorphic} function taking and returning
     2942\lstinline$T$, where \lstinline$T$ is an inferred parameter of \lstinline$fTpfT()$.
     2943For instance, in the expression ``\lstinline$fTpfT(17)$'', \lstinline$T$ is inferred to be \lstinline$int$, and the returned value would have type \lstinline$int ( * )( int )$. ``\lstinline$fTpfT(17)(13)$'' and
     2944``\lstinline$fTpfT("yes")("no")$'' are legal, but ``\lstinline$fTpfT(17)("no")$'' is illegal.
     2945\lstinline$fTpfU()$ is polymorphic ( in type \lstinline$T$), and returns a pointer to a function that is polymorphic ( in type \lstinline$U$). ``\lstinline$f5(17)("no")$'' is a legal expression of type
     2946\lstinline$char *$.
    28102947\begin{lstlisting}
    28112948forall( otype T, otype U, otype V ) U * f( T *, U, V * const );
    28122949forall( otype U, otype V, otype W ) U * g( V *, U, W * const );
    28132950\end{lstlisting}
    2814 The functions \lstinline@f()@ and \lstinline@g()@ have compatible types.
     2951The functions \lstinline$f()$ and \lstinline$g()$ have compatible types.
    28152952Let \(f\) and \(g\) be their types;
    2816 then \(f_1\) = \lstinline@T@, \(f_2\) = \lstinline@U@, \(f_3\) = \lstinline@V@, \(g_1\)
    2817 = \lstinline@V@, \(g_2\) = \lstinline@U@, and \(g_3\) = \lstinline@W@.
     2953then \(f_1\) = \lstinline$T$, \(f_2\) = \lstinline$U$, \(f_3\) = \lstinline$V$, \(g_1\)
     2954= \lstinline$V$, \(g_2\) = \lstinline$U$, and \(g_3\) = \lstinline$W$.
    28182955Replacing every \(f_i\) by \(g_i\) in \(f\) gives
    28192956\begin{lstlisting}
     
    28212958\end{lstlisting} which has a return type and parameter list that is compatible with \(g\).
    28222959\begin{rationale}
    2823 The word ``\lstinline@type@'' in a forall specifier is redundant at the moment, but I want to leave room for inferred parameters of ordinary types in case parameterized types get added one day.
     2960The word ``\lstinline$type$'' in a forall specifier is redundant at the moment, but I want to leave room for inferred parameters of ordinary types in case parameterized types get added one day.
    28242961
    28252962Even without parameterized types, I might try to allow
     
    28472984\subsection{Type qualifiers}
    28482985
    2849 \CFA defines a new type qualifier \lstinline@lvalue@\impl{lvalue}\index{lvalue}.
     2986\CFA defines a new type qualifier \lstinline$lvalue$\impl{lvalue}\index{lvalue}.
    28502987\begin{syntax}
    28512988\oldlhs{type-qualifier}
    2852 \rhs \lstinline@lvalue@
     2989\rhs \lstinline$lvalue$
    28532990\end{syntax}
    28542991
    28552992\constraints
    2856 \Indexc{restrict} Types other than type parameters and pointer types whose referenced type is an object type shall not be restrict-qualified.
     2993\lstinline$restrict$\index{register@{\lstinline$restrict$}} Types other than type parameters and pointer types whose referenced type is an object type shall not be restrict-qualified.
    28572994
    28582995\semantics
    2859 An object's type may be a restrict-qualified type parameter.
    2860 \lstinline@restrict@ does not establish any special semantics in that case.
     2996An object's type may be a restrict-qualified type parameter. \lstinline$restrict$ does not establish any special semantics in that case.
    28612997
    28622998\begin{rationale}
     
    28643000\end{rationale}
    28653001
    2866 \lstinline@lvalue@ may be used to qualify the return type of a function type.
    2867 Let \lstinline@T@ be an unqualified version of a type;
     3002\lstinline$lvalue$ may be used to qualify the return type of a function type.
     3003Let \lstinline$T$ be an unqualified version of a type;
    28683004then the result of calling a function with return type
    2869 \lstinline@lvalue T@ is a \Index{modifiable lvalue} of type \lstinline@T@.
    2870 \lstinline@const@\use{const} and \lstinline@volatile@\use{volatile} qualifiers may also be added to indicate that the function result is a constant or volatile lvalue.
    2871 \begin{rationale}
    2872 The \lstinline@const@ and \lstinline@volatile@ qualifiers can only be sensibly used to qualify the return type of a function if the \lstinline@lvalue@ qualifier is also used.
     3005\lstinline$lvalue T$ is a \Index{modifiable lvalue} of type \lstinline$T$.
     3006\lstinline$const$\use{const} and \lstinline$volatile$\use{volatile} qualifiers may also be added to indicate that the function result is a constant or volatile lvalue.
     3007\begin{rationale}
     3008The \lstinline$const$ and \lstinline$volatile$ qualifiers can only be sensibly used to qualify the return type of a function if the \lstinline$lvalue$ qualifier is also used.
    28733009\end{rationale}
    28743010
     
    28773013
    28783014\begin{rationale}
    2879 \lstinline@lvalue@ provides some of the functionality of {\CC}'s ``\lstinline@T&@'' ( reference to object of type \lstinline@T@) type.
     3015\lstinline$lvalue$ provides some of the functionality of {\CC}'s ``\lstinline$T&$'' ( reference to object of type \lstinline$T$) type.
    28803016Reference types have four uses in {\CC}.
    28813017\begin{itemize}
    28823018\item
    2883 They are necessary for user-defined operators that return lvalues, such as ``subscript'' and ``dereference''.
    2884 
    2885 \item
    2886 A reference can be used to define an alias for a complicated lvalue expression, as a way of getting some of the functionality of the Pascal \lstinline@with@ statement.
     3019They are necessary for user-defined operators that return lvalues, such as ``subscript'' and
     3020``dereference''.
     3021
     3022\item
     3023A reference can be used to define an alias for a complicated lvalue expression, as a way of getting some of the functionality of the Pascal \lstinline$with$ statement.
    28873024The following {\CC} code gives an example.
    28883025\begin{lstlisting}
     
    28973034A reference parameter can be used to allow a function to modify an argument without forcing the caller to pass the address of the argument.
    28983035This is most useful for user-defined assignment operators.
    2899 In {\CC}, plain assignment is done by a function called ``\lstinline@operator=@'', and the two expressions
     3036In {\CC}, plain assignment is done by a function called ``\lstinline$operator=$'', and the two expressions
    29003037\begin{lstlisting}
    29013038a = b;
    29023039operator=( a, b );
    29033040\end{lstlisting} are equivalent.
    2904 If \lstinline@a@ and \lstinline@b@ are of type \lstinline@T@, then the first parameter of \lstinline@operator=@ must have type ``\lstinline@T&@''.
     3041If \lstinline$a$ and \lstinline$b$ are of type \lstinline$T$, then the first parameter of \lstinline$operator=$ must have type ``\lstinline$T&$''.
    29053042It cannot have type
    2906 \lstinline@T@, because then assignment couldn't alter the variable, and it can't have type
    2907 ``\lstinline@T *@'', because the assignment would have to be written ``\lstinline@&a = b;@''.
    2908 
    2909 In the case of user-defined operators, this could just as well be handled by using pointer types and by changing the rewrite rules so that ``\lstinline@a = b;@'' is equivalent to
    2910 ``\lstinline@operator=(&( a), b )@''.
    2911 Reference parameters of ``normal'' functions are Bad Things, because they remove a useful property of C function calls: an argument can only be modified by a function if it is preceded by ``\lstinline@&@''.
     3043\lstinline$T$, because then assignment couldn't alter the variable, and it can't have type
     3044``\lstinline$T *$'', because the assignment would have to be written ``\lstinline$&a = b;$''.
     3045
     3046In the case of user-defined operators, this could just as well be handled by using pointer types and by changing the rewrite rules so that ``\lstinline$a = b;$'' is equivalent to
     3047``\lstinline$operator=(&( a), b )$''.
     3048Reference parameters of ``normal'' functions are Bad Things, because they remove a useful property of C function calls: an argument can only be modified by a function if it is preceded by ``\lstinline$&$''.
    29123049
    29133050\item
    29143051References to \Index{const-qualified} types can be used instead of value parameters.  Given the
    2915 {\CC} function call ``\lstinline@fiddle( a_thing )@'', where the type of \lstinline@a_thing@ is
    2916 \lstinline@Thing@, the type of \lstinline@fiddle@ could be either of
     3052{\CC} function call ``\lstinline$fiddle( a_thing )$'', where the type of \lstinline$a_thing$ is
     3053\lstinline$Thing$, the type of \lstinline$fiddle$ could be either of
    29173054\begin{lstlisting}
    29183055void fiddle( Thing );
    29193056void fiddle( const Thing & );
    29203057\end{lstlisting}
    2921 If the second form is used, then constructors and destructors are not invoked to create a temporary variable at the call site ( and it is bad style for the caller to make any assumptions about such things), and within \lstinline@fiddle@ the parameter is subject to the usual problems caused by aliases.
    2922 The reference form might be chosen for efficiency's sake if \lstinline@Thing@s are too large or their constructors or destructors are too expensive.
     3058If the second form is used, then constructors and destructors are not invoked to create a temporary variable at the call site ( and it is bad style for the caller to make any assumptions about such things), and within \lstinline$fiddle$ the parameter is subject to the usual problems caused by aliases.
     3059The reference form might be chosen for efficiency's sake if \lstinline$Thing$s are too large or their constructors or destructors are too expensive.
    29233060An implementation may switch between them without causing trouble for well-behaved clients.
    29243061This leaves the implementor to define ``too large'' and ``too expensive''.
     
    29283065void fiddle( const volatile Thing );
    29293066\end{lstlisting} with call-by-reference.
    2930 Since it knows all about the size of \lstinline@Thing@s and the parameter passing mechanism, it should be able to come up with a better definition of ``too large'', and may be able to make a good guess at ``too expensive''.
     3067Since it knows all about the size of \lstinline$Thing$s and the parameter passing mechanism, it should be able to come up with a better definition of ``too large'', and may be able to make a good guess at ``too expensive''.
    29313068\end{itemize}
    29323069
     
    29483085\begin{syntax}
    29493086\lhs{spec-definition}
    2950 \rhs \lstinline@spec@ \nonterm{identifier}
    2951         \lstinline@(@ \nonterm{type-parameter-list} \lstinline@)@
    2952         \lstinline@{@ \nonterm{spec-declaration-list}\opt \lstinline@}@
     3087\rhs \lstinline$spec$ \nonterm{identifier}
     3088        \lstinline$($ \nonterm{type-parameter-list} \lstinline$)$
     3089        \lstinline${$ \nonterm{spec-declaration-list}\opt \lstinline$}$
    29533090\lhs{spec-declaration-list}
    2954 \rhs \nonterm{spec-declaration} \lstinline@;@
    2955 \rhs \nonterm{spec-declaration-list} \nonterm{spec-declaration} \lstinline@;@
     3091\rhs \nonterm{spec-declaration} \lstinline$;$
     3092\rhs \nonterm{spec-declaration-list} \nonterm{spec-declaration} \lstinline$;$
    29563093\lhs{spec-declaration}
    29573094\rhs \nonterm{specifier-qualifier-list} \nonterm{declarator-list}
    29583095\lhs{declarator-list}
    29593096\rhs \nonterm{declarator}
    2960 \rhs \nonterm{declarator-list} \lstinline@,@ \nonterm{declarator}
     3097\rhs \nonterm{declarator-list} \lstinline$,$ \nonterm{declarator}
    29613098\end{syntax}
    29623099\begin{rationale}
     
    29803117\rhs \nonterm{assertion-list} \nonterm{assertion}
    29813118\lhs{assertion}
    2982 \rhs \lstinline@|@ \nonterm{identifier} \lstinline@(@ \nonterm{type-name-list} \lstinline@)@
    2983 \rhs \lstinline@|@ \nonterm{spec-declaration}
     3119\rhs \lstinline$|$ \nonterm{identifier} \lstinline$($ \nonterm{type-name-list} \lstinline$)$
     3120\rhs \lstinline$|$ \nonterm{spec-declaration}
    29843121\lhs{type-name-list}
    29853122\rhs \nonterm{type-name}
    2986 \rhs \nonterm{type-name-list} \lstinline@,@ \nonterm{type-name}
     3123\rhs \nonterm{type-name-list} \lstinline$,$ \nonterm{type-name}
    29873124\end{syntax}
    29883125
     
    29913128The \nonterm{type-name-list} shall contain one \nonterm{type-name} argument for each \nonterm{type-parameter} in that specification's \nonterm{spec-parameter-list}.
    29923129If the
    2993 \nonterm{type-parameter} uses type-class \lstinline@type@\use{type}, the argument shall be the type name of an \Index{object type};
    2994 if it uses \lstinline@dtype@, the argument shall be the type name of an object type or an \Index{incomplete type};
    2995 and if it uses \lstinline@ftype@, the argument shall be the type name of a \Index{function type}.
     3130\nonterm{type-parameter} uses type-class \lstinline$type$\use{type}, the argument shall be the type name of an \Index{object type};
     3131if it uses \lstinline$dtype$, the argument shall be the type name of an object type or an \Index{incomplete type};
     3132and if it uses \lstinline$ftype$, the argument shall be the type name of a \Index{function type}.
    29963133
    29973134\semantics
     
    30063143\examples
    30073144\begin{lstlisting}
    3008 forall( otype T | T ?*?( T, T ))§\use{?*?}§
    3009 T square( T val ) {§\impl{square}§
     3145forall( otype T | T ?*?( T, T ))@\use{?*?}@
     3146T square( T val ) {@\impl{square}@
    30103147        return val + val;
    30113148}
    3012 trait summable( otype T ) {§\impl{summable}§
    3013         T ?+=?( T *, T );§\use{?+=?}§
    3014         const T 0;§\use{0}§
     3149trait summable( otype T ) {@\impl{summable}@
     3150        T ?+=?( T *, T );@\use{?+=?}@
     3151        const T 0;@\use{0}@
    30153152};
    3016 trait list_of( otype List, otype Element ) {§\impl{list_of}§
     3153trait list_of( otype List, otype Element ) {@\impl{list_of}@
    30173154        Element car( List );
    30183155        List cdr( List );
     
    30233160trait sum_list( otype List, otype Element | summable( Element ) | list_of( List, Element ) ) {};
    30243161\end{lstlisting}
    3025 \lstinline@sum_list@ contains seven declarations, which describe a list whose elements can be added up.
    3026 The assertion ``\lstinline@|sum_list( i_list, int )@''\use{sum_list} produces the assertion parameters
     3162\lstinline$sum_list$ contains seven declarations, which describe a list whose elements can be added up.
     3163The assertion ``\lstinline$|sum_list( i_list, int )$''\use{sum_list} produces the assertion parameters
    30273164\begin{lstlisting}
    30283165int ?+=?( int *, int );
     
    30413178\lhs{type-parameter-list}
    30423179\rhs \nonterm{type-parameter}
    3043 \rhs \nonterm{type-parameter-list} \lstinline@,@ \nonterm{type-parameter}
     3180\rhs \nonterm{type-parameter-list} \lstinline$,$ \nonterm{type-parameter}
    30443181\lhs{type-parameter}
    30453182\rhs \nonterm{type-class} \nonterm{identifier} \nonterm{assertion-list}\opt
    30463183\lhs{type-class}
    3047 \rhs \lstinline@type@
    3048 \rhs \lstinline@dtype@
    3049 \rhs \lstinline@ftype@
     3184\rhs \lstinline$type$
     3185\rhs \lstinline$dtype$
     3186\rhs \lstinline$ftype$
    30503187\lhs{type-declaration}
    3051 \rhs \nonterm{storage-class-specifier}\opt \lstinline@type@ \nonterm{type-declarator-list} \verb|;|
     3188\rhs \nonterm{storage-class-specifier}\opt \lstinline$type$ \nonterm{type-declarator-list} \verb|;|
    30523189\lhs{type-declarator-list}
    30533190\rhs \nonterm{type-declarator}
    3054 \rhs \nonterm{type-declarator-list} \lstinline@,@ \nonterm{type-declarator}
     3191\rhs \nonterm{type-declarator-list} \lstinline$,$ \nonterm{type-declarator}
    30553192\lhs{type-declarator}
    3056 \rhs \nonterm{identifier} \nonterm{assertion-list}\opt \lstinline@=@ \nonterm{type-name}
     3193\rhs \nonterm{identifier} \nonterm{assertion-list}\opt \lstinline$=$ \nonterm{type-name}
    30573194\rhs \nonterm{identifier} \nonterm{assertion-list}\opt
    30583195\end{syntax}
     
    30653202
    30663203An identifier declared by a \nonterm{type-parameter} has \Index{no linkage}.
    3067 Identifiers declared with type-class \lstinline@type@\use{type} are \Index{object type}s;
     3204Identifiers declared with type-class \lstinline$type$\use{type} are \Index{object type}s;
    30683205those declared with type-class
    3069 \lstinline@dtype@\use{dtype} are \Index{incomplete type}s;
     3206\lstinline$dtype$\use{dtype} are \Index{incomplete type}s;
    30703207and those declared with type-class
    3071 \lstinline@ftype@\use{ftype} are \Index{function type}s.
     3208\lstinline$ftype$\use{ftype} are \Index{function type}s.
    30723209The identifier has \Index{block scope} that terminates at the end of the \nonterm{spec-declaration-list} or polymorphic function that contains the \nonterm{type-parameter}.
    30733210
     
    30773214Within the scope of the declaration, \Index{implicit conversion}s can be performed between the defined type and the implementation type, and between pointers to the defined type and pointers to the implementation type.
    30783215
    3079 A type declaration without an \Index{initializer} and without a \Index{storage-class specifier} or with storage-class specifier \lstinline@static@\use{static} defines an \Index{incomplete type}.
     3216A type declaration without an \Index{initializer} and without a \Index{storage-class specifier} or with storage-class specifier \lstinline$static$\use{static} defines an \Index{incomplete type}.
    30803217If a
    30813218\Index{translation unit} or \Index{block} contains one or more such declarations for an identifier, it must contain exactly one definition of the identifier ( but not in an enclosed block, which would define a new type known only within that block).
     
    30973234
    30983235A type declaration without an initializer and with \Index{storage-class specifier}
    3099 \lstinline@extern@\use{extern} is an \define{opaque type declaration}.
     3236\lstinline$extern$\use{extern} is an \define{opaque type declaration}.
    31003237Opaque types are
    31013238\Index{object type}s.
     
    31123249\end{rationale}
    31133250
    3114 An \Index{incomplete type} which is not a qualified version\index{qualified type} of a type is a value of \Index{type-class} \lstinline@dtype@.
    3115 An object type\index{object types} which is not a qualified version of a type is a value of type-classes \lstinline@type@ and \lstinline@dtype@.
     3251An \Index{incomplete type} which is not a qualified version\index{qualified type} of a type is a value of \Index{type-class} \lstinline$dtype$.
     3252An object type\index{object types} which is not a qualified version of a type is a value of type-classes \lstinline$type$ and \lstinline$dtype$.
    31163253A
    3117 \Index{function type} is a value of type-class \lstinline@ftype@.
     3254\Index{function type} is a value of type-class \lstinline$ftype$.
    31183255\begin{rationale}
    31193256Syntactically, a type value is a \nonterm{type-name}, which is a declaration for an object which omits the identifier being declared.
     
    31253262Type qualifiers are a weak point of C's type system.
    31263263Consider the standard library function
    3127 \lstinline@strchr()@ which, given a string and a character, returns a pointer to the first occurrence of the character in the string.
    3128 \begin{lstlisting}
    3129 char *strchr( const char *s, int c ) {§\impl{strchr}§
     3264\lstinline$strchr()$ which, given a string and a character, returns a pointer to the first occurrence of the character in the string.
     3265\begin{lstlisting}
     3266char *strchr( const char *s, int c ) {@\impl{strchr}@
    31303267        char real_c = c; // done because c was declared as int.
    31313268        for ( ; *s != real_c; s++ )
     
    31343271}
    31353272\end{lstlisting}
    3136 The parameter \lstinline@s@ must be \lstinline@const char *@, because \lstinline@strchr()@ might be used to search a constant string, but the return type must be \lstinline@char *@, because the result might be used to modify a non-constant string.
     3273The parameter \lstinline$s$ must be \lstinline$const char *$, because \lstinline$strchr()$ might be used to search a constant string, but the return type must be \lstinline$char *$, because the result might be used to modify a non-constant string.
    31373274Hence the body must perform a cast, and ( even worse)
    3138 \lstinline@strchr()@ provides a type-safe way to attempt to modify constant strings.
    3139 What is needed is some way to say that \lstinline@s@'s type might contain qualifiers, and the result type has exactly the same qualifiers.
     3275\lstinline$strchr()$ provides a type-safe way to attempt to modify constant strings.
     3276What is needed is some way to say that \lstinline$s$'s type might contain qualifiers, and the result type has exactly the same qualifiers.
    31403277Polymorphic functions do not provide a fix for this deficiency\index{deficiencies!pointers to qualified types}, because type qualifiers are not part of type values.
    3141 Instead, overloading can be used to define \lstinline@strchr()@ for each combination of qualifiers.
     3278Instead, overloading can be used to define \lstinline$strchr()$ for each combination of qualifiers.
    31423279\end{rationale}
    31433280
     
    31643301\end{lstlisting}
    31653302Without this restriction, \CFA might require ``module initialization'' code ( since
    3166 \lstinline@Rational@ has external linkage, it must be created before any other translation unit instantiates it), and would force an ordering on the initialization of the translation unit that defines \lstinline@Huge@ and the translation that declares \lstinline@Rational@.
     3303\lstinline$Rational$ has external linkage, it must be created before any other translation unit instantiates it), and would force an ordering on the initialization of the translation unit that defines \lstinline$Huge$ and the translation that declares \lstinline$Rational$.
    31673304
    31683305A benefit of the restriction is that it prevents the declaration in separate translation units of types that contain each other, which would be hard to prevent otherwise.
     
    31813318\nonterm{struct-declaration}, type declarations can not be structure members.
    31823319The form of
    3183 \nonterm{type-declaration} forbids arrays of, pointers to, and functions returning \lstinline@type@.
     3320\nonterm{type-declaration} forbids arrays of, pointers to, and functions returning \lstinline$type$.
    31843321Hence the syntax of \nonterm{type-specifier} does not have to be extended to allow type-valued expressions.
    31853322It also side-steps the problem of type-valued expressions producing different values in different declarations.
     
    31963333#include <stdlib.h>
    31973334T * new( otype T ) { return ( T * )malloc( sizeof( T) ); };
    3198 §\ldots§ int * ip = new( int );
    3199 \end{lstlisting}
    3200 This looks sensible, but \CFA's declaration-before-use rules mean that ``\lstinline@T@'' in the function body refers to the parameter, but the ``\lstinline@T@'' in the return type refers to the meaning of \lstinline@T@ in the scope that contains \lstinline@new@;
     3335@\ldots@ int * ip = new( int );
     3336\end{lstlisting}
     3337This looks sensible, but \CFA's declaration-before-use rules mean that ``\lstinline$T$'' in the function body refers to the parameter, but the ``\lstinline$T$'' in the return type refers to the meaning of \lstinline$T$ in the scope that contains \lstinline$new$;
    32013338it could be undefined, or a type name, or a function or variable name.
    32023339Nothing good can result from such a situation.
     
    32153352f2( v2 );
    32163353\end{lstlisting}
    3217 \lstinline@V1@ is passed by value, so \lstinline@f1()@'s assignment to \lstinline@a[0]@ does not modify v1.  \lstinline@V2@ is converted to a pointer, so \lstinline@f2()@ modifies \lstinline@v2[0]@.
     3354\lstinline$V1$ is passed by value, so \lstinline$f1()$'s assignment to \lstinline$a[0]$ does not modify v1.  \lstinline$V2$ is converted to a pointer, so \lstinline$f2()$ modifies \lstinline$v2[0]$.
    32183355
    32193356A translation unit containing the declarations
    32203357\begin{lstlisting}
    3221 extern type Complex;§\use{Complex}§ // opaque type declaration
    3222 extern float abs( Complex );§\use{abs}§
    3223 \end{lstlisting} can contain declarations of complex numbers, which can be passed to \lstinline@abs@.
    3224 Some other translation unit must implement \lstinline@Complex@ and \lstinline@abs@.
     3358extern type Complex;@\use{Complex}@ // opaque type declaration
     3359extern float abs( Complex );@\use{abs}@
     3360\end{lstlisting} can contain declarations of complex numbers, which can be passed to \lstinline$abs$.
     3361Some other translation unit must implement \lstinline$Complex$ and \lstinline$abs$.
    32253362That unit might contain the declarations
    32263363\begin{lstlisting}
    3227 otype Complex = struct { float re, im; };§\impl{Complex}§
    3228 Complex cplx_i = { 0.0, 1.0 };§\impl{cplx_i}§
    3229 float abs( Complex c ) {§\impl{abs( Complex )}§
     3364otype Complex = struct { float re, im; };@\impl{Complex}@
     3365Complex cplx_i = { 0.0, 1.0 };@\impl{cplx_i}@
     3366float abs( Complex c ) {@\impl{abs( Complex )}@
    32303367        return sqrt( c.re * c.re + c.im * c.im );
    32313368}
    32323369\end{lstlisting}
    3233 Note that \lstinline@c@ is implicitly converted to a \lstinline@struct@ so that its components can be retrieved.
    3234 
    3235 \begin{lstlisting}
    3236 otype Time_of_day = int;§\impl{Time_of_day}§ // seconds since midnight.
    3237 Time_of_day ?+?( Time_of_day t1, int seconds ) {§\impl{?+?}§
     3370Note that \lstinline$c$ is implicitly converted to a \lstinline$struct$ so that its components can be retrieved.
     3371
     3372\begin{lstlisting}
     3373otype Time_of_day = int;@\impl{Time_of_day}@ // seconds since midnight.
     3374Time_of_day ?+?( Time_of_day t1, int seconds ) {@\impl{?+?}@
    32383375        return (( int)t1 + seconds ) % 86400;
    32393376}
    32403377\end{lstlisting}
    3241 \lstinline@t1@ must be cast to its implementation type to prevent infinite recursion.
     3378\lstinline$t1$ must be cast to its implementation type to prevent infinite recursion.
    32423379
    32433380\begin{rationale}
    32443381Within the scope of a type definition, an instance of the type can be viewed as having that type or as having the implementation type.
    3245 In the \lstinline@Time_of_day@ example, the difference is important.
     3382In the \lstinline$Time_of_day$ example, the difference is important.
    32463383Different languages have treated the distinction between the abstraction and the implementation in different ways.
    32473384\begin{itemize}
    32483385\item
    3249 Inside a Clu cluster \cite{CLU}, the declaration of an instance states which view applies.
    3250 Two primitives called \lstinline@up@ and \lstinline@down@ can be used to convert between the views.
    3251 \item
    3252 The Simula class \cite{SIMULA87} is essentially a record type.
     3386Inside a Clu cluster \cite{clu}, the declaration of an instance states which view applies.
     3387Two primitives called \lstinline$up$ and \lstinline$down$ can be used to convert between the views.
     3388\item
     3389The Simula class \cite{Simula87} is essentially a record type.
    32533390Since the only operations on a record are member selection and assignment, which can not be overloaded, there is never any ambiguity as to whether the abstraction or the implementation view is being used.
    32543391In {\CC}
    3255 \cite{C++}, operations on class instances include assignment and ``\lstinline@&@'', which can be overloaded.
     3392\cite{c++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded.
    32563393A ``scope resolution'' operator can be used inside the class to specify whether the abstract or implementation version of the operation should be used.
    32573394\item
    3258 An Ada derived type definition \cite{Ada} creates a new type from an old type, and also implicitly declares derived subprograms that correspond to the existing subprograms that use the old type as a parameter type or result type.
     3395An Ada derived type definition \cite{ada} creates a new type from an old type, and also implicitly declares derived subprograms that correspond to the existing subprograms that use the old type as a parameter type or result type.
    32593396The derived subprograms are clones of the existing subprograms with the old type replaced by the derived type.
    32603397Literals and aggregates of the old type are also cloned.
     
    32663403In this case, explicit conversions between the derived type and the old type can be used.
    32673404\end{itemize}
    3268 \CFA's rules are like Clu's, except that implicit conversions and conversion costs allow it to do away with most uses of \lstinline@up@ and \lstinline@down@.
     3405\CFA's rules are like Clu's, except that implicit conversions and conversion costs allow it to do away with most uses of \lstinline$up$ and \lstinline$down$.
    32693406\end{rationale}
    32703407
     
    32723409\subsubsection{Default functions and objects}
    32733410
    3274 A declaration\index{type declaration} of a type identifier \lstinline@T@ with type-class
    3275 \lstinline@type@ implicitly declares a \define{default assignment} function
    3276 \lstinline@T ?=?( T *, T )@\use{?=?}, with the same \Index{scope} and \Index{linkage} as the identifier \lstinline@T@.
     3411A declaration\index{type declaration} of a type identifier \lstinline$T$ with type-class
     3412\lstinline$type$ implicitly declares a \define{default assignment} function
     3413\lstinline$T ?=?( T *, T )$\use{?=?}, with the same \Index{scope} and \Index{linkage} as the identifier \lstinline$T$.
    32773414\begin{rationale}
    32783415Assignment is central to C's imperative programming style, and every existing C object type has assignment defined for it ( except for array types, which are treated as pointer types for purposes of assignment).
    32793416Without this rule, nearly every inferred type parameter would need an accompanying assignment assertion parameter.
    32803417If a type parameter should not have an assignment operation,
    3281 \lstinline@dtype@ should be used.
     3418\lstinline$dtype$ should be used.
    32823419If a type should not have assignment defined, the user can define an assignment function that causes a run-time error, or provide an external declaration but no definition and thus cause a link-time error.
    32833420\end{rationale}
    32843421
    3285 A definition\index{type definition} of a type identifier \lstinline@T@ with \Index{implementation type} \lstinline@I@ and type-class \lstinline@type@ implicitly defines a default assignment function.
    3286 A definition\index{type definition} of a type identifier \lstinline@T@ with implementation type \lstinline@I@ and an assertion list implicitly defines \define{default function}s and
     3422A definition\index{type definition} of a type identifier \lstinline$T$ with \Index{implementation type} \lstinline$I$ and type-class \lstinline$type$ implicitly defines a default assignment function.
     3423A definition\index{type definition} of a type identifier \lstinline$T$ with implementation type \lstinline$I$ and an assertion list implicitly defines \define{default function}s and
    32873424\define{default object}s as declared by the assertion declarations.
    3288 The default objects and functions have the same \Index{scope} and \Index{linkage} as the identifier \lstinline@T@.
     3425The default objects and functions have the same \Index{scope} and \Index{linkage} as the identifier \lstinline$T$.
    32893426Their values are determined as follows:
    32903427\begin{itemize}
    32913428\item
    3292 If at the definition of \lstinline@T@ there is visible a declaration of an object with the same name as the default object, and if the type of that object with all occurrence of \lstinline@I@ replaced by \lstinline@T@ is compatible with the type of the default object, then the default object is initialized with that object.
    3293 Otherwise the scope of the declaration of \lstinline@T@ must contain a definition of the default object.
     3429If at the definition of \lstinline$T$ there is visible a declaration of an object with the same name as the default object, and if the type of that object with all occurrence of \lstinline$I$ replaced by \lstinline$T$ is compatible with the type of the default object, then the default object is initialized with that object.
     3430Otherwise the scope of the declaration of \lstinline$T$ must contain a definition of the default object.
    32943431
    32953432\item
    3296 If at the definition of \lstinline@T@ there is visible a declaration of a function with the same name as the default function, and if the type of that function with all occurrence of \lstinline@I@ replaced by \lstinline@T@ is compatible with the type of the default function, then the default function calls that function after converting its arguments and returns the converted result.
    3297 
    3298 Otherwise, if \lstinline@I@ contains exactly one anonymous member\index{anonymous member} such that at the definition of \lstinline@T@ there is visible a declaration of a function with the same name as the default function, and the type of that function with all occurrences of the anonymous member's type in its parameter list replaced by \lstinline@T@ is compatible with the type of the default function, then the default function calls that function after converting its arguments and returns the result.
    3299 
    3300 Otherwise the scope of the declaration of \lstinline@T@ must contain a definition of the default function.
     3433If at the definition of \lstinline$T$ there is visible a declaration of a function with the same name as the default function, and if the type of that function with all occurrence of \lstinline$I$ replaced by \lstinline$T$ is compatible with the type of the default function, then the default function calls that function after converting its arguments and returns the converted result.
     3434
     3435Otherwise, if \lstinline$I$ contains exactly one anonymous member\index{anonymous member} such that at the definition of \lstinline$T$ there is visible a declaration of a function with the same name as the default function, and the type of that function with all occurrences of the anonymous member's type in its parameter list replaced by \lstinline$T$ is compatible with the type of the default function, then the default function calls that function after converting its arguments and returns the result.
     3436
     3437Otherwise the scope of the declaration of \lstinline$T$ must contain a definition of the default function.
    33013438\end{itemize}
    33023439\begin{rationale}
     
    33043441\end{rationale}
    33053442
    3306 A function or object with the same type and name as a default function or object that is declared within the scope of the definition of \lstinline@T@ replaces the default function or object.
     3443A function or object with the same type and name as a default function or object that is declared within the scope of the definition of \lstinline$T$ replaces the default function or object.
    33073444
    33083445\examples
     
    33143451Pair b = { 1, 1 };
    33153452\end{lstlisting}
    3316 The definition of \lstinline@Pair@ implicitly defines two objects \lstinline@a@ and \lstinline@b@.
    3317 \lstinline@Pair a@ inherits its value from the \lstinline@struct impl a@.
     3453The definition of \lstinline$Pair$ implicitly defines two objects \lstinline$a$ and \lstinline$b$.
     3454\lstinline$Pair a$ inherits its value from the \lstinline$struct impl a$.
    33183455The definition of
    3319 \lstinline@Pair b@ is compulsory because there is no \lstinline@struct impl b@ to construct a value from.
     3456\lstinline$Pair b$ is compulsory because there is no \lstinline$struct impl b$ to construct a value from.
    33203457\begin{lstlisting}
    33213458trait ss( otype T ) {
     
    33233460        void munge( T * );
    33243461}
    3325 otype Whatsit | ss( Whatsit );§\use{Whatsit}§
    3326 otype Doodad | ss( Doodad ) = struct doodad {§\use{Doodad}§
     3462otype Whatsit | ss( Whatsit );@\use{Whatsit}@
     3463otype Doodad | ss( Doodad ) = struct doodad {@\use{Doodad}@
    33273464        Whatsit; // anonymous member
    33283465        int extra;
     
    33303467Doodad clone( Doodad ) { ... }
    33313468\end{lstlisting}
    3332 The definition of \lstinline@Doodad@ implicitly defines three functions:
     3469The definition of \lstinline$Doodad$ implicitly defines three functions:
    33333470\begin{lstlisting}
    33343471Doodad ?=?( Doodad *, Doodad );
     
    33363473void munge( Doodad * );
    33373474\end{lstlisting}
    3338 The assignment function inherits \lstinline@struct doodad@'s assignment function because the types match when \lstinline@struct doodad@ is replaced by \lstinline@Doodad@ throughout.
    3339 \lstinline@munge()@ inherits \lstinline@Whatsit@'s \lstinline@munge()@ because the types match when
    3340 \lstinline@Whatsit@ is replaced by \lstinline@Doodad@ in the parameter list. \lstinline@clone()@ does \emph{not} inherit \lstinline@Whatsit@'s \lstinline@clone()@: replacement in the parameter list yields ``\lstinline@Whatsit clone( Doodad )@'', which is not compatible with
    3341 \lstinline@Doodad@'s \lstinline@clone()@'s type.
     3475The assignment function inherits \lstinline$struct doodad$'s assignment function because the types match when \lstinline$struct doodad$ is replaced by \lstinline$Doodad$ throughout.
     3476\lstinline$munge()$ inherits \lstinline$Whatsit$'s \lstinline$munge()$ because the types match when
     3477\lstinline$Whatsit$ is replaced by \lstinline$Doodad$ in the parameter list. \lstinline$clone()$ does \emph{not} inherit \lstinline$Whatsit$'s \lstinline$clone()$: replacement in the parameter list yields ``\lstinline$Whatsit clone( Doodad )$'', which is not compatible with
     3478\lstinline$Doodad$'s \lstinline$clone()$'s type.
    33423479Hence the definition of
    3343 ``\lstinline@Doodad clone( Doodad )@'' is necessary.
     3480``\lstinline$Doodad clone( Doodad )$'' is necessary.
    33443481
    33453482Default functions and objects are subject to the normal scope rules.
    33463483\begin{lstlisting}
    3347 otype T = §\ldots§;
    3348 T a_T = §\ldots§;               // Default assignment used.
     3484otype T = @\ldots@;
     3485T a_T = @\ldots@;               // Default assignment used.
    33493486T ?=?( T *, T );
    3350 T a_T = §\ldots§;               // Programmer-defined assignment called.
     3487T a_T = @\ldots@;               // Programmer-defined assignment called.
    33513488\end{lstlisting}
    33523489\begin{rationale}
     
    33813518\begin{syntax}
    33823519\oldlhs{labeled-statement}
    3383 \rhs \lstinline@case@ \nonterm{case-value-list} : \nonterm{statement}
     3520\rhs \lstinline$case$ \nonterm{case-value-list} : \nonterm{statement}
    33843521\lhs{case-value-list}
    33853522\rhs \nonterm{case-value}
    3386 \rhs \nonterm{case-value-list} \lstinline@,@ \nonterm{case-value}
     3523\rhs \nonterm{case-value-list} \lstinline$,$ \nonterm{case-value}
    33873524\lhs{case-value}
    33883525\rhs \nonterm{constant-expression}
    33893526\rhs \nonterm{subrange}
    33903527\lhs{subrange}
    3391 \rhs \nonterm{constant-expression} \lstinline@~@ \nonterm{constant-expression}
     3528\rhs \nonterm{constant-expression} \lstinline$~$ \nonterm{constant-expression}
    33923529\end{syntax}
    33933530
     
    34023539case 1~4, 9~14, 27~32:
    34033540\end{lstlisting}
    3404 The \lstinline@case@ and \lstinline@default@ clauses are restricted within the \lstinline@switch@ and \lstinline@choose@ statements, precluding Duff's device.
     3541The \lstinline$case$ and \lstinline$default$ clauses are restricted within the \lstinline$switch$ and \lstinline$choose$ statements, precluding Duff's device.
    34053542
    34063543
    34073544\subsection{Expression and null statements}
    34083545
    3409 The expression in an expression statement is treated as being cast to \lstinline@void@.
     3546The expression in an expression statement is treated as being cast to \lstinline$void$.
    34103547
    34113548
     
    34143551\begin{syntax}
    34153552\oldlhs{selection-statement}
    3416 \rhs \lstinline@choose@ \lstinline@(@ \nonterm{expression} \lstinline@)@ \nonterm{statement}
     3553\rhs \lstinline$choose$ \lstinline$($ \nonterm{expression} \lstinline$)$ \nonterm{statement}
    34173554\end{syntax}
    34183555
    3419 The controlling expression \lstinline@E@ in the \lstinline@switch@ and \lstinline@choose@ statement:
     3556The controlling expression \lstinline$E$ in the \lstinline$switch$ and \lstinline$choose$ statement:
    34203557\begin{lstlisting}
    34213558switch ( E ) ...
     
    34233560\end{lstlisting} may have more than one interpretation, but it shall have only one interpretation with an integral type.
    34243561An \Index{integer promotion} is performed on the expression if necessary.
    3425 The constant expressions in \lstinline@case@ statements with the switch are converted to the promoted type.
     3562The constant expressions in \lstinline$case$ statements with the switch are converted to the promoted type.
    34263563
    34273564
    34283565\setcounter{subsubsection}{3}
    3429 \subsubsection[The choose statement]{The \lstinline@choose@ statement}
    3430 
    3431 The \lstinline@choose@ statement is the same as the \lstinline@switch@ statement except control transfers to the end of the \lstinline@choose@ statement at a \lstinline@case@ or \lstinline@default@ labeled statement.
    3432 The \lstinline@fallthru@ statement is used to fall through to the next \lstinline@case@ or \lstinline@default@ labeled statement.
     3566\subsubsection{The \lstinline$choose$ statement}
     3567
     3568The \lstinline$choose$ statement is the same as the \lstinline$switch$ statement except control transfers to the end of the \lstinline$choose$ statement at a \lstinline$case$ or \lstinline$default$ labeled statement.
     3569The \lstinline$fallthru$ statement is used to fall through to the next \lstinline$case$ or \lstinline$default$ labeled statement.
    34333570The following have identical meaning:
    34343571\begin{flushleft}
     
    34553592\end{tabular}
    34563593\end{flushleft}
    3457 The \lstinline@choose@ statement addresses the problem of accidental fall-through associated with the \lstinline@switch@ statement.
     3594The \lstinline$choose$ statement addresses the problem of accidental fall-through associated with the \lstinline$switch$ statement.
    34583595
    34593596
    34603597\subsection{Iteration statements}
    34613598
    3462 The controlling expression \lstinline@E@ in the loops
     3599The controlling expression \lstinline$E$ in the loops
    34633600\begin{lstlisting}
    34643601if ( E ) ...
    34653602while ( E ) ...
    34663603do ... while ( E );
    3467 \end{lstlisting} is treated as ``\lstinline@( int )((E)!=0)@''.
     3604\end{lstlisting} is treated as ``\lstinline$( int )((E)!=0)$''.
    34683605
    34693606The statement
    34703607\begin{lstlisting}
    3471 for ( a; b; c ) §\ldots§
     3608for ( a; b; c ) @\ldots@
    34723609\end{lstlisting} is treated as
    34733610\begin{lstlisting}
     
    34803617\begin{syntax}
    34813618\oldlhs{jump-statement}
    3482 \rhs \lstinline@continue@ \nonterm{identifier}\opt
    3483 \rhs \lstinline@break@ \nonterm{identifier}\opt
     3619\rhs \lstinline$continue$ \nonterm{identifier}\opt
     3620\rhs \lstinline$break$ \nonterm{identifier}\opt
    34843621\rhs \ldots
    3485 \rhs \lstinline@throw@ \nonterm{assignment-expression}\opt
    3486 \rhs \lstinline@throwResume@ \nonterm{assignment-expression}\opt \nonterm{at-expression}\opt
    3487 \lhs{at-expression} \lstinline@_At@ \nonterm{assignment-expression}
     3622\rhs \lstinline$throw$ \nonterm{assignment-expression}\opt
     3623\rhs \lstinline$throwResume$ \nonterm{assignment-expression}\opt \nonterm{at-expression}\opt
     3624\lhs{at-expression} \lstinline$_At$ \nonterm{assignment-expression}
    34883625\end{syntax}
    34893626
    3490 Labeled \lstinline@continue@ and \lstinline@break@ allow useful but restricted control-flow that reduces the need for the \lstinline@goto@ statement for exiting multiple nested control-structures.
     3627Labeled \lstinline$continue$ and \lstinline$break$ allow useful but restricted control-flow that reduces the need for the \lstinline$goto$ statement for exiting multiple nested control-structures.
    34913628\begin{lstlisting}
    34923629L1: {                                                   // compound
     
    35153652
    35163653\setcounter{subsubsection}{1}
    3517 \subsubsection[The continue statement]{The \lstinline@continue@ statement}
    3518 
    3519 The identifier in a \lstinline@continue@ statement shall name a label located on an enclosing iteration statement.
    3520 
    3521 
    3522 \subsubsection[The break statement]{The \lstinline@break@ statement}
    3523 
    3524 The identifier in a \lstinline@break@ statement shall name a label located on an enclosing compound, selection or iteration statement.
    3525 
    3526 
    3527 \subsubsection[The return statement]{The \lstinline@return@ statement}
    3528 
    3529 An expression in a \lstinline@return@ statement is treated as being cast to the result type of the function.
    3530 
    3531 
    3532 \subsubsection[The throw statement]{The \lstinline@throw@ statement}
     3654\subsubsection{The \lstinline$continue$ statement}
     3655
     3656The identifier in a \lstinline$continue$ statement shall name a label located on an enclosing iteration statement.
     3657
     3658
     3659\subsubsection{The \lstinline$break$ statement}
     3660
     3661The identifier in a \lstinline$break$ statement shall name a label located on an enclosing compound, selection or iteration statement.
     3662
     3663
     3664\subsubsection{The \lstinline$return$ statement}
     3665
     3666An expression in a \lstinline$return$ statement is treated as being cast to the result type of the function.
     3667
     3668
     3669\subsubsection{The \lstinline$throw$ statement}
    35333670
    35343671When an exception is raised, \Index{propagation} directs control from a raise in the source execution to a handler in the faulting execution.
    35353672
    35363673
    3537 \subsubsection[The throwResume statement]{The \lstinline@throwResume@ statement}
     3674\subsubsection{The \lstinline$throwResume$ statement}
    35383675
    35393676
     
    35423679\begin{syntax}
    35433680\lhs{exception-statement}
    3544 \rhs \lstinline@try@ \nonterm{compound-statement} \nonterm{handler-list}
    3545 \rhs \lstinline@try@ \nonterm{compound-statement} \nonterm{finally-clause}
    3546 \rhs \lstinline@try@ \nonterm{compound-statement} \nonterm{handler-list} \nonterm{finally-clause}
     3681\rhs \lstinline$try$ \nonterm{compound-statement} \nonterm{handler-list}
     3682\rhs \lstinline$try$ \nonterm{compound-statement} \nonterm{finally-clause}
     3683\rhs \lstinline$try$ \nonterm{compound-statement} \nonterm{handler-list} \nonterm{finally-clause}
    35473684\lhs{handler-list}
    35483685\rhs \nonterm{handler-clause}
    3549 \rhs \lstinline@catch@ \lstinline@(@ \ldots \lstinline@)@ \nonterm{compound-statement}
    3550 \rhs \nonterm{handler-clause} \lstinline@catch@ \lstinline@(@ \ldots \lstinline@)@ \nonterm{compound-statement}
    3551 \rhs \lstinline@catchResume@ \lstinline@(@ \ldots \lstinline@)@ \nonterm{compound-statement}
    3552 \rhs \nonterm{handler-clause} \lstinline@catchResume@ \lstinline@(@ \ldots \lstinline@)@ \nonterm{compound-statement}
     3686\rhs \lstinline$catch$ \lstinline$($ \ldots \lstinline$)$ \nonterm{compound-statement}
     3687\rhs \nonterm{handler-clause} \lstinline$catch$ \lstinline$($ \ldots \lstinline$)$ \nonterm{compound-statement}
     3688\rhs \lstinline$catchResume$ \lstinline$($ \ldots \lstinline$)$ \nonterm{compound-statement}
     3689\rhs \nonterm{handler-clause} \lstinline$catchResume$ \lstinline$($ \ldots \lstinline$)$ \nonterm{compound-statement}
    35533690\lhs{handler-clause}
    3554 \rhs \lstinline@catch@ \lstinline@(@ \nonterm{exception-declaration} \lstinline@)@ \nonterm{compound-statement}
    3555 \rhs \nonterm{handler-clause} \lstinline@catch@ \lstinline@(@ \nonterm{exception-declaration} \lstinline@)@ \nonterm{compound-statement}
    3556 \rhs \lstinline@catchResume@ \lstinline@(@ \nonterm{exception-declaration} \lstinline@)@ \nonterm{compound-statement}
    3557 \rhs \nonterm{handler-clause} \lstinline@catchResume@ \lstinline@(@ \nonterm{exception-declaration} \lstinline@)@ \nonterm{compound-statement}
     3691\rhs \lstinline$catch$ \lstinline$($ \nonterm{exception-declaration} \lstinline$)$ \nonterm{compound-statement}
     3692\rhs \nonterm{handler-clause} \lstinline$catch$ \lstinline$($ \nonterm{exception-declaration} \lstinline$)$ \nonterm{compound-statement}
     3693\rhs \lstinline$catchResume$ \lstinline$($ \nonterm{exception-declaration} \lstinline$)$ \nonterm{compound-statement}
     3694\rhs \nonterm{handler-clause} \lstinline$catchResume$ \lstinline$($ \nonterm{exception-declaration} \lstinline$)$ \nonterm{compound-statement}
    35583695\lhs{finally-clause}
    3559 \rhs \lstinline@finally@ \nonterm{compound-statement}
     3696\rhs \lstinline$finally$ \nonterm{compound-statement}
    35603697\lhs{exception-declaration}
    35613698\rhs \nonterm{type-specifier}
     
    35653702\rhs \nonterm{new-abstract-declarator-tuple}
    35663703\lhs{asynchronous-statement}
    3567 \rhs \lstinline@enable@ \nonterm{identifier-list} \nonterm{compound-statement}
    3568 \rhs \lstinline@disable@ \nonterm{identifier-list} \nonterm{compound-statement}
     3704\rhs \lstinline$enable$ \nonterm{identifier-list} \nonterm{compound-statement}
     3705\rhs \lstinline$disable$ \nonterm{identifier-list} \nonterm{compound-statement}
    35693706\end{syntax}
    35703707
     
    35723709
    35733710
    3574 \subsubsection[The try statement]{The \lstinline@try@ statement}
    3575 
    3576 The \lstinline@try@ statement is a block with associated handlers, called a \Index{guarded block};
     3711\subsubsection{The \lstinline$try$ statement}
     3712
     3713The \lstinline$try$ statement is a block with associated handlers, called a \Index{guarded block};
    35773714all other blocks are \Index{unguarded block}s.
    3578 A \lstinline@goto@, \lstinline@break@, \lstinline@return@, or \lstinline@continue@ statement can be used to transfer control out of a try block or handler, but not into one.
    3579 
    3580 
    3581 \subsubsection[The enable/disable statements]{The \lstinline@enable@/\lstinline@disable@ statements}
    3582 
    3583 The \lstinline@enable@/\lstinline@disable@ statements toggle delivery of \Index{asynchronous exception}s.
     3715A \lstinline$goto$, \lstinline$break$, \lstinline$return$, or \lstinline$continue$ statement can be used to transfer control out of a try block or handler, but not into one.
     3716
     3717
     3718\subsubsection{The \lstinline$enable$/\lstinline$disable$ statements}
     3719
     3720The \lstinline$enable$/\lstinline$disable$ statements toggle delivery of \Index{asynchronous exception}s.
    35843721
    35853722
     
    35913728\subsection{Predefined macro names}
    35923729
    3593 The implementation shall define the macro names \lstinline@__LINE__@, \lstinline@__FILE__@,
    3594 \lstinline@__DATE__@, and \lstinline@__TIME__@, as in the {\c11} standard.
    3595 It shall not define the macro name \lstinline@__STDC__@.
    3596 
    3597 In addition, the implementation shall define the macro name \lstinline@__CFORALL__@ to be the decimal constant 1.
     3730The implementation shall define the macro names \lstinline$__LINE__$, \lstinline$__FILE__$,
     3731\lstinline$__DATE__$, and \lstinline$__TIME__$, as in the {\c11} standard.
     3732It shall not define the macro name \lstinline$__STDC__$.
     3733
     3734In addition, the implementation shall define the macro name \lstinline$__CFORALL__$ to be the decimal constant 1.
    35983735
    35993736
     
    36123749The pointer, integral, and floating-point types are all \define{scalar types}.
    36133750All of these types can be logically negated and compared.
    3614 The assertion ``\lstinline@scalar( Complex )@'' should be read as ``type \lstinline@Complex@ is scalar''.
    3615 \begin{lstlisting}
    3616 trait scalar( otype T ) {§\impl{scalar}§
     3751The assertion ``\lstinline$scalar( Complex )$'' should be read as ``type \lstinline$Complex$ is scalar''.
     3752\begin{lstlisting}
     3753trait scalar( otype T ) {@\impl{scalar}@
    36173754        int !?( T );
    36183755        int ?<?( T, T ), ?<=?( T, T ), ?==?( T, T ), ?>=?( T, T ), ?>?( T, T ), ?!=?( T, T );
     
    36243761This is equivalent to inheritance of specifications.
    36253762\begin{lstlisting}
    3626 trait arithmetic( otype T | scalar( T ) ) {§\impl{arithmetic}§§\use{scalar}§
     3763trait arithmetic( otype T | scalar( T ) ) {@\impl{arithmetic}@@\use{scalar}@
    36273764        T +?( T ), -?( T );
    36283765        T ?*?( T, T ), ?/?( T, T ), ?+?( T, T ), ?-?( T, T );
     
    36303767\end{lstlisting}
    36313768
    3632 The various flavors of \lstinline@char@ and \lstinline@int@ and the enumerated types make up the
     3769The various flavors of \lstinline$char$ and \lstinline$int$ and the enumerated types make up the
    36333770\define{integral types}.
    36343771\begin{lstlisting}
    3635 trait integral( otype T | arithmetic( T ) ) {§\impl{integral}§§\use{arithmetic}§
     3772trait integral( otype T | arithmetic( T ) ) {@\impl{integral}@@\use{arithmetic}@
    36363773        T ~?( T );
    36373774        T ?&?( T, T ), ?|?( T, T ), ?^?( T, T );
     
    36473784The only operation that can be applied to all modifiable lvalues is simple assignment.
    36483785\begin{lstlisting}
    3649 trait m_lvalue( otype T ) {§\impl{m_lvalue}§
     3786trait m_lvalue( otype T ) {@\impl{m_lvalue}@
    36503787        T ?=?( T *, T );
    36513788};
     
    36573794Scalars can also be incremented and decremented.
    36583795\begin{lstlisting}
    3659 trait m_l_scalar( otype T | scalar( T ) | m_lvalue( T ) ) {§\impl{m_l_scalar}§
    3660         T ?++( T * ), ?--( T * );§\use{scalar}§§\use{m_lvalue}§
     3796trait m_l_scalar( otype T | scalar( T ) | m_lvalue( T ) ) {@\impl{m_l_scalar}@
     3797        T ?++( T * ), ?--( T * );@\use{scalar}@@\use{m_lvalue}@
    36613798        T ++?( T * ), --?( T * );
    36623799};
     
    36643801
    36653802Modifiable arithmetic lvalues are both modifiable scalar lvalues and arithmetic.
    3666 Note that this results in the ``inheritance'' of \lstinline@scalar@ along both paths.
    3667 \begin{lstlisting}
    3668 trait m_l_arithmetic( otype T | m_l_scalar( T ) | arithmetic( T ) ) {§\impl{m_l_arithmetic}§
    3669         T ?/=?( T *, T ), ?*=?( T *, T );§\use{m_l_scalar}§§\use{arithmetic}§
     3803Note that this results in the ``inheritance'' of \lstinline$scalar$ along both paths.
     3804\begin{lstlisting}
     3805trait m_l_arithmetic( otype T | m_l_scalar( T ) | arithmetic( T ) ) {@\impl{m_l_arithmetic}@
     3806        T ?/=?( T *, T ), ?*=?( T *, T );@\use{m_l_scalar}@@\use{arithmetic}@
    36703807        T ?+=?( T *, T ), ?-=?( T *, T );
    36713808};
    3672 trait m_l_integral( otype T | m_l_arithmetic( T ) | integral( T ) ) {§\impl{m_l_integral}§
    3673         T ?&=?( T *, T ), ?|=?( T *, T ), ?^=?( T *, T );§\use{m_l_arithmetic}§
    3674         T ?%=?( T *, T ), ?<<=?( T *, T ), ?>>=?( T *, T );§\use{integral}§
     3809trait m_l_integral( otype T | m_l_arithmetic( T ) | integral( T ) ) {@\impl{m_l_integral}@
     3810        T ?&=?( T *, T ), ?|=?( T *, T ), ?^=?( T *, T );@\use{m_l_arithmetic}@
     3811        T ?%=?( T *, T ), ?<<=?( T *, T ), ?>>=?( T *, T );@\use{integral}@
    36753812};
    36763813\end{lstlisting}
     
    36803817
    36813818Array types can barely be said to exist in {\c11}, since in most cases an array name is treated as a constant pointer to the first element of the array, and the subscript expression
    3682 ``\lstinline@a[i]@'' is equivalent to the dereferencing expression ``\lstinline@(*( a+( i )))@''.
    3683 Technically, pointer arithmetic and pointer comparisons other than ``\lstinline@==@'' and
    3684 ``\lstinline@!=@'' are only defined for pointers to array elements, but the type system does not enforce those restrictions.
     3819``\lstinline$a[i]$'' is equivalent to the dereferencing expression ``\lstinline$(*( a+( i )))$''.
     3820Technically, pointer arithmetic and pointer comparisons other than ``\lstinline$==$'' and
     3821``\lstinline$!=$'' are only defined for pointers to array elements, but the type system does not enforce those restrictions.
    36853822Consequently, there is no need for a separate ``array type'' specification.
    36863823
    36873824Pointer types are scalar types.
    3688 Like other scalar types, they have ``\lstinline@+@'' and
    3689 ``\lstinline@-@'' operators, but the types do not match the types of the operations in
    3690 \lstinline@arithmetic@, so these operators cannot be consolidated in \lstinline@scalar@.
    3691 \begin{lstlisting}
    3692 trait pointer( type P | scalar( P ) ) {§\impl{pointer}§§\use{scalar}§
     3825Like other scalar types, they have ``\lstinline$+$'' and
     3826``\lstinline$-$'' operators, but the types do not match the types of the operations in
     3827\lstinline$arithmetic$, so these operators cannot be consolidated in \lstinline$scalar$.
     3828\begin{lstlisting}
     3829trait pointer( type P | scalar( P ) ) {@\impl{pointer}@@\use{scalar}@
    36933830        P ?+?( P, long int ), ?+?( long int, P ), ?-?( P, long int );
    36943831        ptrdiff_t ?-?( P, P );
    36953832};
    3696 trait m_l_pointer( type P | pointer( P ) | m_l_scalar( P ) ) {§\impl{m_l_pointer}§
     3833trait m_l_pointer( type P | pointer( P ) | m_l_scalar( P ) ) {@\impl{m_l_pointer}@
    36973834        P ?+=?( P *, long int ), ?-=?( P *, long int );
    36983835        P ?=?( P *, void * );
     
    37033840Specifications that define the dereference operator ( or subscript operator ) require two parameters, one for the pointer type and one for the pointed-at ( or element ) type.
    37043841Different specifications are needed for each set of \Index{type qualifier}s, because qualifiers are not included in types.
    3705 The assertion ``\lstinline@|ptr_to( Safe_pointer, int )@'' should be read as
    3706 ``\lstinline@Safe_pointer@ acts like a pointer to \lstinline@int@''.
    3707 \begin{lstlisting}
    3708 trait ptr_to( otype P | pointer( P ), otype T ) {§\impl{ptr_to}§§\use{pointer}§
     3842The assertion ``\lstinline$|ptr_to( Safe_pointer, int )$'' should be read as
     3843``\lstinline$Safe_pointer$ acts like a pointer to \lstinline$int$''.
     3844\begin{lstlisting}
     3845trait ptr_to( type P | pointer( P ), otype T ) {@\impl{ptr_to}@@\use{pointer}@
    37093846        lvalue T *?( P );
    37103847        lvalue T ?[?]( P, long int );
    37113848};
    3712 trait ptr_to_const( otype P | pointer( P ), otype T ) {§\impl{ptr_to_const}§
     3849trait ptr_to_const( type P | pointer( P ), otype T ) {@\impl{ptr_to_const}@
    37133850        const lvalue T *?( P );
    3714         const lvalue T ?[?]( P, long int );§\use{pointer}§
     3851        const lvalue T ?[?]( P, long int );@\use{pointer}@
    37153852};
    3716 trait ptr_to_volatile( otype P | pointer( P ), otype T ) }§\impl{ptr_to_volatile}§
     3853trait ptr_to_volatile( type P | pointer( P ), otype T ) }@\impl{ptr_to_volatile}@
    37173854        volatile lvalue T *?( P );
    3718         volatile lvalue T ?[?]( P, long int );§\use{pointer}§
     3855        volatile lvalue T ?[?]( P, long int );@\use{pointer}@
    37193856};
    3720 trait ptr_to_const_volatile( otype P | pointer( P ), otype T ) }§\impl{ptr_to_const_volatile}§
    3721         const volatile lvalue T *?( P );§\use{pointer}§
     3857trait ptr_to_const_volatile( type P | pointer( P ), otype T ) }@\impl{ptr_to_const_volatile}@
     3858        const volatile lvalue T *?( P );@\use{pointer}@
    37223859        const volatile lvalue T ?[?]( P, long int );
    37233860};
    37243861\end{lstlisting}
    37253862
    3726 Assignment to pointers is more complicated than is the case with other types, because the target's type can have extra type qualifiers in the pointed-at type: a ``\lstinline@T *@'' can be assigned to a ``\lstinline@const T *@'', a ``\lstinline@volatile T *@'', and a ``\lstinline@const volatile T *@''.
     3863Assignment to pointers is more complicated than is the case with other types, because the target's type can have extra type qualifiers in the pointed-at type: a ``\lstinline$T *$'' can be assigned to a ``\lstinline$const T *$'', a ``\lstinline$volatile T *$'', and a ``\lstinline$const volatile T *$''.
    37273864Again, the pointed-at type is passed in, so that assertions can connect these specifications to the
    3728 ``\lstinline@ptr_to@'' specifications.
    3729 \begin{lstlisting}
    3730 trait m_l_ptr_to( otype P | m_l_pointer( P ),§\use{m_l_pointer}§§\impl{m_l_ptr_to}§ otype T | ptr_to( P, T )§\use{ptr_to}§ {
     3865``\lstinline$ptr_to$'' specifications.
     3866\begin{lstlisting}
     3867trait m_l_ptr_to( type P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to}@ otype T | ptr_to( P, T )@\use{ptr_to}@ {
    37313868        P ?=?( P *, T * );
    37323869        T * ?=?( T **, P );
    37333870};
    3734 trait m_l_ptr_to_const( otype P | m_l_pointer( P ),§\use{m_l_pointer}§§\impl{m_l_ptr_to_const}§ otype T | ptr_to_const( P, T )§\use{ptr_to_const}§) {
     3871trait m_l_ptr_to_const( type P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to_const}@ otype T | ptr_to_const( P, T )@\use{ptr_to_const}@) {
    37353872        P ?=?( P *, const T * );
    37363873        const T * ?=?( const T **, P );
    37373874};
    3738 trait m_l_ptr_to_volatile( otype P | m_l_pointer( P ),§\use{m_l_pointer}§§\impl{m_l_ptr_to_volatile}§ otype T | ptr_to_volatile( P, T )) {§\use{ptr_to_volatile}§
     3875trait m_l_ptr_to_volatile( type P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to_volatile}@ otype T | ptr_to_volatile( P, T )) {@\use{ptr_to_volatile}@
    37393876        P ?=?( P *, volatile T * );
    37403877        volatile T * ?=?( volatile T **, P );
    37413878};
    3742 trait m_l_ptr_to_const_volatile( otype P | ptr_to_const_volatile( P ),§\use{ptr_to_const_volatile}§§\impl{m_l_ptr_to_const_volatile}§
    3743                 otype T | m_l_ptr_to_volatile( P, T ) | m_l_ptr_to_const( P )) {§\use{m_l_ptr_to_const}§§\use{m_l_ptr_to_volatile}§
     3879trait m_l_ptr_to_const_volatile( type P | ptr_to_const_volatile( P ),@\use{ptr_to_const_volatile}@@\impl{m_l_ptr_to_const_volatile}@
     3880                type T | m_l_ptr_to_volatile( P, T ) | m_l_ptr_to_const( P )) {@\use{m_l_ptr_to_const}@@\use{m_l_ptr_to_volatile}@
    37443881        P ?=?( P *, const volatile T * );
    37453882        const volatile T * ?=?( const volatile T **, P );
     
    37503887An alternative specification can make use of the fact that qualification of the pointed-at type is part of a pointer type to capture that regularity.
    37513888\begin{lstlisting}
    3752 trait m_l_ptr_like( type MyP | m_l_pointer( MyP ),§\use{m_l_pointer}§§\impl{m_l_ptr_like}§ type CP | m_l_pointer( CP ) ) {
     3889trait m_l_ptr_like( type MyP | m_l_pointer( MyP ),@\use{m_l_pointer}@@\impl{m_l_ptr_like}@ type CP | m_l_pointer( CP ) ) {
    37533890        MyP ?=?( MyP *, CP );
    37543891        CP ?=?( CP *, MyP );
    37553892};
    37563893\end{lstlisting}
    3757 The assertion ``\lstinline@| m_l_ptr_like( Safe_ptr, const int * )@'' should be read as
    3758 ``\lstinline@Safe_ptr@ is a pointer type like \lstinline@const int *@''.
     3894The assertion ``\lstinline$| m_l_ptr_like( Safe_ptr, const int * )$'' should be read as
     3895``\lstinline$Safe_ptr$ is a pointer type like \lstinline$const int *$''.
    37593896This specification has two defects, compared to the original four: there is no automatic assertion that dereferencing a
    3760 \lstinline@MyP@ produces an lvalue of the type that \lstinline@CP@ points at, and the
    3761 ``\lstinline@|m_l_pointer( CP )@'' assertion provides only a weak assurance that the argument passed to \lstinline@CP@ really is a pointer type.
     3897\lstinline$MyP$ produces an lvalue of the type that \lstinline$CP$ points at, and the
     3898``\lstinline$|m_l_pointer( CP )$'' assertion provides only a weak assurance that the argument passed to \lstinline$CP$ really is a pointer type.
    37623899
    37633900
     
    37653902
    37663903Different operators often have related meanings;
    3767 for instance, in C, ``\lstinline@+@'',
    3768 ``\lstinline@+=@'', and the two versions of ``\lstinline@++@'' perform variations of addition.
     3904for instance, in C, ``\lstinline$+$'',
     3905``\lstinline$+=$'', and the two versions of ``\lstinline$++$'' perform variations of addition.
    37693906Languages like {\CC} and Ada allow programmers to define operators for new types, but do not require that these relationships be preserved, or even that all of the operators be implemented.
    37703907Completeness and consistency is left to the good taste and discretion of the programmer.
     
    37793916The different comparison operators have obvious relationships, but there is no obvious subset of the operations to use in the implementation of the others.
    37803917However, it is usually convenient to implement a single comparison function that returns a negative integer, 0, or a positive integer if its first argument is respectively less than, equal to, or greater than its second argument;
    3781 the library function \lstinline@strcmp@ is an example.
    3782 
    3783 C and \CFA have an extra, non-obvious comparison operator: ``\lstinline@!@'', logical negation, returns 1 if its operand compares equal to 0, and 0 otherwise.
     3918the library function \lstinline$strcmp$ is an example.
     3919
     3920C and \CFA have an extra, non-obvious comparison operator: ``\lstinline$!$'', logical negation, returns 1 if its operand compares equal to 0, and 0 otherwise.
    37843921\begin{lstlisting}
    37853922trait comparable( otype T ) {
     
    38303967
    38313968Note that, although an arithmetic type would certainly provide comparison functions, and an integral type would provide arithmetic operations, there does not have to be any relationship among
    3832 \lstinline@int_base@, \lstinline@arith_base@ and \lstinline@comparable@.
     3969\lstinline$int_base$, \lstinline$arith_base$ and \lstinline$comparable$.
    38333970Note also that these declarations provide guidance and assistance, but they do not define an absolutely minimal set of requirements.
    3834 A truly minimal implementation of an arithmetic type might only provide \lstinline@0@, \lstinline@1@, and \lstinline@?-=?@, which would be used by polymorphic \lstinline@?+=?@, \lstinline@?*=?@, and \lstinline@?/=?@ functions.
    3835 
    3836 Note also that \lstinline@short@ is an integer type in C11 terms, but has no operations!
     3971A truly minimal implementation of an arithmetic type might only provide
     3972\lstinline$0$, \lstinline$1$, and \lstinline$?-=?$, which would be used by polymorphic
     3973\lstinline$?+=?$, \lstinline$?*=?$, and \lstinline$?/=?$ functions.
     3974
     3975Note also that \lstinline$short$ is an integer type in C11 terms, but has no operations!
    38373976
    38383977
     
    38413980
    38423981Restrict allowed to qualify anything, or type/dtype parameters, but only affects pointers.
    3843 This gets into \lstinline@noalias@ territory.
    3844 Qualifying anything (``\lstinline@short restrict rs@'') means pointer parameters of \lstinline@?++@, etc, would need restrict qualifiers.
     3982This gets into \lstinline$noalias$ territory.
     3983Qualifying anything (``\lstinline$short restrict rs$'') means pointer parameters of \lstinline$?++$, etc, would need restrict qualifiers.
    38453984
    38463985Enumerated types.
     
    38523991Color, enum Color ) really make sense? ?++ does, but it adds (int)1.
    38533992
    3854 Operators on {,signed,unsigned} char and other small types. \lstinline@?<?@ harmless;
     3993Operators on {,signed,unsigned} char and other small types. ?<? harmless;
    38553994?*? questionable for chars.
    38563995Generic selections make these choices visible.
     
    38583997``promotion'' function?
    38593998
    3860 \lstinline@register@ assignment might be handled as assignment to a temporary with copying back and forth, but copying must not be done by assignment.
    3861 
    3862 Don't use \lstinline@ptrdiff_t@ by name in the predefineds.
     3999\lstinline$register$ assignment might be handled as assignment to a temporary with copying back and forth, but copying must not be done by assignment.
     4000
     4001Don't use ptrdiff\_t by name in the predefineds.
    38634002
    38644003Polymorphic objects.
     
    38674006
    38684007\bibliographystyle{plain}
    3869 \bibliography{cfa}
     4008\bibliography{refrat}
    38704009
    38714010
Note: See TracChangeset for help on using the changeset viewer.