prolog assignment for programming course