Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Trace

Usage

Trace[expr] generates a list of all expressions used in the evaluation of expr.
Trace[expr, form] includes only those expressions which match form.
Trace[expr, s] includes all evaluations which use transformation rules associated with the symbol s.


Notes

• In general, form in Trace[expr, form] is compared both with each complete expression that is evaluated, and with the tag associated with any transformation rule used in the evaluation.
Trace[expr, lhs -> rhs] picks out expressions which match lhs, then replaces them with rhs in the list returned.
• All expressions in the list returned by Trace are wrapped in HoldForm.
Trace returns a set of nested lists. Each individual list corresponds to a single evaluation chain, which contains the sequence of forms found for a particular expression. The list has sublists which give the histories of subsidiary evaluations.
• Example: Trace[2 3 + 4]LongRightArrow .
• The following options can be given:
MatchLocalNames True whether to allow x to stand for x$nnn
TraceAbove False whether to show evaluation chains which contain the chain containing form
TraceBackward False whether to show expressions preceding form in the evaluation chain
TraceDepth Infinity how many levels of nested evaluations to include
TraceForward False whether to show expressions following form in the evaluation chain
TraceOff None forms within which to switch off tracing
TraceOn _ forms within which to switch on tracing
TraceOriginal False whether to look at expressions before their heads and arguments are evaluated
• During the execution of Trace, the settings for the form argument, and for the options TraceOn and TraceOff, can be modified by resetting the values of the global variables $TracePattern, $TraceOn and $TraceOff, respectively.
• New in Version 2.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: