This happens:
?- X = '[]', Y = [].
X = [], Y = [].
?- X = '[]', Y = [], Y = X.
false.
?- X = "'a'".
X = "\'a\'".
?- X = '"a"'.
X = '\"a\"'.
?-
Related: #301 .
I was wondering if it has to do with this trait.
Duplicated, closing this.
There is one important issue that your above cases reveal, and which is nowhere else filed:
?- '[]' = []. false.
Expected: true.
OK, reopening.
This is now filed separately, and also corrected, via #644.
But:
?- X = [], atom_chars(X, Cs), atom_chars(Y, Cs).
X = [], Cs = "[]", Y = [].
?- X = [], atom_chars(X, Cs), atom_chars(Y, Cs), X = Y.
false.
Very nicely spotted!
Put differently, we have:
?- A = [], atom_chars(A, "[]"), A = []. A = [].
But a generalization fails:
?- *A = [], atom_chars(A, "[]"), A = []. false.
The last commit solved this issue, closing.
Most helpful comment
Put differently, we have:
But a generalization fails: