Codes while reading "The Art of Prolog"