Subject: [Fwd: Non-redundant wrappers?]

From: Paul Singleton <[email-masked]>
Date: Wed, 17 May 2000 23:33:34 +0100

Ulrich Neumerkel wrote:

> Paul Singleton <[email-masked]> wrote:

> ...
> >It would seem to require something like Quintus' "trail hook" to clean up
> >the (again, seemingly) unavoidable global state (asserted or recorded),
> ...

> This can be realized with call_cleanup/2, a built-in in SICStus Prolog.
> The goal call_cleanup(Goal, Cleanup) will call Cleanup (which should be
> determinate) when the execution of Goal is "finished".  I.e., on
> failure, exception, determinate success of Goal but also when cutting choices
> of Goal (!).  So Cleanup can delete the temporary database required to
> detect redundant solutions.

This is the first I've heard of call_cleanup/2, but it sounds nicer than the
"trail hook", which would only call a foreign function; whichever, something
like this would be of value to me in my efforts to interface Prolog to the
Real World in as Prolog-like a way as possible, e.g. backtracking through the
tuples of a RDBMS query's result relation without having to cache all of them
in the database first, yet being able to cut the goal without leaving a
"cursor" (or other foreign state) dangling.

Unless there's an existing way of achieving this, I'd vote for this sort of
development of SWI-Prolog in preference to unspecified performance improvements
as recently suggested.

Paul Singleton