Writes Clause to the current output stream. Used by
The operation used by
Clause is written to the current output stream in exactly the
format in which
listing/1 would have written it, including a terminating
If you want to print a clause, this is almost certainly the
command you want. By design, none of the other term output
commands puts a full-stop after the written term.
If you are writing a file of facts to be loaded by
the Load Predicates, use
portray_clause/1, which attempts
to ensure that the clauses it writes out can be read in again as clauses.
The output format used by
been carefully designed to be clear. We recommend that you use a
similar style. In particular, never put a semicolon
(disjunction symbol) at the end of a line in Prolog.
Always succeeds without error.
| ?- portray_clause((X:- a -> b ; c)). A :- ( a -> b ; c ). X = _3185
| ?- portray_clause((X:- a -> (b -> c ; d ; e); f)). A :- ( a -> ( b -> c ; d ; e ) ; f ). X = _3295
| ?- portray_clause((a:-b)). a :- b. yes
| ?- portray_clause((a:-b,c)). a :- b, c. yes
| ?- portray_clause((a:-(b,!,c))). a :- b, !, c. yes