I find that SWI-Prolog has a frozen/2 predicate. It allows to query freezed variables:
?- freeze(X,X=1), frozen(X,R).
R = freeze(X, user:(X=1))
Is there some analogue for when/2. frozen/2 doesn’t show anything:
?- when((nonvar(Y);nonvar(Z)), let(X, Y+Z)), frozen(X,R).
R = true