Bright and dark soliton solutions of the (3 + 1)-dimensional generalized Kadomtsev–Petviashvili equation and generalized Benjamin equation