Mathematical models of the mind