Artificial-intelligence systems have made remarkable progress in recent years, but they still struggle with the kind of flexible, relational reasoning that comes naturally to humans. Program ...