Add an intermezzo about substitution.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 2 Dec 2009 14:50:42 +0000 (15:50 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 2 Dec 2009 14:50:42 +0000 (15:50 +0100)
This is the first attempt at an intermezzo, which is not quite ideal yet,
but it works for now.

Chapters/Normalization.tex
Utils/Lambda.tex

index 78b7a1d2e2352662fd759c495af3904b7fdd163b..03f379244e0299b787ae294c90e4db2c07eab829 100644 (file)
       In the following sections, we will be using a number of functions and
       notations, which we will define here.
 
       In the following sections, we will be using a number of functions and
       notations, which we will define here.
 
-      \todo{Define substitution (notation)}
-
       \subsubsection{Concepts}
         A \emph{global variable} is any variable (binder) that is bound at the
         top level of a program, or an external module. A \emph{local variable} is any
       \subsubsection{Concepts}
         A \emph{global variable} is any variable (binder) that is bound at the
         top level of a program, or an external module. A \emph{local variable} is any
        optimizations, but they are required to get our program into intended
        normal form.
 
        optimizations, but they are required to get our program into intended
        normal form.
 
+        \placeintermezzo{}{
+          \startframedtext[width=8cm,background=box,frame=no]
+          \startalignment[center]
+            {\tfa Substitution notation}
+          \stopalignment
+          \blank[medium]
+
+          In some of the transformations in this chapter, we need to perform
+          substitution on an expression. Substitution means replacing every
+          occurence of some expression (usually a variable reference) with
+          another expression.
+
+          There have been a lot of different notations used in literature for
+          specifying substitution. The notation that will be used in this report
+          is the following:
+
+          \startlambda
+            E[A=>B]
+          \stoplambda
+
+          This means expression \lam{E} with all occurences of \lam{A} replaced
+          with \lam{B}.
+          \stopframedtext
+        }
+
+      \defref{beta-reduction}
       \subsubsection[sec:normalization:beta]{β-reduction}
       \subsubsection[sec:normalization:beta]{β-reduction}
-        \defref{beta-reduction}
         β-reduction is a well known transformation from lambda calculus, where it is
         the main reduction step. It reduces applications of lambda abstractions,
         removing both the lambda abstraction and the application.
         β-reduction is a well known transformation from lambda calculus, where it is
         the main reduction step. It reduces applications of lambda abstractions,
         removing both the lambda abstraction and the application.
index f08d75ee65670b86e33c98b73394a361444feb1d..319b4249697ca79ab4ebad3f806f44f4be00bf05 100644 (file)
@@ -124,4 +124,18 @@ draw b;
 \definefloat[example][examples]
 \setupcaption[example][location=top] % Put captions on top
 
 \definefloat[example][examples]
 \setupcaption[example][location=top] % Put captions on top
 
+% Margin magic taken from
+% http://www.pragma-ade.com/general/manuals/details.pdf By setting negative
+% margin distances, we put our float inside the outer margin. I think we set
+% both left and right margin distance, because we don't know what will be the
+% outer margin (and it will probably only use the distance of the margin it's
+% actually aligning against).
+% We also set an offset, to prevent protruding text (overfull hboxes) from
+% jamming into the intermezzo. Also, some extra space is easier on the eye
+% (However, the intermezzo is moved to the right by this offset, instead of
+% moving the text to left. We can't increase the offset by much...)
+\setupfloat[intermezzo][offset=.3cm,leftmargindistance=-\leftmarginwidth, rightmargindistance=-\rightmarginwidth, default={outer}]
+\setupcaption[intermezzo][location=top,number=no] % Put captions on top
+
+\setupheads[aligntitle=float]
 % vim: set sw=2 sts=2 expandtab:
 % vim: set sw=2 sts=2 expandtab: