Trace mode is the main Prolog command line debugger that allows for tracing the transitions through the resolution states of predicates represented by ports in the "Byrd Box Model" and optionally pausing for a command when certain ports are hit.
It can be turned on manually via trace/0, or (when put into debug mode using debug/0) when a specific predicate is encountered via spy/1, or when a specific call to a predicate is encountered via set_breakpoint/4 or set_breakpoint/5.
When in trace mode, visible/1 controls which ports are written to the console, and leash/1 controls which ports cause execution to pause to allow program inspection.
When execution is paused, there are many commands that can be used to inspect the state of the program, cause goals to fail or succeed, etc.
Trace mode is turned off via notrace/0 and debug mode is turned off via nodebug/0.