I have a list of terms,
[g(_G543),g(_G548),g(_G553),g(_G558),g(_G558),g(_G553),g(_G548),g(_G543)]
How can I make it to
[_G543,_G548,_G553,_G558,_G558,_G553,_G548,_G543]
only left the variables.
I was trying
replace([],[]).
replace([g(X)|T1],[X|T2]):-
replace(T1,T2).
but it just returned a false, what should I do? Thanks