You can set breakpoints in Sweep Prolog mode buffers to have SWI-Prolog break before specific goals in the code (see Breakpoints in the SWI-Prolog manual).
Whether to highlight breakpoints in Sweep Prolog mode buffers.
sweeprolog-set-breakpoint, bound to C-c C-b,
sets a breakpoint at the position of the cursor. If you call it with
a positive prefix argument (for example, C-u C-c C-b), it
creates a conditional breakpoint with a condition goal that you insert
in the minibuffer. If you call it with a non-positive prefix argument
(for example, C-0 C-c C-b), it deletes the breakpoint at point
When Context Menu mode is enabled, you can also create and delete
sweeprolog-mode buffers through right-click
context menus (see Context Menu).
By default, Sweep highlights terms with active breakpoints in Sweep
Prolog mode buffers. To inhibit breakpoint highlighting, customize
the user option