Basic list operations in Prolog.