- run_nb_ref(+Goal:pred) is det
- Runs Goal in a delimited context supporting nbref_new/2 for allocating
a fresh name for a nonbacktrackable mutable variable.
- nbref_new(+V:A, -R:nbref(A)) is det
- Create a new nb_ variable initialised with value V. Must be run in the
context of run_nb_ref/1.
- with_nbref(-E:nbenv, +Goal:pred) is det
- Runs Goal. While Goal is active, E is bound to a value which can be used
with nbref_new/3 to allocate a fresh name for a nonbacktrackable mutable
variable. E remains bound after final exit, but should not be used.
- nbref_new(+E:nbenv, +V:A, -R:nbref(A)) is det
- nbref_app(+R:ref(A), +P:pred(+A,-A)) is det
- nbref_get(+R:ref(A), -V:A) is det
- nbref_add_with(+R:ref(A), +P:pred(+B,+A,-A), +X:B) is det
- Helper for more efficient updating of non-backtrackable mutable data
structures. X is copied using duplicate_term/2, and P is expected to
insert it into the data structure without trailing any more data, such
that the variable can be updated using nb_linkval/2 instead of
nb_setval/2 (which would copy the whole data structure).