ref: 58e0109ee9ed3aa6ac2e6b0ed621820118a3d1de
dir: /lists.pl/
:- module(lists, []). % List predicates length([], 0). length([_|Tail], Length) :- length(Tail, Length0), Length is Length0 + 1. append([], Ys, Ys). append([X|Xs], Ys, [X|Rest]) :- append(Xs, Ys, Rest).