From ok@atlas.otago.ac.nz Fri Jun  1 02:36:00 2001
Received: from atlas.otago.ac.nz (atlas.otago.ac.nz [139.80.32.250])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f510Zw315851
	for <prolog@swi.psy.uva.nl>; Fri, 1 Jun 2001 02:35:59 +0200 (MET DST)
Received: (from ok@localhost)
	by atlas.otago.ac.nz (8.9.3/8.9.3) id MAA491667;
	Fri, 1 Jun 2001 12:35:52 +1200 (NZST)
Date: Fri, 1 Jun 2001 12:35:52 +1200 (NZST)
From: "Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
Message-Id: <200106010035.MAA491667@atlas.otago.ac.nz>
To: jpar@aegean.gr, prolog@swi.psy.uva.nl
Subject: Re:  [SWIPL] another question

Partsakoulakis Ioannis <jpar@aegean.gr> 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).

