| searches clauses in the database of the public user-defines procedures.
clause(?Head, ?Body)
clause/2 searches in the database of the public user-defined
predicates for clauses with a head which is unifiable with Head.
By backtracking Head gets unified with the head of a clause and
Body gets unified with its body.
Arguments
Head atom or compound term
Body term
Examples
Assume there exists a database with the following user-defined predicates:
language(english).
language(X) :- translate(X,Y), language(Y).
translate(english, japanese).
| clause(language(A),Body). |
Succeeds with substitution A <- english and Body <- true.
When backtracking it succeeds a second time with substitution A < V1
and Body <- (translate(V1,V2), language(V2)). |
Standard
This predicate is part of the ISO-Prolog Standard.
|