An simple example of of outputting a clpBNR interval variable with format/2
:
?- {X>=1}, format('interval(~w)',X).
interval(_2428{real(1,1.0Inf)})
X::real(1, 1.0Inf).
If I run the same example on a local pengine using a test predicate local_query/1
, the received output
message doesn’t contain the attribute:
?- local_query(({X>=1}, format('interval(~w)',X))).
interval(_13136)
> {_4996{real(1,1.0Inf)}>=1},format('interval(~w)',_4996{real(1,1.0Inf)}).
true.
(The content of the output line with the >
prefix is from the success
response, a copy of the query.)
freeze
has a similar behaviour (reproducible on SWISH):
?- freeze(X,X>=1), format('frozen(~w)',X).
frozen(_7708{freeze(_7708, user:(_7708>=1))})
freeze(X, X>=1).
?- local_query((freeze(X,X>=1), format('frozen(~w)',X))).
frozen(_1688)
> freeze(_9884{freeze(_9884, 'feaf0cef-3307-4650-a59a-de9f8f254df0':(_9884>=1))},_9884{freeze(_9884, 'feaf0cef-3307-4650-a59a-de9f8f254df0':(_9884>=1))}>=1),format('frozen(~w)',_9884{freeze(_9884, 'feaf0cef-3307-4650-a59a-de9f8f254df0':(_9884>=1))}).
true.
Bug or feature? Any workaround?