When reading Prolog clauses from one file, and then writing to the current output, the latter part can be done using writeclause/1. This is because the clauses are terminated by a period and a newline, which are not retained by Prolog. writeclause/1 replaces these, and flushes the output.
writeclause/1,2 knows about the special meaning of ,/2, ;/2, ->/2, fg, -->/2 and :-/2 and prints the clause with the appropriate indentation of subgoals and some (redundant) parentheses to show the clause structure. Everything else is written as with writeq/1,2, so output of writeclause/1,2 is readable for read/1,2.
Equivalent to writeclause(output, Term). (see writeclause/2 for details).