I have this fact in my base fact("name","surname","123"). if i simply write this question: fact(X,_,_). For X I get some unidentified output. How can I retrieve any of this values, or how to get this output? ?-fact(X,_,_). output: name.
Thanks ahead.
try this,
Strings in Prolog are enclosed within single quotes. When you use double quotes it means that you want the list of character codes.
In SWI-Prolog you can use
string_to_atom/2
: