Files
rose-ash/lib/prolog/tests/programs/append.pl
giles ffc3716b0e
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
prolog: append.pl + append.sx classic, 6 tests (build/check/split/deduce)
2026-04-25 03:58:12 +00:00

6 lines
239 B
Prolog

%% 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).