The function returns TRUE
if successful and FALSE
otherwise. Currently, FALSE
is returned when an attempt is
made to call PL_cleanup()
recursively or if one of the exit handlers cancels the termination using cancel_halt/1.
Exit handlers may only cancel termination if status is 0.
In theory, this function allows deleting and restarting the Prolog system in the same process. In practice, SWI-Prolog's cleanup process is far from complete, and trying to revive the system using PL_initialise() will leak memory in the best case. It can also crash the application.
In this state, there is little practical use for this function. If you want to use Prolog temporarily, consider running it in a separate process. If you want to be able to reset Prolog, your options are (again) a separate process, modules or threads.