This may help explain the bizarre and hyperassociative character of REM dreams in which the brain seems to choose less obvious over more obvious associations, as if episodic memory is temporarily shut down. This, in turn, could prevent the integration of the traumatic event into semantic memory storage. Whatever the function of dreaming is, it doesn't require us to remember. The underlying process still gets carried out. Rather, sleep provides a preferred time.
Sleep is a privileged time that guarantees an optimum period for memory consolidation.