?- sum_list(1, N).
existence_error(matching_rule, sum_list(1, 0, _A)).
?- sum_list(L, N).
existence_error(matching_rule, sum_list(_A, 0, _B)).
And then when adding the suggested catchall rule, both fail. Both. This throws us back by almost half a century. So now DEC10-style
errors get into the 21st century. Prolog 0 and Prolog I were better. ?- sum_list(1, N).
false.
?- sum_list(L, N).
false, unexpected.
> "steadfastness", that you also mentioned, and that is a new term for me ?- run_length_encoding(L,E).
L = [], E = []-0, unexpected
; ... .
While the most general query often leads to an unfair enumeration of answers/solutions, it is still a useful and effortless way to test a program, just in case.