A Bayesian brain model of adaptive behavior: an application to the Wisconsin Card Sorting Task