%% append/3 — list concatenation, classic Prolog %% Two clauses: empty-prefix base case + recursive cons-prefix. %% Bidirectional — works in all modes: build, check, split. append([], L, L). append([H|T], L, [H|R]) :- append(T, L, R).