This article presents two mathematical models for studying brain functions in memory reconstruction, forgetfulness, and some types of brain malfunctioning such as Alzheimer disease and Schizophrenia. Based on these models, a mechanism is suggested that can explain dreams. Using these two models, the interaction between emotions and cognition, as suggested by Piaget (1972), as well as, issues like consciousness and unconsciousness are described.