IF Computer > MINERVA > Manual > Reference > Predicates > Clause retrieval and information > clause/2

clause/2

MINERVA
ifcomputer logo
f
Expert Services on the Web

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.

document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/clause_retrieve/clause/print_de.html
published 2008/12/1 update 2002/3/19 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
Back> managed with ubiCMS