Changeset 37218fc for doc/refrat
- Timestamp:
- Apr 11, 2016, 11:51:07 AM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 37f0da8
- Parents:
- 3aba311 (diff), e55ca05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- doc/refrat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/refrat/Makefile
r3aba311 r37218fc 1 1 ## Define the appropriate configuration variables. 2 2 3 Macros = 4 TeXLIB = .:${Macros}: 3 TeXLIB = .:../bibliography/:../LaTeXmacros/: 5 4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex 6 BibTeX = B STINPUTS=${TeXLIB} && export BSTINPUTS && bibtex5 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 7 6 8 7 ## Define the text source files. … … 44 43 dvips $< -o $@ 45 44 46 ${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex ${basename ${DOCUMENT}}.bib 45 ${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex \ 46 ../LaTeXmacros/common.tex ../LaTeXmacros/indexstyle ../bibliography/cfa.bib 47 47 # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. 48 48 if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi … … 54 54 -${BibTeX} ${basename $@} 55 55 # Make index from *.aux entries and input index at end of document 56 makeindex -s indexstyle ${basename $@}.idx56 makeindex -s ../LaTeXmacros/indexstyle ${basename $@}.idx 57 57 ${LaTeX} ${basename $@}.tex 58 58 # Run again to get index title into table of contents -
doc/refrat/refrat.tex
r3aba311 r37218fc 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 : Fri Apr 8 18:32:07 2016 14 %% Update Count : 6 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 1 17 % requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended 2 18 … … 5 21 6 22 % Latex packages used in the document. 7 8 23 \usepackage{fullpage,times} 9 24 \usepackage{xspace} … … 21 36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 37 23 % Names used in the document.24 25 \newcommand{\CFA}{C$\forall$\xspace} % set language symbolic name26 \newcommand{\CFL}{Cforall\xspace} % set language text name27 \newcommand{\CC}{C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name28 \def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)29 30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%31 32 38 % Bespoke macros used in the document. 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{ 159 language=CFA, 160 columns=flexible, 161 basicstyle=\sf\relsize{-1}, 162 tabsize=4, 163 xleftmargin=\parindent, 164 escapechar=@, 165 keepspaces=true, 166 showstringspaces=false, 167 showlines=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 39 \input{common} 182 40 183 41 \setcounter{secnumdepth}{3} % number subsubsections … … 226 84 227 85 This document is a reference manual and rationale for \CFA, a polymorphic extension of the C programming language. 228 It makes frequent reference to the {\c11} standard \cite{ ANS:C11}, and occasionally compares \CFA to {\CC} \cite{c++}.86 It makes frequent reference to the {\c11} standard \cite{C11}, and occasionally compares \CFA to {\CC} \cite{C++}. 229 87 230 88 The manual deliberately imitates the ordering of the {\c11} standard (although the section numbering differs). … … 720 578 721 579 There are two notable differences between \CFA's overload resolution rules and the rules for 722 {\CC} defined in \cite{ c++}.580 {\CC} defined in \cite{C++}. 723 581 First, the result type of a function plays a role. 724 582 In {\CC}, a function call must be completely resolved based on the arguments to the call in most circumstances. … … 3384 3242 \begin{itemize} 3385 3243 \item 3386 Inside a Clu cluster \cite{ clu}, the declaration of an instance states which view applies.3244 Inside a Clu cluster \cite{CLU}, the declaration of an instance states which view applies. 3387 3245 Two primitives called \lstinline$up$ and \lstinline$down$ can be used to convert between the views. 3388 3246 \item 3389 The Simula class \cite{S imula87} is essentially a record type.3247 The Simula class \cite{SIMULA87} is essentially a record type. 3390 3248 Since 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. 3391 3249 In {\CC} 3392 \cite{ c++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded.3250 \cite{C++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded. 3393 3251 A ``scope resolution'' operator can be used inside the class to specify whether the abstract or implementation version of the operation should be used. 3394 3252 \item 3395 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.3253 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. 3396 3254 The derived subprograms are clones of the existing subprograms with the old type replaced by the derived type. 3397 3255 Literals and aggregates of the old type are also cloned. … … 3843 3701 ``\lstinline$Safe_pointer$ acts like a pointer to \lstinline$int$''. 3844 3702 \begin{lstlisting} 3845 trait ptr_to( type P | pointer( P ), otype T ) {@\impl{ptr_to}@@\use{pointer}@3703 trait ptr_to( otype P | pointer( P ), otype T ) {@\impl{ptr_to}@@\use{pointer}@ 3846 3704 lvalue T *?( P ); 3847 3705 lvalue T ?[?]( P, long int ); 3848 3706 }; 3849 trait ptr_to_const( type P | pointer( P ), otype T ) {@\impl{ptr_to_const}@3707 trait ptr_to_const( otype P | pointer( P ), otype T ) {@\impl{ptr_to_const}@ 3850 3708 const lvalue T *?( P ); 3851 3709 const lvalue T ?[?]( P, long int );@\use{pointer}@ 3852 3710 }; 3853 trait ptr_to_volatile( type P | pointer( P ), otype T ) }@\impl{ptr_to_volatile}@3711 trait ptr_to_volatile( otype P | pointer( P ), otype T ) }@\impl{ptr_to_volatile}@ 3854 3712 volatile lvalue T *?( P ); 3855 3713 volatile lvalue T ?[?]( P, long int );@\use{pointer}@ 3856 3714 }; 3857 trait ptr_to_const_volatile( type P | pointer( P ), otype T ) }@\impl{ptr_to_const_volatile}@3715 trait ptr_to_const_volatile( otype P | pointer( P ), otype T ) }@\impl{ptr_to_const_volatile}@ 3858 3716 const volatile lvalue T *?( P );@\use{pointer}@ 3859 3717 const volatile lvalue T ?[?]( P, long int ); … … 3865 3723 ``\lstinline$ptr_to$'' specifications. 3866 3724 \begin{lstlisting} 3867 trait 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}@ {3725 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}@ { 3868 3726 P ?=?( P *, T * ); 3869 3727 T * ?=?( T **, P ); 3870 3728 }; 3871 trait 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}@) {3729 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}@) { 3872 3730 P ?=?( P *, const T * ); 3873 3731 const T * ?=?( const T **, P ); 3874 3732 }; 3875 trait 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}@3733 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}@ 3876 3734 P ?=?( P *, volatile T * ); 3877 3735 volatile T * ?=?( volatile T **, P ); 3878 3736 }; 3879 trait 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}@3737 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}@ 3738 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}@ 3881 3739 P ?=?( P *, const volatile T * ); 3882 3740 const volatile T * ?=?( const volatile T **, P ); … … 4006 3864 4007 3865 \bibliographystyle{plain} 4008 \bibliography{ refrat}3866 \bibliography{cfa} 4009 3867 4010 3868
Note:
See TracChangeset
for help on using the changeset viewer.