REDUCE

19.5 Tracing Active Rules: TRRL, UNTRRL

The command trrl initiates tracing when they fire of individual rules or rule lists that have been activated using let.

trrl <rl1>, <rl2>, ..., <rln>;

where each of the \(<rl_i>\) is:

The specified rules are (re-) activated in REDUCE such that each of them prints a report every time it fires. The report is composed of the name of the rule or the name of the rule list together with the number of the rule in the list, the form matching the left side (“input”) and the resulting right side (“output”). For an explicitly given rule or rule list, trrl assigns a unique generated name.

Note, however, that trrl does not trace rules with constant expressions on the left, on the assumption that they are not particularly interesting. [This behaviour may be made user-controllable in a future version.]

The command untrrl removes the tracing from rules:

untrrl <rl1>, <rl2>, ..., <rln>;

where each of the \(<rl_i>\) is:

The rules are reactivated in their original form. Alternatively you can use the command clearrules to remove the rules totally from the system. Please do not modify the rules between trrl and untrrl – the result may be unpredictable.

Here are two simple examples that show tracing via the rule name and via the operator name:

trigrules := {sin(~x)^2 => 1 - cos(x)^2};

                     2              2
trigrules := {sin(~x)  => 1 - cos(x) }

let trigrules;
trrl trigrules;

1 - sin(x)^2;

Rule trigrules.1: sin(x)**2 => 1 - cos(x)**2$

      2
cos(x)

untrrl trigrules;
trrl sin;

1 - sin(x)^2;

Rule sin.23: sin(x)**2 => 1 - cos(x)**2$

      2
cos(x)

untrrl sin;
clearrules trigrules;


Hosted by Download REDUCE Powered by MathJax