Mechanisms of animal discrimination learning