If String is instantiated, unifies Chars with the list whose elements are the single-character atoms for the character in the string.
If Chars is instantiated, unifies String with the string composed from the single-character atoms given by the list elements.
Success:
string_chars(S,['A',b,c]). (gives S="Abc").
string_chars("abc",L). (gives L=[a,b,c]).
string_chars("abc",[a,A,c]). (gives A=b).
string_chars(S,['']). (gives S="\177").
string_chars("abc",[a|A]). (gives A=[b,c]).
Fail:
string_chars("abc",[b,c,d]).
Error:
string_chars(S,[A|[128]]). (Error 4).
string_chars(S,[1|A]). (Error 4).
string_chars('string',L). (Error 5).
string_chars(S,"list"). (Error 5).
string_chars('string',[128]). (Error 5).
string_chars(S,["B"]). (Error 5).
string_chars(S,[256]). (Error 6).