TraceBackward

TraceBackward
is an option for Trace and related functions which specifies whether to include preceding expressions on the evaluation chain that contains the pattern form sought.

DetailsDetails

  • TraceBackward->True includes the first expression on the evaluation chain that contains form.
  • TraceBackward->All includes all expressions before form on the evaluation chain that contains form.
  • TraceBackward allows you to see the previous forms that an expression had during an evaluation.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

A recursive definition for finding Fibonacci numbers:

In[1]:=
Click for copyable input

Show only what additions of positive integers are required:

In[2]:=
Click for copyable input
Out[2]=

Show the beginning of the evaluation chain that leads to each addition:

In[3]:=
Click for copyable input
Out[3]=

Show all intermediate evaluations that led to each addition:

In[4]:=
Click for copyable input
Out[4]=
New in 2
New to Mathematica? Find your learning path »
Have a question? Ask support »