The function of dreams, according to Freud's theory, is primarily to codify the expression of the underlying illicit thoughts. The outward content, i.e. the manifest content, of a dream might be a dream where the person is flying. Under the appropriate analysis, this manifest content might be interpreted as being a way of revealing, say, intense sexual longing or desire, which the dreamer is unwilling to admit consciously. The notion is that the activity in the brain during dreaming helps maintain neural pathways. Some of the evidence supporting this hypothesis is derived from sleep deprivation studies.
People deprived of REM sleep develop memory disorders.
For instance, subjects are taught some material in the afternoon. The next day the subjects who were deprived of REM sleep have great trouble remembering what they were taught the day before compared to subjects who got uninterrupted sleep. In this instance, the consolidation of knowledge, i.e. the maintenance of neural pathways supporting new knowledge, is hypothesized to be interrupted when REM sleep is interrupted. The hypothesis of dreams involving maintenance of neural pathways such as those involved with consolidation of new knowledge suggests that dreams are cognitively restrained. For instance, they are frequently constrained by events from the previous day or events in our environment.