Predicates to delay the execution of the (exit) port of a goal and capture the OS standard output/error streams (stdout,stderr).
Usage:io_once_port_reify(Goal,Port,OutString)
Executes Goal, Port is the state when the predicate finishes (true, fail). Its stdout is stored in OutString.
Usage:io_once_port_reify(Goal,Port,OutString,ErrString)
Executes Goal, Port is the state when the predicate finishes (true, fail). Its stdout and stderr are stored in OutString and ErrString respectively.
Usage:call_with_std_redirect(Goal,OutChn,ErrChn)
Executes (a possibly non-deterministic) Goal with stdout and stderr redirection. If needed, redirections are reinstalled on backtracking.