I was solving the second part of the second day of Advent of code problem with Prolog. They ask me to do some kind of validation, with the following verbiage: