<p>To help the human-readable meaning, you could add an extra predicate documenting the parameters as readable name/value pairs:</p>

<pre><code>entry_ancestor_of(ancestor=P, descendent=C) :-
    ancestor(P,C).

?- entry_ancestor_of(ancestor=richard, descendent=C).
C = adam .
</code></pre>

<p>Above, the suffix *ancestor_of* suggests param 1 is ancestor of param 2, so naming the predicate carefully can make it clearer.</p>

<p>Usually(convention), input parameters are the earlier parameters, and output parameters are later parameters, but where the predicate 'works both ways', ie. either could be input or output, this rule can't hold.  This is the case for your predicate:</p>

<pre><code>?- entry_ancestor_of(ancestor=X, descendent=adam).
X = richard .
</code></pre>

<p>Either parameter could be input or output, so there is no need to codify/explain them as such, although you might want to comment that it works both ways. </p>

<p>I would usually comment these 'flexible' predicates by putting an example of both of the above usages in a comment next to the predicate.</p>

<p>For entrypoint labelling, just do one or more of the following:</p>

<ul>
<li>explicitly name the predicate as an entrypoint, as above</li>
<li>document using comments in the code which are the entrypoints</li>
<li>arrange the entrypoints in the same physical section with a comment
block saying that the predicates below are entrypoints.</li>
</ul>

<p><strong>Edit: Extra things re: coding guidelines / other answers.</strong></p>

<ol>
<li>In <a href="http://arxiv.org/abs/0911.2899" rel="nofollow">Coding guidelines for Prolog</a>, section 3.8, it says 'For example, mother_of(A, B) is ambiguous;', so I gave bad advice on that.. perhaps acapelli's suggestion would be more useful on that.</li>
</ol>

<p>In that document, also have a look at:</p>

<ul>
<li>3.5 Choose sensible names for auxiliary predicates</li>
<li>3.8 Choose predicate names to help show the argument order</li>
<li>3.13 Decide whether predicate names should carry the types on which they operate</li>
<li>4.1 Begin every predicate (except perhaps auxiliary predicates) with an introductory comment in a well-defined format</li>
</ul>

<p>The '?' system for identifying parameter types that will ness mentioned is on page 21.</p>
Is there a way to annotate the parameter and return value in Prolog?
<pre><code>parent(mel, joan).
parent(jane, betty).
parent(jane, tom).
parent(richard, adam).
parent(richard, rosa).
parent(joan, fran).
</code></pre>

<p>For example someone asks me to find all ancestors of a parent. I give him the code:</p>

<pre><code>ancestor(P,C) :- parent(P, C).
ancestor(P,C) :- ancestor(P,P1), parent(P1, C).
</code></pre>

<p>But my friend still doesn't know how to use the predicate. Does he call it like</p>

<p><code>ancestor(richard, C)</code> or <code>ancestor(C, richard)</code> ?</p>

<p>Is there a way to annotate that <code>P</code> is the parameter while <code>C</code> is the return value? And in a complex case, there will be predicates with different names, how should my user know which predicate is the final predicate he wants to use?</p>