Crash when labelling

Hi there, just found probably a bug in labeling/2. The following can recreate it:

test :-

    A = [_],

    A ins 0..1,

    when(ground(A), A mod 1 #= _),

    labeling([enum], A).

The expected outcome should be an Error message, but this produces a crash.

It only occurs when the option [enum] is used in labeling/2 – other options are fine.

Any insights? Thanks a lot :slight_smile:

Its a bug :slight_smile: . Any crash is, unless it is caused by user supplied foreign code. I see what is going wrong, but fixing it needs a proper machine. Probably somewhere coming week …

Fixed with commit 03f4975ed6dadd456b2e3811177105dc41855132. The issue is with non-deterministic foreign predicates that unify an attributed variable where running the attribute hooks triggers an exception.

That’s upmost efficiency :rocket:
Thank you so much Jan!