This code is available from
(logic guile-log postpone) You may have noticed that guile log is a framework to do tree searches to meet a certain criteria and during the path in the tree create data structures that are able to undo and also redo it’s state. Most people when approaching this will sooner or later be bitten by the NP hardness of many interesting problems. The solution might then be to try intelligent guesses in which branch the gold is hiding. What one would like to do is try a set of branches, freeze the different states and at that point create some sort of index that represent the likelihood of the gold lying buried beneath. Then an overall global decision can be taken and only the most promising paths will be further examined. It is for this use case the following system is constructed. Postpone mix well with the rest of prolog, but especially the
<zip>, forms might behave unexpectedly due to teh postpone mechansim interfering with the synch and produce bad result.
G.L. (postpone val power) G.L. (postpone-frame limit fact maxsize)
To be able to postpone we must have a baseline from which we will base our restarts e.g.
postpone command will basically evaluate
val and postpone if it’s larger then a certain limit that is governed by an initial value
fact - a factor that adds to the limit each postpone turn. The
power is the sorting index used to manage a list of possible restarts for and this list is sorted so that we at restarts will try to use
maxsize first elements of the list. The list is never larger then
10 * maxsize.
Make sure to use positive values for the
power, value. If all postponing functions leave a negative value, then
postpone-frame will fail. This is useful in tabling where this teqnicque is used to produce all possible solutions (recursive application as well) for a given input until a fixpoint with no more new solutions are reached.