I need to get the first element of pairs however I don't know the type and it's giving me _20668 instead of C. I know it's because it's not a String but how do I convert it into a String to get a C (I can't change the input).
test([]).
test([Index-X|T]) :-
test(T),
get_pairs_value(X),
write('Index : '), write(Index), nl.
?- test([C-['Al'-2,'O'-3]]).
I tried atom_string() but it gives me _20668.