(***********************************************************************

                    Mathematica-Compatible Notebook

This notebook can be used on any computer system with Mathematica 4.0,
MathReader 4.0, or any compatible application. The data for the notebook 
starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do one of 
the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the application;

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing the 
word CacheID, otherwise Mathematica-compatible applications may try to 
use invalid cache data.

For more information on notebooks and Mathematica-compatible 
applications, contact Wolfram Research:
  web: http://www.wolfram.com
  email: info@wolfram.com
  phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from 
Wolfram Research.
***********************************************************************)

(*CacheID: 232*)


(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[     23977,        676]*)
(*NotebookOutlinePosition[     31055,        904]*)
(*  CellTagsIndexPosition[     30133,        862]*)
(*WindowFrame->Normal*)



Notebook[{
Cell["A.4 Evaluation", "Section",
  CellTags->{"SA.4.0", "0.1"}],

Cell["A.4.1 The Standard Evaluation Sequence", "Subsection",
  CellTags->{"SA.4.1", "1.1"}],

Cell[TextData[{
  "The following is the sequence of steps that ",
  StyleBox["Mathematica", "TI"],
  " follows in evaluating an expression like ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "1"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "2"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " \[Ellipsis] ",
  StyleBox["]", "MR"],
  ". Every time the expression changes, ",
  StyleBox["Mathematica", "TI"],
  " effectively starts the evaluation sequence over again.  "
}], "Text",
  CellTags->{"SA.4.1", "1.2"}],

Cell[TextData[{
  "\[FilledSmallSquare] If the expression is a raw object (e.g., ",
  StyleBox["Integer", "MR"],
  ", ",
  StyleBox["String", "MR"],
  ", etc.), leave it unchanged.  \n\[FilledSmallSquare] Evaluate the head ",
  StyleBox["h", "TI"],
  " of the expression.  \n\[FilledSmallSquare] Evaluate each element ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  " of the expression in turn. If ",
  StyleBox["h", "TI"],
  " is a symbol with attributes ",
  StyleBox["HoldFirst", "MR"],
  ", ",
  StyleBox["HoldRest", "MR"],
  ", ",
  StyleBox["HoldAll", "MR"],
  " or ",
  StyleBox["HoldAllComplete", "MR"],
  ", then skip evaluation of certain elements.   \n\[FilledSmallSquare] \
Unless ",
  StyleBox["h", "TI"],
  " has attribute ",
  StyleBox["HoldAllComplete", "MR"],
  " strip the outermost of any ",
  StyleBox["Unevaluated", "MR"],
  " wrappers that appear in the ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  ".  \n\[FilledSmallSquare] Unless ",
  StyleBox["h", "TI"],
  " has attribute ",
  StyleBox["SequenceHold", "MR"],
  ", flatten out all ",
  StyleBox["Sequence", "MR"],
  " objects that appear among the ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  ".   \n\[FilledSmallSquare] If ",
  StyleBox["h", "TI"],
  " has attribute ",
  StyleBox["Flat", "MR"],
  ", then flatten out all nested expressions with head ",
  StyleBox["h", "TI"],
  ".  \n\[FilledSmallSquare] If ",
  StyleBox["h", "TI"],
  " has attribute ",
  StyleBox["Listable", "MR"],
  ", then thread through any ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  " that are lists.  \n\[FilledSmallSquare] If ",
  StyleBox["h", "TI"],
  " has attribute ",
  StyleBox["Orderless", "MR"],
  ", then sort the ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  " into order.  \n\[FilledSmallSquare] Unless ",
  StyleBox["h", "TI"],
  " has attribute ",
  StyleBox["HoldAllComplete", "MR"],
  ", use any applicable transformation rules associated with ",
  StyleBox["f", "TI"],
  " that you have defined for objects of the form ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  " ",
  StyleBox["f", "TI"],
  StyleBox["[", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "1"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " \[Ellipsis] ",
  StyleBox["],", "MR"],
  " \[Ellipsis]  ",
  StyleBox["]", "MR"],
  ".   \n\[FilledSmallSquare] Use any built\[Hyphen]in transformation rules \
associated with ",
  StyleBox["f", "TI"],
  " for objects of the form ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  " ",
  StyleBox["f", "TI"],
  StyleBox["[", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "1"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " \[Ellipsis] ",
  StyleBox["],", "MR"],
  " \[Ellipsis] ",
  StyleBox["]", "MR"],
  ".  \n\[FilledSmallSquare] Use any applicable transformation rules that you \
have defined for ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "1"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "2"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " \[Ellipsis] ",
  StyleBox["]", "MR"],
  " or for ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  " \[Ellipsis] ",
  StyleBox["][", "MR"],
  " \[Ellipsis] ",
  StyleBox["]", "MR"],
  ".  \n\[FilledSmallSquare] Use any built\[Hyphen]in transformation rules \
for ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "1"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "2"], TraditionalForm]], "InlineFormula"],
  StyleBox[",", "MR"],
  " \[Ellipsis] ",
  StyleBox["]", "MR"],
  " or for ",
  StyleBox["h", "TI"],
  StyleBox["[", "MR"],
  " \[Ellipsis] ",
  StyleBox["][", "MR"],
  " \[Ellipsis] ",
  StyleBox["]", "MR"],
  ".  "
}], "Notes",
  CellTags->{"SA.4.1", "1.3"}],

Cell["A.4.2 Non\[Hyphen]Standard Argument Evaluation", "Subsection",
  CellTags->{"SA.4.2", "2.1"}],

Cell[TextData[{
  "There are a number of built\[Hyphen]in ",
  StyleBox["Mathematica", "TI"],
  " functions that evaluate their arguments in special ways. The control \
structure ",
  StyleBox["While", "MR"],
  " is an example. The symbol ",
  StyleBox["While", "MR"],
  " has the attribute ",
  StyleBox["HoldAll", "MR"],
  ". As a result, the arguments of ",
  StyleBox["While", "MR"],
  " are not evaluated as part of the standard evaluation process. Instead, \
the internal code for ",
  StyleBox["While", "MR"],
  " evaluates the arguments in a special way. In the case of ",
  StyleBox["While", "MR"],
  ", the code evaluates the arguments repeatedly, so as to implement a loop. \
"
}], "Text",
  CellTags->{"SA.4.2", "2.2"}],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {"\<\"Control structures \"\>", "\<\"arguments evaluated in a \
sequence determined by control flow (e.g., \
\\!\\(\\*StyleBox[\\\"\\\\\\\"CompoundExpression\\\\\\\"\\\", \\\"MR\\\"]\\)) \
\"\>"},
                {"\<\"Conditionals \"\>", "\<\"arguments evaluated only when \
they correspond to branches that are taken (e.g., \
\\!\\(\\*StyleBox[\\\"\\\\\\\"If\\\\\\\"\\\", \\\"MR\\\"]\\), \
\\!\\(\\*StyleBox[\\\"\\\\\\\"Which\\\\\\\"\\\", \\\"MR\\\"]\\)) \"\>"},
                {"\<\"Logical operations \"\>", "\<\"arguments evaluated only \
when they are needed in determining the logical result (e.g., \
\\!\\(\\*StyleBox[\\\"\\\\\\\"And\\\\\\\"\\\", \\\"MR\\\"]\\), \
\\!\\(\\*StyleBox[\\\"\\\\\\\"Or\\\\\\\"\\\", \\\"MR\\\"]\\)) \"\>"},
                {"\<\"Iteration functions \"\>", "\<\"first argument \
evaluated for each step in the iteration (e.g., \
\\!\\(\\*StyleBox[\\\"\\\\\\\"Do\\\\\\\"\\\", \\\"MR\\\"]\\), \
\\!\\(\\*StyleBox[\\\"\\\\\\\"Sum\\\\\\\"\\\", \\\"MR\\\"]\\), \
\\!\\(\\*StyleBox[\\\"\\\\\\\"Plot\\\\\\\"\\\", \\\"MR\\\"]\\)) \"\>"},
                {"\<\"Tracing functions \"\>", "\<\"form never evaluated \
(e.g., \\!\\(\\*StyleBox[\\\"\\\\\\\"Trace\\\\\\\"\\\", \\\"MR\\\"]\\)) \
\"\>"},
                {"\<\"Assignments \"\>", "\<\"first argument only partially \
evaluated (e.g., \\!\\(\\*StyleBox[\\\"\\\\\\\"Set\\\\\\\"\\\", \
\\\"MR\\\"]\\), \\!\\(\\*StyleBox[\\\"\\\\\\\"AddTo\\\\\\\"\\\", \
\\\"MR\\\"]\\)) \"\>"},
                {"\<\"Pure functions \"\>", "\<\"function body not evaluated \
(e.g., \\!\\(\\*StyleBox[\\\"\\\\\\\"Function\\\\\\\"\\\", \\\"MR\\\"]\\)) \"\
\>"},
                {"\<\"Scoping constructs \"\>", "\<\"variable specifications \
not evaluated (e.g., \\!\\(\\*StyleBox[\\\"\\\\\\\"Module\\\\\\\"\\\", \\\"MR\
\\\"]\\), \\!\\(\\*StyleBox[\\\"\\\\\\\"Block\\\\\\\"\\\", \\\"MR\\\"]\\)) \"\
\>"},
                {"\<\"Holding functions \"\>", "\<\"argument maintained in \
unevaluated form (e.g., \\!\\(\\*StyleBox[\\\"\\\\\\\"Hold\\\\\\\"\\\", \
\\\"MR\\\"]\\), \\!\\(\\*StyleBox[\\\"\\\\\\\"HoldPattern\\\\\\\"\\\", \\\"MR\
\\\"]\\)) \"\>"}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"SA.4.2", "2.3"}],

Cell["\<\
Built\[Hyphen]in functions that evaluate their arguments in special \
ways. \
\>", "Caption",
  CellTags->"SA.4.2"],

Cell["Logical Operations", "Subsubsection",
  CellTags->{"SA.4.2", "2.4"}],

Cell[TextData[{
  "In an expression of the form ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "1"], TraditionalForm]], "InlineFormula"],
  StyleBox["&&", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "2"], TraditionalForm]], "InlineFormula"],
  StyleBox["&&", "MR"],
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "3"], TraditionalForm]], "InlineFormula"],
  " the ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  " are evaluated in order. As soon as any ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  " is found to be ",
  StyleBox["False", "MR"],
  ", evaluation is stopped, and the result ",
  StyleBox["False", "MR"],
  " is returned. This means that you can use the ",
  Cell[BoxData[
      FormBox[
        SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"e\\\\\\\"\\\", \\\"TI\
\\\"]\\)\"\>", "i"], TraditionalForm]], "InlineFormula"],
  " to represent different \[OpenCurlyDoubleQuote]branches\
\[CloseCurlyDoubleQuote] in a program, with a particular branch being \
evaluated only if certain conditions are met.  \nThe ",
  StyleBox["Or", "MR"],
  " function works much like ",
  StyleBox["And", "MR"],
  "; it returns ",
  StyleBox["True", "MR"],
  " as soon as it finds any argument that is ",
  StyleBox["True", "MR"],
  ". ",
  StyleBox["Xor", "MR"],
  ", on the other hand, always evaluates ",
  StyleBox["all", "TI"],
  " its arguments. "
}], "Text",
  CellTags->{"SA.4.2", "2.5"}],

