Subject: Re: [SWIPL] another question

From: "Richard A. O'Keefe" <[email-masked]>
Date: Fri, 1 Jun 2001 12:35:52 +1200 (NZST)

Partsakoulakis Ioannis <[email-masked]> wrote:
	I want to ask how can I define a predicate
	a(+Term,+ListOfTerms,-ListOfInstances) such that if term Term is unifiable
	with a term in ListOfTemrs then ListOfInstances will contain the
	correspinding instance of Term.

The obvious way is to use findall/3:

    a(Term, Terms, Instances) :-
        findall(Term, member(Term,Terms), Instances).