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

Infinite loop detector: Cycle detection may have errors

Open JoeyChenSmart opened this issue 3 years ago • 0 comments

Currently the cycle detection equality check uses stringify, which cannot differentiate between arrays which have the same values but different references.

e.g. in

const xs = pair(1, 1);
const ys = pair(xs, xs);

const ys_alt = pair(pair(1, 1), pair(1, 1));

it will treat ys and ys_alt as equal, which might lead to some false positives.

JoeyChenSmart avatar Jul 26 '21 09:07 JoeyChenSmart