Challenge 1: myLength/2 Over a Five-Element List — Possible Solution ==================================================================== list_utils.pl: myLength([], 0). myLength([_|T], N) :- myLength(T, N1), N is N1 + 1. Query: ?- myLength([a, b, c, d, e], N). N = 5. Explanation: myLength recurses down the list one element at a time -- each recursive call strips off one head (discarded via the anonymous variable _, since the actual value of each element is irrelevant to computing a length) and asks for the length of the remaining tail. The base case, myLength([], 0), finally fires once the list is fully consumed, reporting 0. Each recursive call then adds 1 to the result coming back from its own inner call, so the final N accumulates to 5 by the time the outermost call returns -- five elements, five increments plus the base case's own 0. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses the chapter's own myLength/2 definition exactly as written, querying it against a genuine five-element list to confirm the recursive relation correctly reports the real length.