For enhanced control BinProlog 5.75 implements a form of ancestor cut,based on the following 3 built-ins:
get_neck_cut/1: gets the address of a choice point (to be use before the first not-inlined goal) get_deep_cut/1: gets the address of a choice point (to be use after the first not-inlined goal) cut_to/1: cuts to a given choice-point untrail_to/1: removes bindings up to a given choice-point
Together with continuation manipulation and linear assumptions, the use of these built-ins allows a source-level implementation of catch and throw.
Another example of use, committing to the current resolution branch and cutting off all the alternatives up to toplevel, is written simply as:
commit :- assumed(catchmarker('$commit',Do,Choice,_)), cut_to(Choice), Do.