Cell["Iteration Functions", "Subsubsection",
  CellTags->{"SA.4.2", "2.6"}],

Cell[TextData[{
  "An iteration function such as  ",
  StyleBox["Do[", "MR"],
  StyleBox["f", "TI"],
  StyleBox[",", "MR"],
  " ",
  Cell[BoxData[
      \(TraditionalForm\`{\)], "InlineFormula"],
  StyleBox["i", "TI"],
  StyleBox[",", "MR"],
  " ",
  StyleBox["imin", "TI"],
  StyleBox[",", "MR"],
  " ",
  StyleBox["imax", "TI"],
  Cell[BoxData[
      \(TraditionalForm\`}\)], "InlineFormula"],
  StyleBox["]", "MR"],
  " is evaluated as follows:"
}], "Text",
  CellTags->{"SA.4.2", "2.7"}],

Cell[TextData[{
  "\[FilledSmallSquare] The iteration specification is evaluated. If it is \
not found to be of the form ",
  Cell[BoxData[
      \(TraditionalForm\`{\)], "InlineFormula"],
  StyleBox["i", "TI"],
  StyleBox[",", "MR"],
  " ",
  StyleBox["imin", "TI"],
  StyleBox[",", "MR"],
  " ",
  StyleBox["imax", "TI"],
  Cell[BoxData[
      \(TraditionalForm\`}\)], "InlineFormula"],
  ", the evaluation stops. \n\[FilledSmallSquare] The value of the iteration \
variable ",
  StyleBox["i", "TI"],
  " is made local, effectively using ",
  StyleBox["Block", "MR"],
  ".  \n\[FilledSmallSquare] ",
  StyleBox["imin", "TI"],
  " and ",
  StyleBox["imax", "TI"],
  " are used to determine the sequence of values to be assigned to the \
iteration variable\[NonBreakingSpace]",
  StyleBox["i", "TI"],
  ".  \n\[FilledSmallSquare] The iteration variable is successively set to \
each value, and ",
  StyleBox["f", "TI"],
  " is evaluated in each case.  \n\[FilledSmallSquare] The local values \
assigned to ",
  StyleBox["i", "TI"],
  " are cleared.  "
}], "Notes",
  CellTags->{"SA.4.2", "2.8"}],

Cell[TextData[{
  "If there are several iteration variables, the same procedure is followed \
for each variable in turn, for every value of all the preceding variables. \n\
Unless otherwise specified, ",
  StyleBox["f", "TI"],
  " is not evaluated until a specific value has been assigned to ",
  StyleBox["i", "TI"],
  ", and is then evaluated for each value of ",
  StyleBox["i", "TI"],
  " chosen. You can use ",
  StyleBox["Evaluate[", "MR"],
  StyleBox["f", "TI"],
  StyleBox["]", "MR"],
  " to make ",
  StyleBox["f", "TI"],
  " be evaluated immediately, rather than only after a specific value has \
been assigned to ",
  StyleBox["i", "TI"],
  ". "
}], "Text",
  CellTags->{"SA.4.2", "2.9"}],

Cell["Assignments", "Subsubsection",
  CellTags->{"SA.4.2", "2.10"}],

Cell["\<\
The left\[Hyphen]hand sides of assignments are only partially \
evaluated. \
\>", "Text",
  CellTags->{"SA.4.2", "2.11"}],

Cell["\<\
\[FilledSmallSquare] If the left\[Hyphen]hand side is a symbol, no \
evaluation is performed.  
\[FilledSmallSquare] If the left\[Hyphen]hand side is a function without hold \
attributes, the arguments of the function are evaluated, but the function \
itself is not evaluated.  \
\>", "Notes",
  CellTags->{"SA.4.2", "2.12"}],

Cell[TextData[{
  "The right\[Hyphen]hand side is evaluated for immediate (",
  StyleBox["=", "MR"],
  "), but not for delayed (",
  StyleBox[":=", "MR"],
  "), assignments. \nAny subexpression of the form ",
  StyleBox["HoldPattern[", "MR"],
  StyleBox["expr", "TI"],
  StyleBox["]", "MR"],
  " that appears on the left\[Hyphen]hand side of an assignment is not \
evaluated, but is replaced by the unevaluated form of ",
  StyleBox["expr", "TI"],
  " before the assignment is done.  "
}], "Text",
  CellTags->{"SA.4.2", "2.13"}],

Cell["A.4.3 Overriding Non\[Hyphen]Standard Argument Evaluation", "Subsection",
  CellTags->{"SA.4.3", "3.1"}],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {
                  
                  RowBox[{"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"f\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"[\\\\\\\"\\\", \
\\\"MR\\\"]\\)\"\>", 
                    StyleBox[
                      
                      SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\
\\\"\\\", \\\"TI\\\"]\\)\"\>", "1"],
                      
                      "InlineFormula"], \
"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\",\\\\\\\"\\\", \\\"MR\\\"]\\) \[Ellipsis] \
\\!\\(\\*StyleBox[\\\"\\\\\\\",\\\\\\\"\\\", \\\"MR\\\"]\\) \
\\!\\(\\*StyleBox[\\\"\\\\\\\"Evaluate[\\\\\\\"\\\", \\\"MR\\\"]\\)\"\>", 
                    StyleBox[
                      
                      SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\
\\\"\\\", \\\"TI\\\"]\\)\"\>", "n"],
                      
                      "InlineFormula"], "\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"],\
\\\\\\\"\\\", \\\"MR\\\"]\\) \[Ellipsis] \
\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \"\>"}], 
                  RowBox[{"\<\"evaluates the argument \"\>", 
                    StyleBox[
                      
                      SubscriptBox["\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\
\\\"\\\", \\\"TI\\\"]\\)\"\>", "n"],
                      
                      "InlineFormula"], "\<\", whether or not the attributes \
of \\!\\(\\*StyleBox[\\\"\\\\\\\"f\\\\\\\"\\\", \\\"TI\\\"]\\) specify that \
it should be held \"\>"}]}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"SA.4.3", "3.2"}],

Cell["Overriding holding of arguments. ", "Caption",
  CellTags->"SA.4.3"],

Cell[TextData[{
  "By using ",
  StyleBox["Evaluate", "MR"],
  ", you can get any argument of a function evaluated immediately, even if \
the argument would usually be evaluated later under the control of the \
function.  "
}], "Text",
  CellTags->{"SA.4.3", "3.3"}],

Cell["A.4.4 Preventing Evaluation", "Subsection",
  CellTags->{"SA.4.4", "4.1"}],

Cell[TextData[{
  StyleBox["Mathematica", "TI"],
  " provides various functions which act as \[OpenCurlyDoubleQuote]wrappers\
\[CloseCurlyDoubleQuote] to prevent the expressions they contain from being \
evaluated. "
}], "Text",
  CellTags->{"SA.4.4", "4.2"}],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"Hold[\\\\\\\"\\\", \\\"MR\
\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \
\"\>", "\<\"treated as \\!\\(\\*StyleBox[\\\"\\\\\\\"Hold[\\\\\\\"\\\", \
\\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) in \
all cases \"\>"},
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"HoldComplete[\\\\\\\"\\\",\
 \\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \\\"TI\\\"]\\)\
\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \"\>", \
"\<\"treated as \\!\\(\\*StyleBox[\\\"\\\\\\\"HoldComplete[\\\\\\\"\\\", \
\\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \
with upvalues disabled \"\>"},
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"HoldForm[\\\\\\\"\\\", \\\
\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \\\"TI\\\"]\\)\\!\
\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \"\>", "\<\"treated \
as \\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \\\"TI\\\"]\\) for \
printing \"\>"},
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"HoldPattern[\\\\\\\"\\\", \
\\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \
\"\>", "\<\"treated as \\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \\\"TI\
\\\"]\\) in rules, definitions and patterns \"\>"},
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"Unevaluated[\\\\\\\"\\\", \
\\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \
\"\>", "\<\"treated as \\!\\(\\*StyleBox[\\\"\\\\\\\"expr\\\\\\\"\\\", \\\"TI\
\\\"]\\) when arguments are passed to a function \"\>"}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"SA.4.4", "4.3"}],

Cell["Wrappers that prevent expressions from being evaluated. ", "Caption",
  CellTags->"SA.4.4"],

Cell["A.4.5 Global Control of Evaluation", "Subsection",
  CellTags->{"SA.4.5", "5.1"}],

Cell["\<\
In the evaluation procedure described above, two basic kinds of \
steps are involved: \
\>", "Text",
  CellTags->{"SA.4.5", "5.2"}],

Cell["\<\
\[FilledSmallSquare] Iteration: evaluate a particular expression \
until it no longer changes.  
\[FilledSmallSquare] Recursion: evaluate subsidiary expressions needed to \
find the value of a particular expression.  \
\>", "Notes",
  CellTags->{"SA.4.5", "5.3"}],

Cell[TextData[{
  "Iteration leads to evaluation chains in which successive expressions are \
obtained by the application of various transformation rules. \n",
  StyleBox["Trace", "MR"],
  " shows evaluation chains as lists, and shows subsidiary evaluations \
corresponding to recursion in sublists. \nThe expressions associated with the \
sequence of subsidiary evaluations which lead to an expression currently \
being evaluated are given in the list returned by ",
  StyleBox["Stack[", "MR"],
  " ",
  StyleBox["]", "MR"],
  ". "
}], "Text",
  CellTags->{"SA.4.5", "5.4"}],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"$RecursionLimit\\\\\\\"\\\
\", \\\"MR\\\"]\\) \"\>", "\<\"maximum recursion depth \"\>"},
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"$IterationLimit\\\\\\\"\\\
\", \\\"MR\\\"]\\) \"\>", "\<\"maximum number of iterations \"\>"}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"SA.4.5", "5.5"}],

Cell["Global variables controlling the evaluation of expressions. ", "Caption",
  CellTags->"SA.4.5"],

Cell["A.4.6 Aborts", "Subsection",
  CellTags->{"SA.4.6", "6.1"}],

Cell[TextData[{
  "You can ask ",
  StyleBox["Mathematica", "TI"],
  " to abort at any point in a computation, either by calling the function ",
  StyleBox["Abort[", "MR"],
  " ",
  StyleBox["]", "MR"],
  ", or by typing appropriate interrupt keys. \nWhen asked to abort, ",
  StyleBox["Mathematica", "TI"],
  " will terminate the computation as quickly as possible. If the answer \
obtained would be incorrect or incomplete, then ",
  StyleBox["Mathematica", "TI"],
  " returns ",
  StyleBox["$Aborted", "MR"],
  " instead of giving that answer. \nAborts can be caught using ",
  StyleBox["CheckAbort", "MR"],
  ", and can be postponed using ",
  StyleBox["AbortProtect", "MR"],
  ". "
}], "Text",
  CellTags->{"SA.4.6", "6.2"}]
},
FrontEndVersion->"4.0 for X",
ScreenRectangle->{{0, 800}, {0, 600}},
WindowSize->{520, 455},
WindowMargins->{{140, Automatic}, {Automatic, 72}},
StyleDefinitions -> "HelpBrowser.nb"
]


(***********************************************************************
Cached data follows.  If you edit this Notebook file directly, not using
Mathematica, you must remove the line containing CacheID at the top of 
the file.  The cache data will then be recreated when you save this file 
from within Mathematica.
***********************************************************************)

(*CellTagsOutline
CellTagsIndex->{
  "SA.4.0"->{
    Cell[1717, 49, 64, 1, 70, "Section",
      CellTags->{"SA.4.0", "0.1"}]},
  "0.1"->{
    Cell[1717, 49, 64, 1, 70, "Section",
      CellTags->{"SA.4.0", "0.1"}]},
  "SA.4.1"->{
    Cell[1784, 52, 91, 1, 70, "Subsection",
      CellTags->{"SA.4.1", "1.1"}],
    Cell[1878, 55, 804, 23, 70, "Text",
      CellTags->{"SA.4.1", "1.2"}],
    Cell[2685, 80, 5011, 158, 70, "Notes",
      CellTags->{"SA.4.1", "1.3"}]},
  "1.1"->{
    Cell[1784, 52, 91, 1, 70, "Subsection",
      CellTags->{"SA.4.1", "1.1"}]},
  "1.2"->{
    Cell[1878, 55, 804, 23, 70, "Text",
      CellTags->{"SA.4.1", "1.2"}]},
  "1.3"->{
    Cell[2685, 80, 5011, 158, 70, "Notes",
      CellTags->{"SA.4.1", "1.3"}]},
  "SA.4.2"->{
    Cell[7699, 240, 99, 1, 70, "Subsection",
      CellTags->{"SA.4.2", "2.1"}],
    Cell[7801, 243, 731, 20, 70, "Text",
      CellTags->{"SA.4.2", "2.2"}],
    Cell[8535, 265, 2414, 44, 70, "Text",
      CellTags->{"SA.4.2", "2.3"}],
    Cell[10952, 311, 125, 4, 70, "Caption",
      CellTags->"SA.4.2"],
    Cell[11080, 317, 74, 1, 70, "Subsubsection",
      CellTags->{"SA.4.2", "2.4"}],
    Cell[11157, 320, 1891, 51, 70, "Text",
      CellTags->{"SA.4.2", "2.5"}],
    Cell[13051, 373, 75, 1, 70, "Subsubsection",
      CellTags->{"SA.4.2", "2.6"}],
    Cell[13129, 376, 491, 20, 70, "Text",
      CellTags->{"SA.4.2", "2.7"}],
    Cell[13623, 398, 1095, 34, 70, "Notes",
      CellTags->{"SA.4.2", "2.8"}],
    Cell[14721, 434, 699, 20, 70, "Text",
      CellTags->{"SA.4.2", "2.9"}],
    Cell[15423, 456, 68, 1, 70, "Subsubsection",
      CellTags->{"SA.4.2", "2.10"}],
    Cell[15494, 459, 131, 4, 70, "Text",
      CellTags->{"SA.4.2", "2.11"}],
    Cell[15628, 465, 335, 7, 70, "Notes",
      CellTags->{"SA.4.2", "2.12"}],
    Cell[15966, 474, 529, 14, 70, "Text",
      CellTags->{"SA.4.2", "2.13"}]},
  "2.1"->{
    Cell[7699, 240, 99, 1, 70, "Subsection",
      CellTags->{"SA.4.2", "2.1"}]},
  "2.2"->{
    Cell[7801, 243, 731, 20, 70, "Text",
      CellTags->{"SA.4.2", "2.2"}]},
  "2.3"->{
    Cell[8535, 265, 2414, 44, 70, "Text",
      CellTags->{"SA.4.2", "2.3"}]},
  "2.4"->{
    Cell[11080, 317, 74, 1, 70, "Subsubsection",
      CellTags->{"SA.4.2", "2.4"}]},
  "2.5"->{
    Cell[11157, 320, 1891, 51, 70, "Text",
      CellTags->{"SA.4.2", "2.5"}]},
  "2.6"->{
    Cell[13051, 373, 75, 1, 70, "Subsubsection",
      CellTags->{"SA.4.2", "2.6"}]},
  "2.7"->{
    Cell[13129, 376, 491, 20, 70, "Text",
      CellTags->{"SA.4.2", "2.7"}]},
  "2.8"->{
    Cell[13623, 398, 1095, 34, 70, "Notes",
      CellTags->{"SA.4.2", "2.8"}]},
  "2.9"->{
    Cell[14721, 434, 699, 20, 70, "Text",
      CellTags->{"SA.4.2", "2.9"}]},
  "2.10"->{
    Cell[15423, 456, 68, 1, 70, "Subsubsection",
      CellTags->{"SA.4.2", "2.10"}]},
  "2.11"->{
    Cell[15494, 459, 131, 4, 70, "Text",
      CellTags->{"SA.4.2", "2.11"}]},
  "2.12"->{
    Cell[15628, 465, 335, 7, 70, "Notes",
      CellTags->{"SA.4.2", "2.12"}]},
  "2.13"->{
    Cell[15966, 474, 529, 14, 70, "Text",
      CellTags->{"SA.4.2", "2.13"}]},
  "SA.4.3"->{
    Cell[16498, 490, 110, 1, 70, "Subsection",
      CellTags->{"SA.4.3", "3.1"}],
    Cell[16611, 493, 1759, 40, 70, "Text",
      CellTags->{"SA.4.3", "3.2"}],
    Cell[18373, 535, 74, 1, 70, "Caption",
      CellTags->"SA.4.3"],
    Cell[18450, 538, 266, 7, 70, "Text",
      CellTags->{"SA.4.3", "3.3"}]},
  "3.1"->{
    Cell[16498, 490, 110, 1, 70, "Subsection",
      CellTags->{"SA.4.3", "3.1"}]},
  "3.2"->{
    Cell[16611, 493, 1759, 40, 70, "Text",
      CellTags->{"SA.4.3", "3.2"}]},
  "3.3"->{
    Cell[18450, 538, 266, 7, 70, "Text",
      CellTags->{"SA.4.3", "3.3"}]},
  "SA.4.4"->{
    Cell[18719, 547, 80, 1, 70, "Subsection",
      CellTags->{"SA.4.4", "4.1"}],
    Cell[18802, 550, 259, 6, 70, "Text",
      CellTags->{"SA.4.4", "4.2"}],
    Cell[19064, 558, 2240, 38, 70, "Text",
      CellTags->{"SA.4.4", "4.3"}],
    Cell[21307, 598, 97, 1, 70, "Caption",
      CellTags->"SA.4.4"]},
  "4.1"->{
    Cell[18719, 547, 80, 1, 70, "Subsection",
      CellTags->{"SA.4.4", "4.1"}]},
  "4.2"->{
    Cell[18802, 550, 259, 6, 70, "Text",
      CellTags->{"SA.4.4", "4.2"}]},
  "4.3"->{
    Cell[19064, 558, 2240, 38, 70, "Text",
      CellTags->{"SA.4.4", "4.3"}]},
  "SA.4.5"->{
    Cell[21407, 601, 87, 1, 70, "Subsection",
      CellTags->{"SA.4.5", "5.1"}],
    Cell[21497, 604, 141, 4, 70, "Text",
      CellTags->{"SA.4.5", "5.2"}],
    Cell[21641, 610, 273, 6, 70, "Notes",
      CellTags->{"SA.4.5", "5.3"}],
    Cell[21917, 618, 575, 13, 70, "Text",
      CellTags->{"SA.4.5", "5.4"}],
    Cell[22495, 633, 574, 13, 70, "Text",
      CellTags->{"SA.4.5", "5.5"}],
    Cell[23072, 648, 101, 1, 70, "Caption",
      CellTags->"SA.4.5"]},
  "5.1"->{
    Cell[21407, 601, 87, 1, 70, "Subsection",
      CellTags->{"SA.4.5", "5.1"}]},
  "5.2"->{
    Cell[21497, 604, 141, 4, 70, "Text",
      CellTags->{"SA.4.5", "5.2"}]},
  "5.3"->{
    Cell[21641, 610, 273, 6, 70, "Notes",
      CellTags->{"SA.4.5", "5.3"}]},
  "5.4"->{
    Cell[21917, 618, 575, 13, 70, "Text",
      CellTags->{"SA.4.5", "5.4"}]},
  "5.5"->{
    Cell[22495, 633, 574, 13, 70, "Text",
      CellTags->{"SA.4.5", "5.5"}]},
  "SA.4.6"->{
    Cell[23176, 651, 65, 1, 70, "Subsection",
      CellTags->{"SA.4.6", "6.1"}],
    Cell[23244, 654, 729, 20, 70, "Text",
      CellTags->{"SA.4.6", "6.2"}]},
  "6.1"->{
    Cell[23176, 651, 65, 1, 70, "Subsection",
      CellTags->{"SA.4.6", "6.1"}]},
  "6.2"->{
    Cell[23244, 654, 729, 20, 70, "Text",
      CellTags->{"SA.4.6", "6.2"}]}
  }
*)

(*CellTagsIndex
CellTagsIndex->{
  {"SA.4.0", 24601, 693},
  {"0.1", 24690, 696},
  {"SA.4.1", 24782, 699},
  {"1.1", 25029, 706},
  {"1.2", 25121, 709},
  {"1.3", 25209, 712},
  {"SA.4.2", 25303, 715},
  {"2.1", 26429, 744},
  {"2.2", 26522, 747},
  {"2.3", 26611, 750},
  {"2.4", 26701, 753},
  {"2.5", 26798, 756},
  {"2.6", 26889, 759},
  {"2.7", 26986, 762},
  {"2.8", 27076, 765},
  {"2.9", 27168, 768},
  {"2.10", 27259, 771},
  {"2.11", 27358, 774},
  {"2.12", 27449, 777},
  {"2.13", 27541, 780},
  {"SA.4.3", 27635, 783},
  {"3.1", 27956, 792},
  {"3.2", 28051, 795},
  {"3.3", 28142, 798},
  {"SA.4.4", 28234, 801},
  {"4.1", 28554, 810},
  {"4.2", 28648, 813},
  {"4.3", 28737, 816},
  {"SA.4.5", 28831, 819},
  {"5.1", 29307, 832},
  {"5.2", 29401, 835},
  {"5.3", 29490, 838},
  {"5.4", 29580, 841},
  {"5.5", 29670, 844},
  {"SA.4.6", 29763, 847},
  {"6.1", 29935, 852},
  {"6.2", 30029, 855}
  }
*)

(*NotebookFileOutline
Notebook[{
Cell[1717, 49, 64, 1, 70, "Section",
  CellTags->{"SA.4.0", "0.1"}],
Cell[1784, 52, 91, 1, 70, "Subsection",
  CellTags->{"SA.4.1", "1.1"}],
Cell[1878, 55, 804, 23, 70, "Text",
  CellTags->{"SA.4.1", "1.2"}],
Cell[2685, 80, 5011, 158, 70, "Notes",
  CellTags->{"SA.4.1", "1.3"}],
Cell[7699, 240, 99, 1, 70, "Subsection",
  CellTags->{"SA.4.2", "2.1"}],
Cell[7801, 243, 731, 20, 70, "Text",
  CellTags->{"SA.4.2", "2.2"}],
Cell[8535, 265, 2414, 44, 70, "Text",
  CellTags->{"SA.4.2", "2.3"}],
Cell[10952, 311, 125, 4, 70, "Caption",
  CellTags->"SA.4.2"],
Cell[11080, 317, 74, 1, 70, "Subsubsection",
  CellTags->{"SA.4.2", "2.4"}],
Cell[11157, 320, 1891, 51, 70, "Text",
  CellTags->{"SA.4.2", "2.5"}],
Cell[13051, 373, 75, 1, 70, "Subsubsection",
  CellTags->{"SA.4.2", "2.6"}],
Cell[13129, 376, 491, 20, 70, "Text",
  CellTags->{"SA.4.2", "2.7"}],
Cell[13623, 398, 1095, 34, 70, "Notes",
  CellTags->{"SA.4.2", "2.8"}],
Cell[14721, 434, 699, 20, 70, "Text",
  CellTags->{"SA.4.2", "2.9"}],
Cell[15423, 456, 68, 1, 70, "Subsubsection",
  CellTags->{"SA.4.2", "2.10"}],
Cell[15494, 459, 131, 4, 70, "Text",
  CellTags->{"SA.4.2", "2.11"}],
Cell[15628, 465, 335, 7, 70, "Notes",
  CellTags->{"SA.4.2", "2.12"}],
Cell[15966, 474, 529, 14, 70, "Text",
  CellTags->{"SA.4.2", "2.13"}],
Cell[16498, 490, 110, 1, 70, "Subsection",
  CellTags->{"SA.4.3", "3.1"}],
Cell[16611, 493, 1759, 40, 70, "Text",
  CellTags->{"SA.4.3", "3.2"}],
Cell[18373, 535, 74, 1, 70, "Caption",
  CellTags->"SA.4.3"],
Cell[18450, 538, 266, 7, 70, "Text",
  CellTags->{"SA.4.3", "3.3"}],
Cell[18719, 547, 80, 1, 70, "Subsection",
  CellTags->{"SA.4.4", "4.1"}],
Cell[18802, 550, 259, 6, 70, "Text",
  CellTags->{"SA.4.4", "4.2"}],
Cell[19064, 558, 2240, 38, 70, "Text",
  CellTags->{"SA.4.4", "4.3"}],
Cell[21307, 598, 97, 1, 70, "Caption",
  CellTags->"SA.4.4"],
Cell[21407, 601, 87, 1, 70, "Subsection",
  CellTags->{"SA.4.5", "5.1"}],
Cell[21497, 604, 141, 4, 70, "Text",
  CellTags->{"SA.4.5", "5.2"}],
Cell[21641, 610, 273, 6, 70, "Notes",
  CellTags->{"SA.4.5", "5.3"}],
Cell[21917, 618, 575, 13, 70, "Text",
  CellTags->{"SA.4.5", "5.4"}],
Cell[22495, 633, 574, 13, 70, "Text",
  CellTags->{"SA.4.5", "5.5"}],
Cell[23072, 648, 101, 1, 70, "Caption",
  CellTags->"SA.4.5"],
Cell[23176, 651, 65, 1, 70, "Subsection",
  CellTags->{"SA.4.6", "6.1"}],
Cell[23244, 654, 729, 20, 70, "Text",
  CellTags->{"SA.4.6", "6.2"}]
}
]
*)




(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)

