is the empty list;
[a, 2+2, ]is the list containing the three elements
[Head | Tail]is the list whose first element is
Headand whose tail (list of remaining elements) is
[a, X, c | Tail]is the list whose first three elements are
c, and whose remaining elements are given by the list
Tail. Only one term may follow the ``
[a | X, Y]and
[a | X | Y]are syntactic nonsense.
Unification can be performed on lists:
[a, b, c] = [Head | Tail]. /* a = Head, [b, c] = Tail. */
[a, b] = [A, B | T]. /* a = A, b = B,  = Tail. */
[a, B | C] = [X | Y]. /* a = X, [B | C] = Y. */
= [Head | Tail].
Two useful predicates are
member/2, which succeeds when
its first argument is a member of the list that is its second
append/3, which is true when the third
argument is the list formed by appending the first two lists.
Neither is predefined. Definitions are:
member(A, [A | _]).
member(A, [_ | B]) :- member(A, B).
append([A | B], C, [A | D]) :- append(B, C, D).
append(, A, A).
=..'', pronounced ``univ,'' succeeds when
its left argument is a structure and its right argument is the
corresponding list [Functor | Args].
mother(M, bill) =.. [mother, M, bill].
A double-quoted character string is syntactic sugar for a list of the ASCII codes for those characters.
"abc" = [97,98,99].
name/2 succeeds if its first argument is
the atom formed from the string that is its second argument.