prolog: append.pl + append.sx classic, 6 tests (build/check/split/deduce)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
5
lib/prolog/tests/programs/append.pl
Normal file
5
lib/prolog/tests/programs/append.pl
Normal file
@@ -0,0 +1,5 @@
|
||||
%% 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).
|
||||
Reference in New Issue
Block a user