Code for the exercises of the book 'Learn Prolog Now'