js-slang icon indicating copy to clipboard operation
js-slang copied to clipboard

Tracer: Stepper Produces Long, Hard-to-Read Trace for Higher-Order Recursion Function

Open CATISNOTSODIUM opened this issue 5 months ago • 0 comments

Consider this following snippet:

function h(f, x) {
    function h(g, x) {
        return x <= 1 ? 1 : 3 * g(f, x - 1);
    }
    return x <= 1 ? 1 : 2 * f(h, x - 1);
}
h(h, 5);
Image

The reasonable explanation for this step should be 1 <= 1 ? 1 : 2 * h(h, 1 - 1)) returned.

CATISNOTSODIUM avatar Aug 06 '25 02:08 CATISNOTSODIUM