Re: findall with limited solution count



Jan Wielemaker wrote:
> Nice! B.t.w. SWI-Prolog offers change_arg/3 as nb_setarg/3. It shouldn't
> be exposed to much to the normal Prolog programmer, but I find it an
> increasingly handy building tool for things that simply _need_ to
> survive backtracking and where assert is the only traditional way to
> realise your goals. Mostly because it avoids all the pain to make code
> reentrant, cleanup after exceptions and thread-safe that is associated
> using permanent shared resources such as dynamic predicates.
>
> GNU-Prolog also offers somethings similar.

In ECLiPSe, rather than clobbering standard Prolog stuctures
in that way, we use anonymous objects called shelves, see

http://eclipse.crosscoreop.com/eclipse/doc/bips/kernel/arrays/shelf_create-2.html


--
Joachim Schimpf /
ECLiPSe Team / http://eclipse.crosscoreop.com
CrossCore Optimization / mailto:j.schimpf@xxxxxxxxxxxxxxx
.