I'm writing a Prolog predicate that retuns a list of variables. Right now the list of variables are _ (underscored) variables, for example:
Xs = [_2654, _2690],
.
.
.
And I would like to label these variables with an increasing index, for example:
Xs = [X1, X2],
.
.
.
Is there any trick to label these variables?
Edit: So it is probably not easy to do and probably not necessary, but because some of the commenters wanted more info, I was implementing a logic addition circuit, which is composed of full adders.
full_adder(X, Y, Cin, Z, Cout)
and wanted meaningful variable names like:
?- addition_circuit(2, Xs, Ys, Zs, Fs).
Xs = [X1, X2],
Ys = [Y1, Y2],
Zs = [Z1, Z2, Z3],
Fs = [ full_adder(X1, Y1, 0, Z1, C2),
full_adder(X2, Y2, C2, Z2, Z3)
]
Thanks for the help. I'll stick with the underscored variables for now.