This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Debugging  /
TraceAbove

  • TraceAbove is an option for Trace and related functions which specifies whether to include evaluation chains which contain the evaluation chain containing the pattern form sought.
  • TraceAbove -> True includes the first and last expressions in all evaluation chains within which the evaluation chain containing form occurs.
  • TraceAbove -> All includes all expressions in these evaluation chains.
  • TraceAbove -> backward , forward allows you to specify separately which expressions to include in the backward and forward directions.
  • Using TraceAbove, you can see the complete paths by which expressions matching form arose during an evaluation.
  • See the Mathematica book: Section 2.5.10.
  • See also: StackComplete.

    Further Examples

    Here is the recursive definition of the Fibonacci numbers.

    In[1]:=

    Here are the end conditions for the recursion.

    In[2]:=

    Out[2]=

    This shows all the ways that fib[2] is generated during the evaluation of fib[5].

    In[3]:=

    Out[3]=