Psychological traumas are thought to be present in a wide range of conditions, including post-traumatic stress disorder, disorganised attachment, personality disorders, dissociative identity disorder and psychosis. This work presents a new psychotherapy for psychological traumas, based on a functional model of the mind, built with elements borrowed from the fields of computer science, artificial intelligence and neural networks. The model revolves around the concept of hierarchical value and explains the emergence of dissociation and splitting in response to emotional pain. The key intuition is that traumas are caused by too strong negative emotions, which are in turn made possible by a low-value self, which is in turn determined by low-value self-associated ideas. The therapeutic method compiles a list of patient's traumas, identifies for each trauma a list of low-value self-associated ideas, and provides for each idea a list of counterexamples, to raise the self value and solve the trauma. Since the psychotherapy proposed has not been clinically tested, statements on its effectiveness are premature. However, since the conceptual basis is solid and traumas are hypothesised to be present in many psychological disorders, the potential gain may be substantial.