Artificial intelligence and cognitive psychology: How to solve mathematical problems