Subject: [SWIPL] lifting constants in a clause

From: Fangzhen Lin <[email-masked]>
Date: Thu, 01 Feb 2001 18:16:42 +0800

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