Changeset b64d0f4 for doc/theses


Ignore:
Timestamp:
Mar 10, 2024, 11:19:32 AM (4 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
5546f50b
Parents:
266732e
Message:

second attempt changing program-input style

Location:
doc/theses/mike_brooks_MMath
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/Makefile

    r266732e rb64d0f4  
    6767        ${CFA} $< -o $@
    6868
    69 ${Build}/%: ${Programs}/%.run.cfa | ${Build}
    70         ${CFA} $< -o $@
     69${Build}/%: ${Programs}/%.run.cfa | ${Build} # cfa cannot handle pipe
     70        sed -f ${Programs}/sedcmd $< > ${Build}/tmp.cfa; ${CFA} ${Build}/tmp.cfa -o $@
    7171
    7272${Build}/%: ${Programs}/%.run.c | ${Build}
    73         ${CC}  $< -o $@
     73        sed -f ${Programs}/sedcmd $< | ${CC} -x c -I ${Programs} -o $@ -
    7474
    7575${Build}/%: ${Programs}/%.run.cpp | ${Build}
    76         ${CXX} -MMD $< -o $@
     76        sed -f ${Programs}/sedcmd $< | ${CXX} -x c++ -I ${Programs} -o $@ -
    7777
    7878${Build}/%.out: ${Build}/% | ${Build}
  • doc/theses/mike_brooks_MMath/array.tex

    r266732e rb64d0f4  
    8080The stratification of type variables preceding object declarations makes a length referenceable everywhere that it is needed.
    8181For example, a declaration can share one length, @N@, among a pair of parameters and the return.
    82 \lstinputlisting[language=CFA, firstline=10, lastline=17]{hello-array.cfa}
     82\lstinput{10-17}{hello-array.cfa}
    8383Here, the function @f@ does a pointwise comparison, checking if each pair of numbers is within half a percent of each other, returning the answers in a newly allocated @bool@ array.
    8484
     
    9494
    9595\begin{figure}
    96 \lstinputlisting[language=CFA, firstline=30, lastline=49]{hello-array.cfa}
     96\lstinput{30-49}{hello-array.cfa}
    9797\caption{\lstinline{f} Harness}
    9898\label{f:fHarness}
     
    142142}
    143143\end{cfa}
    144 %\lstinputlisting[language=CFA, firstline=60, lastline=65]{hello-array.cfa}
     144%\lstinput{60-65}{hello-array.cfa}
    145145As is common practice in C, the programmer is free to cast, to assert knowledge not shared with the type system.
    146146\begin{cfa}
     
    152152}
    153153\end{cfa}
    154 %\lstinputlisting[language=CFA, firstline=70, lastline=75]{hello-array.cfa}
     154%\lstinput{70-75}{hello-array.cfa}
    155155
    156156Argument safety and the associated implicit communication of array length work with \CFA's generic types too.
    157157\CFA allows aggregate types to be generalized with multiple type parameters, including parameterized element type, so can it be defined over a parameterized length.
    158158Doing so gives a refinement of C's ``flexible array member'' pattern, that allows nesting structures with array members anywhere within other structures.
    159 \lstinputlisting[language=CFA, firstline=10, lastline=16]{hello-accordion.cfa}
     159\lstinput{10-16}{hello-accordion.cfa}
    160160This structure's layout has the starting offset of @cost_contribs@ varying in @Nclients@, and the offset of @total_cost@ varying in both generic parameters.
    161161For a function that operates on a @request@ structure, the type system handles this variation transparently.
    162 \lstinputlisting[language=CFA, firstline=40, lastline=47]{hello-accordion.cfa}
     162\lstinput{40-47}{hello-accordion.cfa}
    163163In the example, different runs of the program result in different offset values being used.
    164 \lstinputlisting[language=CFA, firstline=60, lastline=76]{hello-accordion.cfa}
     164\lstinput{60-76}{hello-accordion.cfa}
    165165The output values show that @summarize@ and its caller agree on both the offsets (where the callee starts reading @cost_contribs@ and where the callee writes @total_cost@).
    166166Yet the call site still says just, ``pass the request.''
     
    179179
    180180Examples are shown using a $5 \times 7$ float array, @a@, loaded with increments of $0.1$ when stepping across the length-7 finely-strided dimension shown on columns, and with increments of $1.0$ when stepping across the length-5 coarsely-strided dimension shown on rows.
    181 %\lstinputlisting[language=CFA, firstline=120, lastline=126]{hello-md.cfa}
     181%\lstinput{120-126}{hello-md.cfa}
    182182The memory layout of @a@ has strictly increasing numbers along its 35 contiguous positions.
    183183
     
    185185Like with the C array, a lesser-dimensional array reference can be bound to the result of subscripting a greater-dimensional array, by a prefix of its dimensions.
    186186This action first subscripts away the most coarsely strided dimensions, leaving a result that expects to be be subscripted by the more finely strided dimensions.
    187 \lstinputlisting[language=CFA, firstline=60, lastline=66]{hello-md.cfa}
    188 \lstinputlisting[aboveskip=0pt, language=CFA, firstline=140, lastline=140]{hello-md.cfa}
     187\lstinput{60-66}{hello-md.cfa}
     188\lstinput[aboveskip=0pt]{140-140}{hello-md.cfa}
    189189
    190190This function declaration is asserting too much knowledge about its parameter @c@, for it to be usable for printing either a row slice or a column slice.
     
    194194The new-array library provides the trait @ix@, so-defined.
    195195With it, the original declaration can be generalized, while still implemented with the same body, to the latter declaration:
    196 \lstinputlisting[language=CFA, firstline=40, lastline=44]{hello-md.cfa}
    197 \lstinputlisting[aboveskip=0pt, language=CFA, firstline=145, lastline=145]{hello-md.cfa}
     196\lstinput{40-44}{hello-md.cfa}
     197\lstinput[aboveskip=0pt]{145-145}{hello-md.cfa}
    198198
    199199Nontrivial slicing, in this example, means passing a noncontiguous slice to @print1d@.
    200200The new-array library provides a ``subscript by all'' operation for this purpose.
    201201In a multi-dimensional subscript operation, any dimension given as @all@ is left ``not yet subscripted by a value,'' implementing the @ix@ trait, waiting for such a value.
    202 \lstinputlisting[language=CFA, firstline=150, lastline=151]{hello-md.cfa}
     202\lstinput{150-151}{hello-md.cfa}
    203203
    204204The example has shown that @a[2]@ and @a[[2, all]]@ both refer to the same, ``2.*'' slice.
  • doc/theses/mike_brooks_MMath/background.tex

    r266732e rb64d0f4  
    503503\subsection{The pointer-to-array type has been noticed before}
    504504
     505\subsection{Multi-Dimensional}
     506
     507As in the last section, we inspect the declaration ...
     508\lstinput{16-18}{bkgd-carray-mdim.c}
     509The significant axis of deriving expressions from @a@ is now ``itself,'' ``first element'' or ``first grand-element (meaning, first element of first element).''
     510\lstinput{20-44}{bkgd-carray-mdim.c}
     511
    505512
    506513\section{\CFA}
  • doc/theses/mike_brooks_MMath/conclusion.tex

    r266732e rb64d0f4  
    11\chapter{Conclusion}
     2
     3\section{Lists}
    24
    35\section{Arrays}
  • doc/theses/mike_brooks_MMath/list.tex

    r266732e rb64d0f4  
    6464\begin{comment}
    6565\begin{figure}
    66     \begin{tabularx}{\textwidth}{Y|Y|Y}\lstinputlisting[language=C  , firstline=20, lastline=39]{lst-issues-intrusive.run.c}
    67         &\lstinputlisting[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-byref.run.cpp}
    68         &\lstinputlisting[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-emplaced.run.cpp}
     66    \begin{tabularx}{\textwidth}{Y|Y|Y}
     67                \lstinput[language=C]{20-39}{lst-issues-intrusive.run.c}
     68        &\lstinputlisting[language=C++]{20-39}{lst-issues-wrapped-byref.run.cpp}
     69        &\lstinputlisting[language=C++]{20-39}{lst-issues-wrapped-emplaced.run.cpp}
    6970      \\ & &
    7071      \\
     
    100101\begin{lrbox}{\myboxA}
    101102\begin{tabular}{@{}l@{}}
    102 \lstinputlisting[language=C, firstline=20, lastline=39]{lst-issues-intrusive.run.c} \\
     103\lstinput[language=C]{20-39}{lst-issues-intrusive.run.c} \\
    103104\ \\
    104105\includegraphics[page=1]{lst-issues-attach.pdf}
     
    108109\begin{lrbox}{\myboxB}
    109110\begin{tabular}{@{}l@{}}
    110 \lstinputlisting[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-byref.run.cpp} \\
     111\lstinput[language=C++]{20-39}{lst-issues-wrapped-byref.run.cpp} \\
    111112\ \\
    112113\includegraphics[page=2]{lst-issues-attach.pdf}
     
    116117\begin{lrbox}{\myboxC}
    117118\begin{tabular}{@{}l@{}}
    118 \lstinputlisting[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-emplaced.run.cpp} \\
     119\lstinput[language=C++]{20-39}{lst-issues-wrapped-emplaced.run.cpp} \\
    119120\ \\
    120121\includegraphics[page=3]{lst-issues-attach.pdf}
     
    180181
    181182\begin{figure}
    182     \lstinputlisting[language=C++, firstline=100, lastline=117]{lst-issues-attach-reduction.hpp}
    183     \lstinputlisting[language=C++, firstline=150, lastline=150]{lst-issues-attach-reduction.hpp}
     183    \lstinput[language=C++]{100-117}{lst-issues-attach-reduction.hpp}
     184    \lstinput[language=C++]{150-150}{lst-issues-attach-reduction.hpp}
    184185    \caption{
    185186        Reduction of wrapped attachment to intrusive attachment.
     
    228229\begin{figure}
    229230    \parbox[t]{3.5in} {
    230         \lstinputlisting[language=C++, firstline=20, lastline=60]{lst-issues-multi-static.run.c}
     231        \lstinput[language=C++]{20-60}{lst-issues-multi-static.run.c}
    231232    }\parbox[t]{20in} {
    232233        ~\\
     
    353354
    354355\begin{figure}
    355     \lstinputlisting[language=CFA, firstline=20, lastline=32]{lst-features-intro.run.cfa}
     356    \lstinput{20-32}{lst-features-intro.run.cfa}
    356357    \caption[Multiple link directions in \CFA list library]{
    357358        Demonstration of the running \lstinline{req} example, done using the \CFA list library.
     
    365366\begin{tabular}{@{}ll@{}}
    366367\begin{tabular}{@{}l@{}}
    367     \lstinputlisting[language=CFA, firstline=20, lastline=25]{lst-features-multidir.run.cfa} \\
    368     \lstinputlisting[language=CFA, firstline=40, lastline=67]{lst-features-multidir.run.cfa}
     368    \lstinput{20-25}{lst-features-multidir.run.cfa} \\
     369    \lstinput{40-67}{lst-features-multidir.run.cfa}
    369370    \end{tabular}
    370371        &
    371         \lstinputlisting[language=C++, firstline=20, lastline=60]{lst-issues-multi-static.run.c}
     372        \lstinput[language=C++]{20-60}{lst-issues-multi-static.run.c}
    372373        \end{tabular}
    373374
  • doc/theses/mike_brooks_MMath/uw-ethesis.tex

    r266732e rb64d0f4  
    9696
    9797\makeatletter
    98 \newcommand{\lstinput}[2]{\lstinputlisting[linerange={#1},xleftmargin=4pt,escapechar={\$},moredelim={**[is][\color{red}]{@}{@}}]{#2}}
     98\newcommand{\lstinput}[3][]{\lstinputlisting[#1,linerange={#2},xleftmargin=4pt,escapechar={\$},moredelim={**[is][\color{red}]{@}{@}}]{#3}}
    9999\makeatother
    100100% cfa macros used in the document
Note: See TracChangeset for help on using the changeset viewer.