Atomic formula append(A, B, C ) says that C = A ++ B. Goal append(Y, Y, X ) says that X = Y ++ Y, which is just what we want. So

  double(X) :- append(Y, Y, X).