IF/Prolog

1 program Added 2026-03-05T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: IF-Prolog, IFProlog
Provenance: commit 25546ee8a1 · authored 2026-03-05T17:42:41+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

mu-Prolog (0.32)Nu-Prolog (0.32)Qu-Prolog (0.32)B-Prolog (0.30)BProlog (0.30)

LLM-contributed programs

Quicksort

Provenance: commit 25546ee8a1 · authored 2026-03-05T17:42:41+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.pl · license: Public Domain · added: 2026-03-05T10:00:00Z
% Quicksort implementation in IF/Prolog
quicksort([], []).
quicksort([H|T], Sorted) :-
    partition(H, T, Less, Greater),
    quicksort(Less, SortedLess),
    quicksort(Greater, SortedGreater),
    append(SortedLess, [H|SortedGreater], Sorted).

partition(_, [], [], []).
partition(Pivot, [H|T], [H|Less], Greater) :-
    H =< Pivot, !,
    partition(Pivot, T, Less, Greater).
partition(Pivot, [H|T], Less, [H|Greater]) :-
    H > Pivot,
    partition(Pivot, T, Less, Greater).

:- quicksort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3], Sorted),
   write(Sorted), nl.

Contribute — propose a file extension

Tell us where to find evidence about IF/Prolog (mapped to pl/if_prolog). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/IF-Prolog/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← If(j)invert()if(l)change()if(q)input()if(t)output(x); Iflang →