Is there a way so that portray_clause is written to a variable instead of standard output?
?- portray_clause(f(x):app(X, Y, Z)).
f(x):app(_, _, _).
true.
?- portray_clause(Output, f(x):-app(X, Y, Z)).
ERROR: Arguments are not sufficiently instantiated
Thank you in advance