From flin@cs.ust.hk Thu Feb  1 11:16:55 2001
Received: from cssvr17.cs.ust.hk (cssvr17.cs.ust.hk [143.89.41.167])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f11AGqZ09745
	for <prolog@swi.psy.uva.nl>; Thu, 1 Feb 2001 11:16:53 +0100 (MET)
Received: (from root@localhost)
	by cssvr17.cs.ust.hk (8.11.2/8.11.2) id f11AGio29124
	for prolog@swi.psy.uva.nl; Thu, 1 Feb 2001 18:16:44 +0800 (HKT)
Received: from cs.ust.hk (flin@cssu67.cs.ust.hk [143.89.40.67])
	by cssvr17.cs.ust.hk (8.11.2/8.11.2) with ESMTP id f11AGh329116
	for <prolog@swi.psy.uva.nl>; Thu, 1 Feb 2001 18:16:43 +0800 (HKT)
Sender: flin@cs.ust.hk
Message-ID: <3A79378A.D4F89245@cs.ust.hk>
Date: Thu, 01 Feb 2001 18:16:42 +0800
From: Fangzhen Lin <flin@cs.ust.hk>
X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.6 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
To: prolog@swi.psy.uva.nl
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 7bit
Subject: [SWIPL] lifting constants in a clause

Hi. Any idea on what is the best way in SWI-Prolog to change all the
constants that begin with, say 'x' in a clause to variables?

For instance, from the clause:
f(x1,a,x2) :- g(x1), k([a,x2]).
I want to get the following one:
f(X1,a,X2) :- g(X1), k([a,X2]).
or
f(_x1, a, _x2) :- g(_x1), k([a,_x2]).

Thanks,

-Fangzhen Lin



