Intelligent behavior in animals and robots