Several theories in cognitive social psychology emphasize the tendency of people to strive for consistency among their various beliefs and attitudes. We proposed that such strivings for consistency can be understood in terms of constraint satisfaction. Constraint-satisfaction neural networks attempt to satisfy as many constraints as possible as well as possible. We applied such networks to all of the major paradigms of cognitive dissonance theory, finding that our network model explained and predicted phenomena that classical dissonance theory did not. Here is an example from the free-choice paradigm, in which evaluation of the chosen object increases, but more so in a difficult choice between less desirable items. Evaluation of a rejected object decreases, but more so with a difficult choice between highly desirable items. In contrast, classical dissonance theory only predicts more separation following difficult than following easy choices.