Trealla Prolog
1 program
Added 2026-03-11T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: trealla, tpl
Provenance: commit f0f15a0cf0 · authored 2026-03-11T21:11:48+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
2 sources · pl_id:
pl/tplRelated languages
LLM-contributed programs
Quicksort
Provenance: commit f0f15a0cf0 · authored 2026-03-11T21:11:48+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
:- module(quicksort, [qsort/2]).
qsort([], []).
qsort([H|T], Sorted) :-
partition(H, T, Left, Right),
qsort(Left, SortedLeft),
qsort(Right, SortedRight),
append(SortedLeft, [H|SortedRight], Sorted).
partition(_, [], [], []).
partition(Pivot, [H|T], [H|Left], Right) :-
H =< Pivot, !,
partition(Pivot, T, Left, Right).
partition(Pivot, [H|T], Left, [H|Right]) :-
H > Pivot,
partition(Pivot, T, Left, Right).
:- initialization(main, main).
main :-
qsort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5], Sorted),
write(Sorted), nl.
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)