Freud believed the purpose of dreams is to

consolidate memories and new learning.
sort through possible solutions to everyday problems.
fulfill wishes.
discard unnecessary information.
reconcile urges.

fulfill underlying wishes.

However, Freud's concept never did explain those dreams I had reliving Vietnam horrors.