gets backtrack point
getbacktrack(BTP)
getbacktrack(BackTrackPoint) (i)
integer(BackTrackPoint) (i) A value to be passed to cutbacktrack.
Together with
cutbacktrack()
() this predicate
may be used to effect backtracking. Its effect is, that when backtracking takes place back to the
cutbacktrack() goal, the execution flow takes a short-cut back to the position where the
associated getbacktrack() goal was done.
Instead of using getbacktrack() and cutbacktrack() you may also use
set_cut
() and
cut
() to
achieve the same purpose. set_cut()/cut() are more comfortable in a way that you may use virtual
handle, but they work sufficiently slower.
repeat, getbacktrack(BTP), for(1,5,X), write(X), X = 3, cutbacktrack(BTP), fail.
This will cause the following output:
123123123 ...
A runtime error occurs if BackTrackPoint is bound. However, misuse may crash the system.
prolog-process, client-server, object
! , set_cut , cut , cutbacktrack