Problem solving and logical reasoning in the macaque monkey